/* ==========================================================================
   0. DESIGN SYSTEM VARIABLES (Fresh Premium Studio Light)
   ========================================================================== */
:root {
    /* Bright, Luxurious & Fresh Backgrounds */
    --bg-main: #fcfbfa;        /* Sattes, klares Core-Beige für die edle Studio-Basis */
    --bg-card: #ffffff;        /* Pure White für die Module – maximaler Kontrast */
    --bg-input: #f7f6f2;       /* Etwas dunkleres Beige für saubere, moderne Eingabefelder */
    
    /* Typography & Core Brand (High Contrast, Fresh & Mature) */
    --brand-dark: #0f141c;     /* Deep Cyber-Navy – fast schwarz, extrem edel für Typografie */
    --brand-primary: #7a9e9f;  /* Ein klares, frisches Pastell-Eisblau/Salbei – der Hauptakzent (Null Erdigkeit) */
    --brand-muted: #626c77;    /* Kühles Schiefergrau für Nebentexte */
    --brand-border: #b8c1c4;   /* Deutliche, saubere Rahmenfarbe (kühles Grau-Beige) */
    
    /* Feedback Colors (Klar, modern und signalstark) */
    --error: #eb5e28;          /* Knackiges, modernes Neon-Pastellorange */
    --error-bg: #fdf2ee;
    --success: #38b000;        /* Frisches, klares Digital-Grün */
    --success-bg: #eff9ed;

    /* Badges & Special Tags */
    --mint-accent: #4ea8de;    /* Leuchtendes Pastell-Cyan/Hellblau für den modernen Tech-Look */
    --mint-bg: #eaf5fc;

    /* Layout & Styling (Scharf und modern) */
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    /* Flüssige, leicht elastische Transitions für High-End Feeling */
    --shadow-sm: 0 4px 12px rgba(15, 20, 28, 0.03);
    --shadow-md: 0 20px 40px rgba(15, 20, 28, 0.08);
    --shadow-glow: 0 12px 24px rgba(122, 158, 159, 0.2);
    
    --transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

/* ==========================================================================
   1. RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-main);
    color: var(--brand-dark);
    min-height: 100vh;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   2. AUTH / LOGIN & REGISTER
   ========================================================================== */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-container {
    background-color: var(--bg-card);
    padding: 48px 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--brand-border);
    width: 100%;
    max-width: 410px;
    animation: fadeInIntro 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes fadeInIntro {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.auth-container h1 {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    color: var(--brand-dark);
    letter-spacing: -0.5px;
}

.auth-container p.subtitle {
    font-size: 0.95rem;
    color: var(--brand-muted);
    text-align: center;
    margin-bottom: 36px;
}

.auth-container h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--brand-dark);
    letter-spacing: -0.3px;
}

.input-group {
    margin-bottom: 24px;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background-color: var(--bg-input);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--brand-dark);
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    background-color: var(--bg-card);
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(122, 158, 159, 0.15);
}

/* Edler, cleaner Primary-Button mit Light-Glow */
.btn {
    width: 100%;
    padding: 16px;
    background-color: var(--brand-primary);
    border: none;
    border-radius: var(--radius-md);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    background-color: var(--brand-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn:active {
    transform: translateY(0);
}

.toggle-text {
    margin-top: 28px;
    font-size: 0.9rem;
    text-align: center;
    color: var(--brand-muted);
}

.toggle-text a {
    color: var(--brand-primary);
    text-decoration: none;
    font-weight: 700;
    margin-left: 4px;
    border-bottom: 1.5px solid transparent;
    transition: var(--transition);
}

.toggle-text a:hover {
    border-color: var(--brand-primary);
}

/* ==========================================================================
   3. DASHBOARD MAIN LAYOUT
   ========================================================================== */
.dashboard-container {
    width: 100%;
    max-width: 680px; 
    margin: 0 auto;
    padding: 0 24px 80px 24px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0 24px 0;
    border-bottom: 2px solid var(--brand-border);
}

.logo {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.8px;
    color: var(--brand-dark);
}

.logo span {
    color: var(--brand-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Frisches Sterne-Badge */
.star-badge {
    background-color: var(--mint-bg);
    border: 1px solid var(--mint-accent);
    color: var(--mint-accent);
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

/* Runder Profil-Button mit eleganter Rotation */
.btn-profile-toggle {
    background-color: var(--bg-card);
    border: 2px solid var(--brand-border);
    color: var(--brand-primary);
    font-size: 1rem;
    font-weight: 700;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-profile-toggle:hover {
    background-color: var(--brand-primary);
    color: var(--bg-card);
    border-color: var(--brand-primary);
    transform: rotate(15deg) scale(1.05);
}

/* Architektonische Navigations-Tabs */
.main-nav {
    display: flex;
    gap: 8px;
    margin: 32px 0;
    background-color: var(--bg-input);
    padding: 6px;
    border-radius: var(--radius-md);
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 12px;
    text-decoration: none;
    color: var(--brand-muted);
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-item.active, .nav-item:hover {
    background-color: var(--bg-card);
    color: var(--brand-primary);
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: 24px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* ==========================================================================
   4. QUEST FEED / CARDS (Edler Lift- & Glow-Effekt)
   ========================================================================== */
.quests-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quest-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    border: 2px solid var(--brand-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition);
    cursor: pointer;
}

/* Flüssige Schwebe-Animation beim Hovern */
.quest-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(15, 20, 28, 0.06);
}

/* Frische, moderne Farb-Indikatoren, die beim Hovern mitleuchten */
.quest-card.stars-10 { border-left: 6px solid var(--brand-primary); } 
.quest-card.stars-20 { border-left: 6px solid var(--mint-accent); } 
.quest-card.stars-30 { border-left: 6px solid var(--error); } 

.quest-card.stars-10:hover { border-left-color: #618485; }
.quest-card.stars-20:hover { border-left-color: #0077b6; }
.quest-card.stars-30:hover { border-left-color: #d64106; }

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quest-tags {
    display: flex;
    gap: 6px;
}

.tag {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-main);
    color: var(--brand-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: 1px solid var(--brand-border);
}

.quest-stars {
    font-weight: 900;
    color: var(--brand-primary);
    font-size: 0.95rem;
}

.quest-card h3 {
    font-size: 1.2rem;
    color: var(--brand-dark);
    font-weight: 700;
    line-height: 1.4;
}

/* Popup-Trigger bleibt unsichtbar im Grid */
.quest-card .btn-complete {
    display: none;
}

/* ==========================================================================
   4b. QUEST POPUP SYSTEM (Smooth Cinematic Blur Overlay)
   ========================================================================== */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(15, 20, 28, 0.15);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.popup-content {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px solid var(--brand-border);
    width: 100%;
    max-width: 460px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(15, 20, 28, 0.12);
    position: relative;
    /* Eleganter, geschmeidiger Scale-In */
    animation: popupAppear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popupAppear {
    from { transform: scale(0.94) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.btn-close-popup {
    position: absolute;
    top: 24px; right: 24px;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--brand-muted);
    transition: var(--transition);
}

.btn-close-popup:hover {
    color: var(--brand-dark);
    transform: scale(1.1) rotate(90deg);
}

#popup-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#popup-details h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-dark);
}

#popup-details p {
    font-size: 1rem;
    color: var(--brand-muted);
    line-height: 1.6;
}

/* Minimalistischer, edler Button im Popup */
.popup-content .btn-complete {
    width: 100%;
    padding: 14px;
    background-color: transparent;
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 10px;
}

.popup-content .btn-complete:hover {
    background-color: var(--brand-primary);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   5. SIDEBAR SYSTEM (PROFIL)
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0; right: -100%; width: 100%; height: 100%;
    z-index: 1000;
    transition: right 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    justify-content: flex-end;
}

.sidebar.open {
    right: 0;
}

.sidebar-content {
    position: relative;
    z-index: 1002;
    background-color: var(--bg-card);
    width: 85%;
    max-width: 340px;
    height: 100%;
    padding: 48px 36px;
    box-shadow: -10px 0 40px rgba(15, 20, 28, 0.04);
    display: flex;
    flex-direction: column;
    border-left: 2px solid var(--brand-border);
}

.sidebar-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(15, 20, 28, 0.1); 
    backdrop-filter: blur(6px);
    z-index: 1001;
    display: none;
}

.sidebar.open .sidebar-overlay {
    display: block;
}

.btn-close-sidebar {
    position: absolute;
    top: 36px; right: 36px;
    background: none;
    border: none;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    color: var(--brand-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: var(--transition);
}

.btn-close-sidebar:hover {
    color: var(--brand-dark);
    transform: scale(1.05);
}

.sidebar-user-card {
    text-align: center;
    margin: 64px 0 32px 0;
}

.sidebar-user-card h3 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--brand-dark);
    letter-spacing: -0.5px;
}

.sidebar-divider {
    border: none;
    border-top: 2px solid var(--bg-main);
    margin-bottom: 32px;
}

/* Cleaner Logout-Button */
.btn-logout {
    width: 100%;
    padding: 14px;
    background-color: transparent;
    border: 2px solid var(--error);
    color: var(--error);
    border-radius: var(--radius-md);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background-color: var(--error);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(235, 94, 40, 0.15);
}

/* Feedback-Boxen */
.error-box, .success-box {
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    margin-bottom: 24px;
    border: 2px solid;
    font-weight: 600;
}

.error-box { background-color: var(--error-bg); color: var(--error); border-color: var(--error); }
.success-box { background-color: var(--success-bg); color: var(--success); border-color: var(--success); }

/* Loading State */
.loading {
    text-align: center;
    padding: 48px;
    color: var(--brand-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
}