/* ==========================================================================
   1. RESET & BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: #f5f2eb; /* Edles, mattes Grund-Beige */
    color: #1c2e24; /* Tiefes Dunkelgrün-Schwarz für maximalen Textkontrast */
    min-height: 100vh;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   2. AUTH / LOGIN & REGISTER (index.html)
   ========================================================================== */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-container {
    background-color: #ffffff;
    padding: 40px 24px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(28, 46, 36, 0.06);
    border: 1px solid #e3ded5;
    width: 100%;
    max-width: 380px;
}

.auth-container h1 {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 6px;
    color: #0f2419; /* Tiefes Dunkelgrün */
    letter-spacing: -0.5px;
}

.auth-container p.subtitle {
    font-size: 0.95rem;
    color: #5c6660;
    text-align: center;
    margin-bottom: 32px;
}

.auth-container h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #0f2419;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #38453e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group input {
    width: 100%;
    padding: 14px;
    background-color: #faf9f6;
    border: 2px solid #d1cac0; /* Deutlicher Kontrast für Eingabefelder */
    border-radius: 10px;
    color: #0f2419;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: #124029; /* Dunkelgrüner Fokus-Rahmen */
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(18, 64, 41, 0.15);
}

.btn {
    width: 100%;
    padding: 14px;
    background-color: #124029; /* Sattes Dunkelgrün als Haupt-Button */
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #0b291a;
}

.toggle-text {
    margin-top: 24px;
    font-size: 0.9rem;
    text-align: center;
    color: #5c6660;
}

.toggle-text a {
    color: #124029;
    text-decoration: none;
    font-weight: 700;
}

.toggle-text a:hover {
    text-decoration: underline;
}

/* Feedback-Boxen */
.error-box, .success-box {
    padding: 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    margin-bottom: 24px;
    border: 2px solid;
    font-weight: 600;
}

.error-box {
    background-color: #ffeef0;
    color: #ba1a1a;
    border-color: #ffb4ab;
}

.success-box {
    background-color: #e8f5e9;
    color: #2e7d32;
    border-color: #a5d6a7;
}

/* ==========================================================================
   3. DASHBOARD MAIN LAYOUT (quests.html)
   ========================================================================== */
.dashboard-container {
    width: 100%;
    max-width: 600px; /* Perfekt für mobile Daumenbedienung und Desktop-Feed */
    margin: 0 auto;
    padding: 0 16px 60px 16px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0 16px 0;
    border-bottom: 2px solid #e3ded5;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #124029; /* Dunkelgrün */
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Sterne-Badge im Header */
.star-badge {
    background-color: #e6fcf5; /* Frisches Pastell-Mintgrün */
    border: 2px solid #c3fae8;
    color: #0ca678; /* Kontrast-Grün für den Wert */
    padding: 8px 16px;
    border-radius: 24px;
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

/* Minimaler, runder Profil-Button */
.btn-profile-toggle {
    background-color: #ffffff;
    border: 2px solid #d1cac0;
    color: #124029;
    font-size: 0.95rem;
    font-weight: 700;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.btn-profile-toggle:hover {
    background-color: #124029;
    color: #ffffff;
    border-color: #124029;
}

/* Navigation Tabs */
.main-nav {
    display: flex;
    gap: 8px;
    margin: 24px 0;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 14px;
    text-decoration: none;
    color: #5c6660;
    font-weight: 700;
    font-size: 0.95rem;
    background-color: #e3ded5;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav-item.active, .nav-item:hover {
    background-color: #ffffff;
    color: #124029;
    box-shadow: 0 4px 12px rgba(28, 46, 36, 0.05);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #124029;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ==========================================================================
   4. QUEST FEED / CARDS
   ========================================================================== */
.quests-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quest-card {
    background-color: #ffffff;
    border-radius: 14px;
    padding: 24px;
    border: 2px solid #e3ded5;
    box-shadow: 0 4px 14px rgba(28, 46, 36, 0.02);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Subtile, aber klar erkennbare Pastell-Akzente auf den Karten */
.quest-card.stars-10 { border-left: 6px solid #a5d8ff; } /* Pastellblau */
.quest-card.stars-20 { border-left: 6px solid #b197fc; } /* Pastellviolett */
.quest-card.stars-30 { border-left: 6px solid #ffd43b; } /* Pastellgelb */

.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quest-tags {
    display: flex;
    gap: 6px;
}

.tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    background-color: #f5f2eb; /* Passt sich der Grundfarbe an */
    color: #38453e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quest-stars {
    font-weight: 800;
    color: #124029; /* Dunkelgrün für perfekte Sichtbarkeit */
    font-size: 0.95rem;
}

.quest-card h3 {
    font-size: 1.25rem;
    color: #0f2419;
    font-weight: 700;
    line-height: 1.3;
}

.quest-card p {
    font-size: 1rem;
    color: #38453e;
    line-height: 1.6;
}

/* Cooler, invertierter Erledigt-Button */
.btn-complete {
    width: 100%;
    padding: 14px;
    background-color: #ffffff;
    border: 2px solid #124029;
    color: #124029;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-complete:hover {
    background-color: #124029;
    color: #ffffff;
}

/* ==========================================================================
   5. SIDEBAR SYSTEM (PROFIL)
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: flex-end;
}

.sidebar.open {
    right: 0;
}

.sidebar-content {
    position: relative;
    z-index: 1002;
    background-color: #ffffff;
    width: 85%;
    max-width: 280px;
    height: 100%;
    padding: 40px 24px;
    box-shadow: -6px 0 24px rgba(28, 46, 36, 0.08);
    display: flex;
    flex-direction: column;
}

.sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 36, 25, 0.4); /* Dunkelgrüner transparenter Overlay */
    backdrop-filter: blur(2px);
    z-index: 1001;
    display: none;
}

.sidebar.open .sidebar-overlay {
    display: block;
}

.btn-close-sidebar {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    color: #5c6660;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-user-card {
    text-align: center;
    margin: 48px 0 24px 0;
}

.sidebar-user-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f2419;
}

.sidebar-divider {
    border: none;
    border-top: 2px solid #f5f2eb;
    margin-bottom: 24px;
}

/* Cleaner, kontraststarker Logout-Button */
.btn-logout {
    width: 100%;
    padding: 14px;
    background-color: #ffffff;
    border: 2px solid #c53030;
    color: #c53030;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: #fff5f5;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #5c6660;
    font-weight: 600;
}