:root {
    --primary: #25D366;
    --primary-glow: rgba(37, 211, 102, 0.5);
    --dark: #000000;
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);

    /* Apple Glass Tokens */
    --glass-bg: rgba(20, 20, 20, 0.4);
    /* Darker, clearer glass */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);
    --blur: 24px;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: black;
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

canvas#space {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: block;
}

/* --- Apple Glass Panel --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    /* Top light source */
    border-radius: 24px;
    padding: 40px;
    width: 420px;
    box-shadow:
        0 4px 24px -1px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.2);
    /* Inner Ring */
    text-align: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Enhance hover effect */
.glass-panel:hover {
    background: rgba(40, 40, 40, 0.5);
    box-shadow:
        0 20px 40px -4px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Typography */
h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
    /* Setup Premium Font */
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 32px;
    background: linear-gradient(to bottom, #fff, #bbb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3 {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 30px;
}

/* Modern Inputs */
input,
select {
    width: 100%;
    padding: 14px 16px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.1);
}

/* Modern Buttons */
button {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: #ffffff;
    /* Contrast button */
    color: black;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

button:hover {
    transform: scale(1.02);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

button:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Secondary Button Style */
button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

button.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.link {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
}

.link:hover {
    color: white;
    text-decoration: underline;
}

/* Dashboard Specific */
#dashboard {
    width: 900px;
    text-align: left;
}

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

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.vip {
    background: gold;
    color: black;
    box-shadow: 0 0 10px gold;
}

/* --- Dashboard Layout --- */
#dashboard.dashboard-container {
    width: 1000px;
    height: 600px;
    padding: 0;
    /* Let content fill */
    display: flex;
    overflow: hidden;
    /* Contain inner scroll */
    text-align: left;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-sizing: border-box;
}

.sidebar .logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 40px;
    background: linear-gradient(90deg, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-item {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.user-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--glass-border);
}

.user-profile .avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile .info .name {
    font-size: 14px;
    font-weight: 600;
}

.user-profile .info .badge {
    font-size: 11px;
    color: var(--primary);
}

.logout-btn {
    margin: 0;
    padding: 8px;
    background: transparent;
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff4444;
    font-size: 12px;
}

.logout-btn:hover {
    background: rgba(255, 68, 68, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h2 {
    margin: 0;
    font-size: 24px;
}

.expires-chip {
    background: rgba(255, 215, 0, 0.1);
    color: gold;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 16px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card .icon {
    font-size: 20px;
    margin-bottom: 8px;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    font-family: 'Outfit';
}

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

/* Action Grid */
.grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    flex: 1;
}

.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header h3 {
    margin: 0;
    color: white;
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* Terminal */
.terminal-card {
    background: #0c0c0c;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    position: relative;
}

.terminal-header {
    background: #1a1a1a;
    padding: 10px 14px;
    display: flex;
    gap: 8px;
    align-items: center;
    border-bottom: 1px solid #222;
}

.title {
    margin-left: auto;
    margin-right: auto;
    font-size: 11px;
    color: #555;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.logs {
    flex: 1;
    background: transparent;
    padding: 16px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-y: auto;
    color: #e5e5e5;
}

/* Custom Scrollbar for Terminal */
.logs::-webkit-scrollbar {
    width: 6px;
}

.logs::-webkit-scrollbar-track {
    background: #0c0c0c;
}

.logs::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.logs::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Log Item Styles */
.log-item {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 2px;
    margin-bottom: 2px;
}

.log-time {
    color: #555;
    min-width: 60px;
}

.log-msg {
    color: #ccc;
}

.log-success {
    color: #25D366;
}

.log-error {
    color: #ff4444;
}

.log-warn {
    color: #ffbb00;
}

.log-info {
    color: #4da6ff;
}

/* UTILITY - Keep at bottom for override */
.hidden,
#auth-panel.hidden,
#dashboard.hidden,
#admin-panel.hidden,
#vip-modal.hidden {
    display: none !important;
}