/* ==============================
   App Layout
   ============================== */
.app-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.3) 0%, rgba(10, 10, 26, 0.95) 100%);
    border-bottom: 2px solid var(--purple-500);
    position: sticky;
    top: 0;
    z-index: var(--z-nav);
    backdrop-filter: blur(10px);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo-icon {
    font-size: 1.5rem;
}
.logo-text {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--blue-400), var(--purple-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
}
.logo-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* Mini Stats in Top Bar */
.mini-stats {
    display: flex;
    align-items: center;
    gap: 20px;
}
.mini-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}
.mini-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.mini-value {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--blue-400);
}
.mini-stat.gold .mini-value {
    color: var(--gold-400);
}
.mini-stat.streak .mini-value {
    color: var(--orange-500);
}
.mini-xp-bar {
    width: 120px;
    height: 6px;
    background: rgba(74, 158, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}
.mini-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blue-500), var(--purple-400));
    border-radius: 3px;
    transition: width var(--transition-slow);
}

/* Profile Button & Dropdown */
.profile-wrapper {
    position: relative;
}
.profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}
.profile-btn:hover {
    background: rgba(74, 158, 255, 0.2);
    border-color: var(--blue-400);
}
.profile-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.2s ease;
    overflow: hidden;
}
.profile-dropdown-header {
    padding: 14px 16px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
}
.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    text-align: left;
    position: relative;
}
.profile-dropdown-item:hover {
    background: rgba(74, 158, 255, 0.1);
    color: var(--text-primary);
}
.profile-dropdown-item.danger {
    color: var(--red-400);
}
.profile-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.12);
}
.profile-dropdown-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: auto;
}

/* God Reset Modal */
.god-reset-modal {
    max-width: 420px;
    text-align: center;
    border: 2px solid var(--red-500);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), var(--bg-card));
}
.god-reset-icon {
    font-size: 3.5rem;
    margin-bottom: 8px;
    animation: pulse 2s infinite;
}
.god-reset-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--red-400);
    margin-bottom: 12px;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}
.god-reset-warn {
    font-size: 0.95rem;
    color: var(--orange-400);
    margin-bottom: 12px;
}
.god-reset-list {
    text-align: left;
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}
.god-reset-list li {
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.god-reset-list li::before {
    content: '✕ ';
    color: var(--red-400);
}
.god-reset-list li strong {
    color: var(--red-400);
}
.god-reset-confirm-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.god-reset-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 16px;
    transition: border-color var(--transition-fast);
}
.god-reset-input:focus {
    outline: none;
    border-color: var(--red-400);
}
.god-reset-actions {
    display: flex;
    gap: 12px;
}
.god-reset-actions .btn {
    flex: 1;
}
.god-reset-actions .btn-danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Navigation Bar */
.nav-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 12px 24px;
    background: rgba(10, 10, 26, 0.9);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    position: relative;
    text-decoration: none;
}
.nav-item:hover {
    color: var(--text-primary);
    background: rgba(74, 158, 255, 0.1);
}
.nav-item.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.15), rgba(124, 58, 237, 0.15));
    border: 1px solid var(--border-glow);
}
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, var(--blue-400), var(--purple-400));
}
.nav-icon {
    font-size: 1.1rem;
}
.nav-jp {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

/* Page Container */
.page-container {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease;
}
.page.active {
    display: block;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
}

/* Column Title */
.column-title {
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .top-bar {
        flex-direction: column;
        gap: 8px;
        padding: 8px 12px;
    }
    .mini-stats {
        gap: 12px;
    }
    .mini-xp-bar {
        width: 80px;
    }
    .nav-bar {
        padding: 8px 12px;
        gap: 2px;
    }
    .nav-item {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .nav-jp {
        display: none;
    }
    .page-container {
        padding: 16px;
    }
}
