:root {
    --bg-dark: #0a0b10;
    --card-bg: rgba(255, 255, 255, 0.05);
    --primary: #007bff;
    --primary-glow: rgba(0, 123, 255, 0.3);
    --success: #10b981;
    --danger: #ef4444;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body.dark-theme {
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Glow Background */
.glow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.glow-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
}

.glow-2 {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    bottom: -50px;
    left: -50px;
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(10, 11, 16, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.container-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    background: var(--primary);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 0 15px var(--primary-glow);
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    font-family: 'Outfit', sans-serif;
}

/* Page Header */
.page-header {
    margin-top: 40px;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    font-family: 'Outfit', sans-serif;
}

.text-muted {
    color: var(--text-muted);
}

.stats-row {
    display: flex;
    gap: 24px;
}

.mini-stat {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Buttons */
.btn {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Accounts Grid */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.account-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.account-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.acc-info h3 {
    font-size: 1.25rem;
    margin-bottom: 2px;
}

.acc-phone {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.status-indicator {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-connected {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-disconnected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.card-body {
    margin-bottom: 24px;
}

.usage-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.u-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.u-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.u-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.card-actions {
    display: flex;
    gap: 12px;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.glass-modal {
    background: #111218;
    border: 1px solid var(--glass-border);
    width: 100%;
    max-width: 450px;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.hidden {
    display: none !important;
}

.input-modern {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    margin-bottom: 16px;
    outline: none;
    transition: all 0.3s;
}

.input-modern:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

/* QR Code & Pairing */
.qr-container {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 20px;
    margin: 20px 0;
}

.qr-image img {
    max-width: 100%;
    border-radius: 10px;
}

.pairing-code-box {
    background: rgba(0, 123, 255, 0.1);
    border: 1px dashed var(--primary);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
}

code {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary);
}

/* Spinner */
.loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Log Section */
.log-section {
    margin-top: 40px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
}

.section-header {
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.log-container {
    height: 300px;
    padding: 20px;
    overflow-y: auto;
    background: #050608;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.log-entry {
    margin-bottom: 4px;
    white-space: pre-wrap;
    border-left: 3px solid transparent;
    padding-left: 12px;
}

.log-timestamp {
    color: var(--text-muted);
    margin-right: 12px;
    font-size: 0.75rem;
}

.log-level {
    font-weight: 700;
    margin-right: 8px;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.level-info { color: var(--primary); border-left-color: var(--primary); }
.level-warn { color: #f59e0b; border-left-color: #f59e0b; }
.level-error { color: var(--danger); border-left-color: var(--danger); }
.level-system { color: #8b5cf6; border-left-color: #8b5cf6; }

.btn-sm {
    padding: 6px 16px;
    font-size: 0.8rem;
    border-radius: 8px;
}

/* Pairing Method Selector */
.method-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.radio-option {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.radio-option input[type="radio"] {
    accent-color: var(--primary);
}

.radio-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(0, 123, 255, 0.1);
}

/* Big Code Display */
.big-code {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 16px;
    margin: 10px 0;
    text-shadow: 0 0 20px var(--primary-glow);
}

/* Modal Mini Logs */
.mini-log-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    height: 120px;
    margin-top: 16px;
    padding: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    overflow-y: auto;
}

.qr-display {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.qr-display img {
    border: 10px solid white;
    border-radius: 8px;
}

.text-center { text-align: center; }
