/* 
   PREMIUM GLASSMORPHISM UI
   Theme: Void / Neon
*/

:root {
    /* Colors */
    --bg-void: #050511;
    --bg-mesh-1: rgba(79, 70, 229, 0.15);
    --bg-mesh-2: rgba(124, 58, 237, 0.15);
    
    /* Glass Effect */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
    --blur-amount: 20px;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    /* Accents */
    --neon-blue: #4F46E5;
    --neon-purple: #7C3AED;
    --neon-cyan: #06b6d4;
    --neon-green: #10B981;
    --neon-red: #ef4444;
    --neon-orange: #f59e0b;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
    --gradient-glow: linear-gradient(135deg, rgba(79, 70, 229, 0.5), rgba(124, 58, 237, 0.5));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-void);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Mesh Background */
.mesh-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, var(--bg-mesh-1) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, var(--bg-mesh-2) 0%, transparent 25%);
    filter: blur(100px);
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 32px;
    font-weight: 700;
}

h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.accent-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* Layout */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 32px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 24px 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.time-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 99px;
    border: 1px solid var(--glass-border);
    font-family: 'Inter', monospace;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-indicator {
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    color: var(--neon-green);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-indicator::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.status-indicator.running {
    color: var(--neon-orange);
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.2);
    animation: pulse-glow 2s infinite;
}

.status-indicator.error {
    color: var(--neon-red);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Controls Section */
.controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.stats {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.stat-item {
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 16px;
    text-align: center;
    min-width: 110px;
    transition: transform 0.2s, background 0.2s;
}

.stat-item:hover {
    background: var(--glass-highlight);
    transform: translateY(-2px);
}

.stat-value {
    display: block;
    font-size: 24px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Buttons */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 100%);
    opacity: 0.5;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--neon-red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.2);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--glass-highlight);
    border-color: rgba(255,255,255,0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Main Content Grid */
.main-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Panels */
.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur-amount));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.01);
}

/* Logs Panel */
.logs-panel {
    height: 600px;
}

.filter-buttons {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 10px;
}

.filter-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--glass-highlight);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logs-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

.log-entry {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid transparent;
    animation: slideIn 0.3s ease-out;
}

.log-entry:hover {
    background: var(--glass-highlight);
    border-color: var(--glass-border);
}

.log-time {
    color: var(--text-tertiary);
    font-size: 11px;
}

.log-type {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    height: fit-content;
}

.log-entry.info .log-type { background: rgba(79, 70, 229, 0.1); color: var(--neon-blue); }
.log-entry.success .log-type { background: rgba(16, 185, 129, 0.1); color: var(--neon-green); }
.log-entry.error .log-type { background: rgba(239, 68, 68, 0.1); color: var(--neon-red); }
.log-entry.warning .log-type { background: rgba(245, 158, 11, 0.1); color: var(--neon-orange); }

.log-message {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Data Panel */
.data-panel {
    display: flex;
    flex-direction: column;
}

.search-wrapper {
    padding: 20px 24px;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}

.search-icon {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
}

.search-input {
    width: 100%;
    padding: 14px 16px 14px 50px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--neon-blue);
    background: rgba(79, 70, 229, 0.05);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Table */
.table-container {
    flex: 1;
    overflow: auto;
    min-height: 0; /* Important for flexbox */
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    min-width: 1000px; /* Ensure scrolling */
}

.data-table th {
    background: rgba(5, 5, 17, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    text-align: left;
    padding: 16px 20px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
    z-index: 10;
}

.data-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-primary);
    white-space: nowrap;
    transition: background 0.2s;
}

.data-table tbody tr {
    transition: all 0.2s;
}

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
    color: white;
}

.data-table .empty-row td {
    text-align: center;
    padding: 60px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid transparent;
}

.status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--neon-green);
    border-color: rgba(16, 185, 129, 0.2);
}

.status-badge.inactive {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-tertiary);
}

/* Pagination */
.pagination {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.page-btn {
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    background: var(--neon-blue);
    border-color: var(--neon-blue);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.page-info {
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Progress Panel */
.progress-panel {
    margin-bottom: 40px;
    padding: 0;
}

.progress-wrapper {
    padding: 32px;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 32px;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 99px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: 99px;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.5);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 60px;
    text-align: right;
}

.step-indicators {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.step-indicators::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.step {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100px;
}

.step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-void);
    border: 2px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-tertiary);
    transition: all 0.3s;
}

.step.active .step-circle {
    border-color: var(--neon-blue);
    color: var(--neon-blue);
    background: rgba(79, 70, 229, 0.1);
    box-shadow: 0 0 0 8px rgba(79, 70, 229, 0.1);
    transform: scale(1.1);
}

.step.completed .step-circle {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: black;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}

.step.active .step-label { color: var(--text-primary); }
.step.completed .step-label { color: var(--neon-green); }

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 17, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(160deg, rgba(30, 30, 40, 0.9), rgba(15, 15, 20, 0.95));
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--neon-red);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.user-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.info-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: border-color 0.2s;
}

.info-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.info-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    margin-bottom: 6px;
}

.info-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.payments-section h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.payment-item {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid transparent;
}

.payment-item:hover {
    border-color: var(--neon-green);
    background: rgba(16, 185, 129, 0.05);
}

.payment-product {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.payment-dates {
    font-size: 12px;
    color: var(--text-secondary);
}

.payment-amount {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--neon-green);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animations */
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Responsive */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .logs-panel {
        height: 300px;
    }

    .container {
        padding: 16px;
    }
}
