/* ==========================================================================
   Premium Dark Glassmorphic Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --bg-main: #09090b; /* zinc-950 */
    --bg-darker: #121214; /* clean dark zinc */
    --accent-primary: #4f46e5; /* indigo-600 */
    --accent-primary-glow: rgba(79, 70, 229, 0.25);
    --accent-secondary: #0ea5e9; /* sky-500 */
    --accent-secondary-glow: rgba(14, 165, 233, 0.25);
    --accent-pink: #d946ef; /* fuchsia-500 */
    --accent-success: #10b981; /* emerald-500 */
    --accent-warning: #f59e0b; /* amber-500 */
    --accent-danger: #ef4444; /* red-500 */
    
    /* Text Colors */
    --text-pure: #fafafa; /* zinc-50 */
    --text-muted: #a1a1aa; /* zinc-400 */
    --text-lavender: #d4d4d8; /* zinc-300 */
    
    /* Glassmorphism Styles */
    --glass-bg: rgba(24, 24, 27, 0.7); /* zinc-900 with transparency */
    --glass-bg-hover: rgba(39, 39, 42, 0.8); /* zinc-800 with transparency */
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-shadow: rgba(0, 0, 0, 0.55);
    --border-radius: 16px;
    
    /* Fonts */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    
    /* Transitions */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles & Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-pure);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

p {
    color: var(--text-muted);
    line-height: 1.6;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

a:hover {
    color: var(--text-pure);
    text-shadow: 0 0 8px var(--accent-secondary-glow);
}

/* Layout Elements */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Navigation */
header {
    background: rgba(6, 5, 10, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-pure);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-secondary);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px var(--accent-secondary);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text-lavender);
    font-weight: 500;
    font-size: 15px;
    padding: 8px 12px;
    border-radius: 8px;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-pure);
    background: rgba(255, 255, 255, 0.05);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 28px;
    box-shadow: 0 8px 32px var(--glass-shadow);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: var(--glass-bg-hover);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    gap: 8px;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--text-pure);
    box-shadow: 0 4px 15px var(--accent-primary-glow);
}

.btn-primary:hover {
    background: #6366f1; /* slightly lighter indigo */
    box-shadow: 0 6px 20px var(--accent-primary-glow);
    transform: scale(1.02);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    color: var(--text-pure);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: var(--accent-danger);
    color: var(--text-pure);
}

.btn-danger:hover {
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
    transform: scale(1.02);
}

.btn-google {
    background: #ffffff;
    color: #1f2937;
    font-weight: 500;
}

.btn-google:hover {
    background: #f3f4f6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

/* Input Fields */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-lavender);
}

.form-control {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 12px 16px;
    font-family: var(--font-sans);
    color: var(--text-pure);
    font-size: 15px;
    transition: var(--transition-smooth);
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--accent-primary-glow);
    background: rgba(255, 255, 255, 0.08);
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fcd34d;
}

/* Auth Page Layout */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 40px 20px;
}

.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-muted);
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.auth-tab.active {
    background: var(--accent-primary);
    color: var(--text-pure);
    box-shadow: 0 4px 12px var(--accent-primary-glow);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.auth-divider:not(:empty)::before {
    margin-right: 15px;
}

.auth-divider:not(:empty)::after {
    margin-left: 15px;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 40px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.line-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 24px;
}

@media (max-width: 600px) {
    .line-info-grid {
        grid-template-columns: 1fr;
    }
}

.info-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-item .label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item .value-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.info-item .value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-pure);
    word-break: break-all;
}

/* Interactive Copier Copy Button */
.btn-copy {
    background: none;
    border: none;
    color: var(--accent-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-copy:hover {
    color: var(--text-pure);
    background: rgba(255, 255, 255, 0.08);
}

/* Timer Ring / Expiry Progress Card */
.expiry-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}

.progress-ring-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 20px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.35s;
    transform-origin: 50% 50%;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 22px;
    font-weight: 800;
    color: var(--text-pure);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Timers list under ring */
.timer-details {
    width: 100%;
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timer-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

/* Credentials update form */
.creds-card {
    margin-top: 30px;
}

/* Index / Welcome Page */
.hero-section {
    text-align: center;
    padding: 100px 20px;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.hero-title {
    font-size: 56px;
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-pure);
}

@media (max-width: 600px) {
    .hero-title {
        font-size: 40px;
    }
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-lavender);
    max-width: 600px;
}

/* Admin Dashboard CSS */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

@media (max-width: 768px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 24px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 32px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    color: var(--accent-primary);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-pure);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

/* Management Tables */
.admin-section {
    margin-top: 40px;
}

.admin-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

th, td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-lavender);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.badge {
    display: inline-flex;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.action-btns {
    display: flex;
    gap: 8px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-darker);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    padding: 28px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: var(--transition-smooth);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-pure);
}

/* Footer */
footer {
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    color: var(--text-muted);
    font-size: 14px;
    background: rgba(6, 5, 10, 0.2);
}

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