/* ==============================================================================
   GAMA PRO SAAS - MODERN LUXURY DARK UI DESIGN SYSTEM
   ============================================================================== */

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

:root {
    --bg-main: #090a10;
    --bg-surface: #10121d;
    --bg-card: rgba(22, 25, 40, 0.75);
    --bg-card-hover: rgba(30, 34, 55, 0.85);
    --bg-input: rgba(14, 16, 26, 0.8);
    
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.4);
    --border-active: #6366f1;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
    --primary-glow: rgba(99, 102, 241, 0.35);
    
    --accent: #06b6d4;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 60%);
    background-attachment: fixed;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ─── AUTHENTICATION PAGE LAYOUT ────────────────────────────────────────────── */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    position: relative;
    z-index: 10;
    animation: fadeInScale 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #a5b4fc;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

.auth-brand h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.4rem;
}

.auth-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Tab Switcher (Login / Register) */
.auth-tabs {
    display: flex;
    background: rgba(10, 12, 20, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 5px;
    margin-bottom: 1.8rem;
}

.auth-tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.auth-tab-btn.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrap i {
    position: absolute;
    left: 15px;
    color: var(--text-dim);
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.form-control {
    width: 100%;
    padding: 13px 14px 13px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
    background: rgba(18, 21, 35, 0.9);
}

.form-control:focus + i,
.input-icon-wrap:focus-within i {
    color: var(--primary);
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    z-index: 5;
    transition: color 0.2s ease, transform 0.15s ease;
}

.password-toggle-btn:hover {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.input-icon-wrap .password-toggle-btn i {
    position: static !important;
    left: auto !important;
    pointer-events: none !important;
    color: inherit !important;
    font-size: 1rem !important;
}

.form-control.has-toggle {
    padding-right: 42px !important;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 20px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ─── DASHBOARD SHELL & NAVBAR ──────────────────────────────────────────────── */

.dashboard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(16, 18, 29, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-brand-text h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    line-height: 1.1;
}

.nav-brand-text span {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--primary);
    text-transform: uppercase;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.user-role-tag {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.role-admin {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
}

.role-user {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
}

.btn-secondary {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

/* ─── DASHBOARD CONTENT LAYOUT ──────────────────────────────────────────────── */

.dashboard-container {
    max-width: 1240px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 4px;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h4 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info .stat-number {
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    margin-top: 4px;
}

/* License Card for Member Area */
.license-card-hero {
    background: linear-gradient(145deg, rgba(28, 32, 52, 0.8), rgba(15, 17, 30, 0.9));
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md), 0 0 50px rgba(99, 102, 241, 0.15);
    margin-bottom: 2rem;
}

.license-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.25rem;
}

.license-hero-badge {
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge-active {
    background: var(--success-bg);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-revoked {
    background: var(--danger-bg);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.license-key-box {
    display: flex;
    align-items: center;
    background: rgba(8, 10, 18, 0.85);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    margin: 1.25rem 0;
    gap: 12px;
}

.license-key-text {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.15rem;
    font-weight: 600;
    color: #38bdf8;
    letter-spacing: 1px;
    word-break: break-all;
}

/* Feature Grid Badges */
.feature-badge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 1.25rem;
}

.feature-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
}

.pill-unlocked {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.pill-locked {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-dim);
    border: 1px solid var(--border);
    opacity: 0.6;
}

/* Table Style for Admin */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.custom-table th {
    background: rgba(15, 17, 28, 0.9);
    padding: 14px 18px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.custom-table td {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    vertical-align: middle;
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-box {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-surface);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: var(--shadow-md);
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
.toast-info { border-left: 4px solid var(--primary); }

.toast.hide {
    opacity: 0;
    transform: translateX(50px);
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ─── GLOBAL RESPONSIVE MEDIA QUERIES (TABLET & MOBILE HP) ───────────────── */

@media (max-width: 768px) {
    /* Navbar Mobile */
    .dashboard-nav {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .nav-brand-text h2 {
        font-size: 1.1rem;
    }
    .nav-user {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .user-badge {
        padding: 4px 10px;
        font-size: 0.8rem;
    }
    .btn-secondary {
        padding: 6px 12px;
        font-size: 0.82rem;
    }

    /* Container Mobile */
    .dashboard-container {
        padding: 0 0.85rem;
        margin: 1.25rem auto;
    }

    /* Auth Page Mobile */
    .auth-wrapper {
        padding: 1.5rem 0.85rem;
    }
    .auth-card {
        padding: 1.75rem 1.25rem;
        border-radius: var(--radius-md);
    }
    .auth-brand h1 {
        font-size: 1.65rem;
    }

    /* Modal Mobile */
    .modal-overlay {
        padding: 0.5rem;
        align-items: flex-end;
    }
    .modal-box {
        padding: 1.25rem 1rem;
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        margin: 0;
    }
    .modal-head {
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    .modal-head h3 {
        font-size: 1.1rem;
    }

    /* Toast Notifications Mobile */
    .toast-container {
        left: 12px;
        right: 12px;
        bottom: 15px;
    }
    .toast {
        padding: 10px 14px;
        font-size: 0.88rem;
    }
}

@media (max-width: 480px) {
    .nav-brand-text span {
        display: none;
    }
    .nav-user .btn-secondary span {
        display: none;
    }
    .user-badge span:not(.user-role-tag) {
        display: none;
    }
    .form-control {
        font-size: 0.88rem;
        padding: 11px 12px 11px 40px;
    }
    .btn-primary {
        padding: 12px;
        font-size: 0.95rem;
    }
}
