:root {
    --bg-color: #FFFFFF;
    --text-dark: #2D3436;
    --text-sub: #636E72;
    --text-light: #FFFFFF;

    /* Navigācija */
    --nav-bg: #E5E7EB;
    --nav-active: #2D3436;
    --nav-inactive: #6B7280;

    /* Amble Sheep Palette */
    --amb-orange: #FF9A7B;
    --amb-purple: #C5BEE9;
    --amb-blue: #AED9F1;
    --amb-yellow: #EBEB7A;
    --amb-green: #A8E6CF;
    --amb-lime: #E1FF57;

    /* Map constellation colors */
    --map-bg: #ffffff;
    --map-purple-soft: #EDE9FE;
    --map-purple-medium: #C4B5FD;
    --map-purple-accent: #8B5CF6;
    --map-purple-text: #6D28D9;
    --map-lime-soft: #ECFCCB;
    --map-lime-medium: #BEF264;
    --map-lime-accent: #84CC16;
    --map-text-primary: #4A4458;
    --map-text-secondary: #8A8494;
    --map-text-muted: #A8A4B0;

    /* Filter Chips */
    --chip-bg: #F3F4F6;
    --chip-active: #2D3436;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-dark);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* --- RESPONSIVE CONTAINER --- */
.app-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    position: relative;
    transition: max-width 0.3s ease, box-shadow 0.3s ease;
}

/* Tablet (iPad) - 768px līdz 1023px */
@media (min-width: 768px) {
    body {
        background-color: #F5F5F5; /* Gaiši pelēks fons ārpus konteinera */
    }

    .app-container {
        max-width: 600px;
        box-shadow: 0 0 40px rgba(0,0,0,0.12);
    }
}

/* Desktop - 1024px un vairāk */
@media (min-width: 1024px) {
    body {
        background-color: #ECECEC; /* Nedaudz tumšāks fons desktop versijā */
    }

    .app-container {
        max-width: 620px;
        box-shadow: 0 0 60px rgba(0,0,0,0.18);
    }
}

/* Liels desktop - 1440px un vairāk */
@media (min-width: 1440px) {
    .app-container {
        max-width: 720px; /* Nedaudz plašāks uz lieliem ekrāniem */
    }
}

/* --- HEADER --- */
.app-header {
    padding: max(20px, env(safe-area-inset-top)) 24px 10px 24px;
    flex-shrink: 0;
    background-color: var(--bg-color);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.greeting-text { font-size: 0.9rem; color: var(--text-sub); font-weight: 500; }
.user-name { font-size: 1.6rem; font-weight: 700; color: var(--text-dark); line-height: 1.1; }

.user-avatar {
    width: 50px; height: 50px; border-radius: 50%; overflow: hidden;
    border: 2px solid #F0F0F0; box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex; align-items: center; justify-content: center;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* --- SCROLL AREA --- */
main {
    flex: 1;
    overflow-y: auto;
    padding: 10px 20px;
    margin-bottom: 90px;
    scrollbar-width: none;
}
main::-webkit-scrollbar { display: none; }

/* Tablet un Desktop - rāda scrollbar */
@media (min-width: 768px) {
    main {
        scrollbar-width: thin;
        scrollbar-color: #D1D5DB #F9FAFB;
        padding: 15px 28px;
    }

    main::-webkit-scrollbar {
        display: block;
        width: 8px;
    }

    main::-webkit-scrollbar-track {
        background: #F9FAFB;
    }

    main::-webkit-scrollbar-thumb {
        background-color: #D1D5DB;
        border-radius: 4px;
    }

    main::-webkit-scrollbar-thumb:hover {
        background-color: #9CA3AF;
    }
}

/* --- MOOD CHECK-IN (FIXED) --- */
.mood-section { margin-top: 15px; margin-bottom: 25px; }
.section-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 15px; color: var(--text-dark); }

.mood-selector {
    display: flex;
    justify-content: space-between;
    padding: 5px; /* Mazliet vietas ēnām */
}

.mood-btn {
    width: 52px; /* Mazliet lielākas */
    height: 52px;
    border-radius: 50%;

    /* UZLABOTS DIZAINS: Kontrasts un ēna */
    background: #FFFFFF;
    border: 1px solid #E5E7EB; /* Smalka apmale definīcijai */
    box-shadow: 0 10px 20px rgba(0,0,0,0.08); /* Tumšāka ēna */
    color: var(--text-dark);

    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); /* "Atsperīga" animācija */
}

.mood-btn .material-symbols-rounded { font-size: 28px; color: #B0B3B8; transition: color 0.2s; }

.mood-btn:active { transform: scale(0.9); }

/* ACTIVE STATE: Lime Glow */
.mood-btn.selected {
    transform: translateY(-6px); /* Paceļas augstāk */
    box-shadow: 0 14px 28px rgba(169, 233, 0, 0.35); /* Izteikta krāsaina ēna */
    border-color: var(--amb-lime);
    background-color: var(--amb-lime);
}

.mood-btn.selected .material-symbols-rounded {
    color: #1A1C1E; /* Tumša ikona uz laima fona */
}

/* --- HERO CARD --- */
.hero-card {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    cursor: pointer;
    padding: 20px;
    height: 160px;
    background: linear-gradient(135deg, #E1FF57 0%, #A9E900 100%);
    box-shadow: 0 12px 28px rgba(169, 233, 0, 0.4);
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.hero-card:active { transform: scale(0.98); }

/* Desktop/Tablet hover efekts */
@media (hover: hover) {
    .hero-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 36px rgba(169, 233, 0, 0.5);
    }
}

.card-content { z-index: 2; max-width: 65%; height: 100%; display: flex; flex-direction: column; }
.card-tag {
    background-color: rgba(255,255,255,0.4); backdrop-filter: blur(5px);
    padding: 4px 8px; border-radius: 6px; font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; color: #2D3436; align-self: flex-start; margin-bottom: 8px;
}
.card-title { font-size: 1.6rem; font-weight: 800; line-height: 1; margin-bottom: 6px; color: #1A202C; }
.card-desc { font-size: 0.85rem; color: #1A202C; opacity: 0.8; font-weight: 600; line-height: 1.2; }
.card-meta {
    font-size: 0.75rem; color: #1A202C; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.5px; margin-top: auto; display: flex; align-items: center; gap: 4px;
}
.mascot-img {
    position: absolute; bottom: -10px; right: -10px; width: 150px; height: auto;
    z-index: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

/* --- BUTTON LINKS (FIXED) --- */
/* Šis tagad izskatās kā poga, nevis mazs teksts */
.section-btn-link {
    display: flex;
    align-items: center;
    justify-content: center; /* Centrēts */
    width: 100%; /* Pilnā platumā */
    background-color: #F3F4F6; /* Gaiši pelēks fons */
    padding: 12px 0;
    border-radius: 16px;
    color: var(--text-dark);
    font-size: 0.9rem; /* Lielāks fonts */
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 30px;
    transition: background-color 0.2s;
}

.section-btn-link:active { background-color: #E5E7EB; transform: scale(0.99); }

/* Desktop/Tablet hover efekts */
@media (hover: hover) {
    .section-btn-link:hover {
        background-color: #E5E7EB;
    }
}

.section-btn-link .material-symbols-rounded {
    font-size: 20px;
    margin-left: 6px;
    color: var(--nav-inactive);
}

/* --- BITS GRID --- */
.bits-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.library-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 15px; }

.book-card {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    text-decoration: none;
}
.book-card:active { transform: scale(0.97); }

/* Desktop/Tablet hover efekts */
@media (hover: hover) {
    .book-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 24px rgba(0,0,0,0.15);
    }
}
.book-card::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.9) 100%); z-index: 1; }

.card-top, .card-mid, .card-bot { position: relative; z-index: 2; color: var(--text-light); }
.read-time {
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); padding: 4px 8px;
    border-radius: 8px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.1); display: inline-block;
}
.book-title { font-size: 1.3rem; line-height: 1.1; margin-bottom: 6px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.book-desc { font-size: 0.7rem; opacity: 0.9; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-weight: 400; }

.font-style-1 { font-family: 'Abril Fatface', cursive; letter-spacing: 0.5px; }
.font-style-2 { font-family: 'Montserrat', sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: -0.5px; }
.font-style-3 { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 700; }
.font-style-4 { font-family: 'Caveat', cursive; font-size: 1.7rem; line-height: 0.9; }
.font-style-5 { font-family: 'Roboto Slab', serif; font-weight: 700; }

/* --- NAVIGATION --- */
.nav-container {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.floating-nav {
    pointer-events: auto;
    width: 100%;
    height: 72px;
    background-color: var(--nav-bg);
    border-radius: 24px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}

/* Tablet */
@media (min-width: 768px) {
    .nav-container {
        max-width: 576px; /* 600px - 24px padding */
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .nav-container {
        max-width: 596px; /* 620px - 24px padding */
    }
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--nav-inactive);
    text-decoration: none;
    height: 100%;
    transition: color 0.3s, background-color 0.2s;
    position: relative;
    border-radius: 16px;
}

.nav-item.active {
    color: var(--nav-active);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 8px;
    width: 4px;
    height: 4px;
    background: var(--nav-active);
    border-radius: 50%;
}

/* Desktop/Tablet hover efekts */
@media (hover: hover) {
    .nav-item:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }
}

.nav-item .material-symbols-rounded {
    font-size: 28px;
    margin-bottom: 2px;
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
}

.nav-item.active:nth-child(1) .material-symbols-rounded {
    color: #FFD88F;
}

/* --- SETTINGS PAGE STYLES --- */

/* --- PROFILE SECTION --- */
.settings-profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    margin-top: 10px;
}

.settings-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 15px;
}

.settings-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f0f0f0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* The Edit Button Overlay */
.settings-avatar-edit-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: var(--amb-blue);
    color: var(--text-dark);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Hidden File Input */
#avatar-upload {
    display: none;
}

/* --- SETTINGS GROUPS --- */
.settings-group {
    background: #FFFFFF; /* or slight off-white if bg changes */
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 22px;
    padding: 5px 20px; /* Internal spacing for items */
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    margin-bottom: 20px;
}

.settings-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-sub);
    margin-bottom: 8px;
    padding-left: 10px;
    letter-spacing: 0.5px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f5f5f5;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-icon {
    color: var(--text-sub);
    font-size: 20px;
}

/* --- INPUTS (Name/Email) --- */
.settings-input {
    border: none;
    background: transparent;
    text-align: right;
    font-size: 0.95rem;
    color: var(--text-sub);
    font-weight: 500;
    outline: none;
    width: 50%;
}

.settings-input:focus {
    color: var(--amb-blue); /* Visual feedback */
}

/* --- TOGGLE SWITCH --- */
.settings-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.settings-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.settings-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .settings-slider {
    background-color: var(--amb-green);
}

input:checked + .settings-slider:before {
    transform: translateX(20px);
}

/* --- DANGER ZONE --- */
.settings-danger-text {
    color: var(--danger);
    font-weight: 600;
}

/* --- TOOLKIT PAGE STYLES --- */

.toolkit-sos-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
    /* Papildus drošības padding saraksta beigās */
    padding-bottom: 10px;
}

/* --- KARTĪŠU DIZAINS --- */
.toolkit-sos-card {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    cursor: pointer;
    padding: 16px; /* Mazāks padding satura celšanai */
    transition: transform 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);

    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.toolkit-sos-card:active {
    transform: scale(0.98);
}

/* HERO PANIC */
.toolkit-card-wide {
    grid-column: span 2;
    height: 145px;
    background-color: var(--amb-orange);
}

/* MAZĀS POGAS: Vēl šaurākas */
.toolkit-card-small {
    height: 150px; /* Bija 190px -> 150px */
}

.toolkit-bg-panic  { background-color: var(--amb-orange); }
.toolkit-bg-focus  { background-color: var(--amb-blue); }
.toolkit-bg-sleep  { background-color: var(--amb-purple); }
.toolkit-bg-energy { background-color: var(--amb-yellow); }
.toolkit-bg-reset  { background-color: var(--amb-green); }

/* --- SATURS --- */
.toolkit-card-content {
    z-index: 2;
    max-width: 75%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.toolkit-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    color: var(--text-dark);
    margin-top: 0; /* Nodrošina, ka ir pašā augšā */
}

.toolkit-card-desc {
    font-size: 0.75rem;
    color: var(--text-dark);
    opacity: 0.85; /* Mazliet tumšāks labākai lasāmībai */
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: auto;
}

/* LAIKA INDIKATORS */
.toolkit-card-meta {
    font-size: 0.7rem;
    color: var(--text-dark);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ROBOTA BILDE */
.toolkit-mascot-img {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 140px;
    height: auto;
    z-index: 1;
}

/* Mazajās kartītēs bilde mazāka */
.toolkit-card-small .toolkit-mascot-img {
    width: 130px;
    right: -15px;
    bottom: -30px;
}

/* --- BITS PAGE STYLES --- */

/* --- FEATURED CARD (HERO) --- */
.bits-featured-section {
    margin-bottom: 25px;
}

.bits-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-sub);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.bits-featured-card {
    position: relative;
    width: 100%;
    height: 180px;
    border-radius: 22px;
    overflow: hidden;
    background-image: url('https://images.unsplash.com/photo-1499209974431-9dddcece7f88?q=80&w=800&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
}

.bits-featured-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 60%);
    z-index: 1;
}

.bits-featured-content {
    position: relative;
    z-index: 2;
    width: 100%;
}

.bits-featured-tag {
    background-color: var(--amb-lime);
    color: #2D3436;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 8px;
}

.bits-featured-title {
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-style: italic;
    line-height: 1.1;
    margin-bottom: 4px;
}

.bits-featured-desc {
    color: rgba(255,255,255,0.9);
    font-size: 0.8rem;
    font-weight: 400;
}

/* --- GRID LAYOUT --- */
.bits-library-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* --- BOOK CARD DESIGN --- */
.bits-book-card {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: 18px;
    overflow: hidden;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    transition: transform 0.1s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    text-decoration: none;
}

.bits-book-card:active { transform: scale(0.97); }

/* Soft Dark Overlay */
.bits-book-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.9) 100%);
    z-index: 1;
}

/* Content Layers */
.bits-card-top, .bits-card-mid, .bits-card-bot {
    position: relative;
    z-index: 2;
    color: var(--text-light);
}

.bits-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* Tags */
.bits-read-time {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.1);
}

.bits-status-icon {
    background: var(--amb-green);
    color: #2D3436;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.bits-status-icon.bits-in-progress {
    background: #FFA726;
    color: #ffffff;
}

.bits-status-icon .material-symbols-rounded {
    font-size: 18px;
    font-weight: 800;
}

/* Typography Styles */
.bits-book-title {
    font-size: 1.3rem;
    line-height: 1.1;
    margin-bottom: 6px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.bits-book-desc {
    font-size: 1rem;
    opacity: 1;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 600;
}

/* Font Variations */
.bits-font-style-1 { font-family: 'Abril Fatface', cursive; letter-spacing: 0.5px; }
.bits-font-style-2 { font-family: 'Montserrat', sans-serif; font-weight: 900; text-transform: uppercase; letter-spacing: -0.5px; }
.bits-font-style-3 { font-family: 'Playfair Display', serif; font-style: italic; font-weight: 700; }
.bits-font-style-4 { font-family: 'Caveat', cursive; font-size: 1.7rem; line-height: 0.9; }
.bits-font-style-5 { font-family: 'Roboto Slab', serif; font-weight: 700; }

/* Gradient Backgrounds for Books without Cover */
.bits-gradient-1 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.bits-gradient-2 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.bits-gradient-3 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.bits-gradient-4 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.bits-gradient-5 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.bits-gradient-6 { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.bits-gradient-7 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.bits-gradient-8 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.bits-gradient-9 { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.bits-gradient-10 { background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%); }

/* --- LESSON PAGE STYLES --- */

/* --- HEADER & PROGRESS --- */
.lesson-story-header-container {
    position: absolute; top: 0; left: 0; width: 100%; z-index: 50;
    padding: 15px 12px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 100%);
}

.lesson-progress-wrapper { display: flex; gap: 6px; margin-bottom: 12px; }
.lesson-progress-segment { flex: 1; height: 4px; background: rgba(255,255,255,0.3); border-radius: 4px; overflow: hidden; }
.lesson-progress-fill { height: 100%; width: 0%; background: #FFF; transition: width 0.2s ease-out; }
.lesson-progress-segment.visited .lesson-progress-fill, .lesson-progress-segment.active .lesson-progress-fill { width: 100%; }

/* Header Controls (Close + Drawer Trigger) */
.lesson-header-controls { display: flex; justify-content: space-between; align-items: center; }

.lesson-close-btn {
    background: none; border: none; color: rgba(255,255,255,0.8);
    cursor: pointer; padding: 5px;
}

/* Module Title Badge (Clickable) */
.lesson-module-badge {
    background: rgba(255,255,255,0.15); backdrop-filter: blur(5px);
    padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.9);
    display: flex; align-items: center; gap: 6px; cursor: pointer; border: 1px solid rgba(255,255,255,0.1);
    transition: background 0.2s;
}
.lesson-module-badge:active { background: rgba(255,255,255,0.25); }

/* --- TAP ZONES --- */
.lesson-tap-zone { position: absolute; top: 80px; bottom: 120px; width: 40%; z-index: 40; }
.lesson-zone-left { left: 0; }
.lesson-zone-right { right: 0; }
.lesson-scroll-zone { position: absolute; top: 80px; bottom: 120px; left: 40%; width: 20%; z-index: 30; }

/* --- SLIDES LAYOUT --- */
.lesson-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    padding: 110px 24px 40px 24px; /* Stable padding */
    opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
    display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
    background-color: #333; transition: background-color 0.5s ease;
}
.lesson-slide.active { opacity: 1; pointer-events: auto; z-index: 1; }

/* --- VISUALS --- */
.lesson-bg-icon {
    position: absolute; bottom: -20px; right: -20px;
    font-size: 200px; color: rgba(255,255,255,0.05);
    pointer-events: none; z-index: 0;
}

.lesson-content-wrapper { position: relative; z-index: 2; width: 100%; max-width: 500px; }

.lesson-big-icon-container { margin-bottom: 20px; display: flex; justify-content: flex-start; }
.material-symbols-rounded.lesson-big { font-size: 80px; color: #FFF; opacity: 0.9; }

.lesson-slide-title {
    font-size: 2rem; line-height: 1.1; margin-bottom: 25px; font-weight: 800;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.lesson-slide-text {
    font-size: 1.29rem; line-height: 1.6; font-weight: 400; color: rgba(255,255,255,0.95);
    margin-bottom: 20px; max-height: 50vh; overflow-y: auto; padding-right: 10px; scrollbar-width: none;
}
.lesson-slide-text::-webkit-scrollbar { display: none; }

.lesson-slide-text u {
    text-decoration: none;
    background: linear-gradient(180deg, transparent 70%, rgba(169, 233, 0, 0.65) 70%);
    padding: 0 3px;
    border-radius: 1px;
}

/* --- CTA BUTTON --- */
.lesson-cta-container {
    margin-top: auto; width: 100%; display: flex; justify-content: center; padding-bottom: 30px; z-index: 100; position: relative;
}
.lesson-pulse-btn {
    background: #FFFFFF; color: #000; border: none; border-radius: 50px; padding: 20px 32px;
    font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    display: flex; align-items: center; gap: 10px; cursor: pointer; box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.1s; position: relative; z-index: 100; pointer-events: auto;
}
.lesson-pulse-btn:active { transform: scale(0.96); }
.lesson-pulse-btn::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    border-radius: 50px; border: 2px solid rgba(255, 255, 255, 0.8);
    animation: lesson-ripple 2s infinite; z-index: -1;
}
@keyframes lesson-ripple {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* --- MODULE DRAWER (Playlist) --- */
.lesson-drawer-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: 90;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
    backdrop-filter: blur(2px);
}
.lesson-drawer-overlay.open { opacity: 1; pointer-events: auto; }

.lesson-module-drawer {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 75vh;
    background-color: #1A1A1A; border-radius: 25px 25px 0 0;
    transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1);
    padding: 25px 20px; display: flex; flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.lesson-drawer-overlay.open .lesson-module-drawer { transform: translateY(0); }

.lesson-drawer-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;
    padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.lesson-drawer-title { font-size: 1.2rem; font-weight: 700; color: #FFF; }

.lesson-module-list { overflow-y: auto; flex: 1; padding-bottom: 30px; }

.lesson-module-item {
    display: flex; align-items: center; padding: 16px; margin-bottom: 10px;
    background: #252525; border-radius: 16px; cursor: pointer;
    border: 1px solid transparent; transition: all 0.2s;
}
.lesson-module-item:active { transform: scale(0.98); background: #333; }
.lesson-module-item.current {
    border-color: #E67E22;
    background: linear-gradient(90deg, rgba(230, 126, 34, 0.15), transparent);
}

.lesson-mod-number {
    width: 36px; height: 36px; border-radius: 10px; background: #333;
    color: #888; display: flex; align-items: center; justify-content: center;
    font-weight: 700; margin-right: 15px; font-family: 'Abril Fatface', cursive;
}
.lesson-module-item.current .lesson-mod-number { background: #E67E22; color: #FFF; }

.lesson-mod-info h4 { margin: 0 0 4px 0; font-size: 1rem; color: #FFF; }
.lesson-mod-info span { font-size: 0.75rem; color: #888; }

/* --- PANIC BUTTON FLOW STYLES --- */

/* Global Variables for Panic Mode */
:root {
    --pb-terracotta: #E08D79;  /* Calming Muted Terracotta */
    --pb-dark: #2D3436;
    --pb-text-light: #FFFFFF;
    --pb-overlay-bg: #FFFFFF;
}

/* Main Container (Full Screen as Standalone Page) */
.pb-container {
    width: 100%;
    height: 100%;
    min-height: 100%;
    background-color: var(--pb-overlay-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Utility: Hide Element */
.pb-hidden {
    display: none !important;
}

/* Base Screen Layout */
.pb-screen {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    animation: pb-fade-in 0.5s ease-in-out; /* Cross-dissolve effect */
}

@keyframes pb-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- SCREEN A: THE PRIMER --- */
.pb-screen-primer {
    background-color: var(--pb-terracotta);
    padding: 40px 24px;
    justify-content: space-between; /* Content top/center, Button bottom */
    text-align: center;
    color: var(--pb-text-light);
}

.pb-content-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pb-hero-text {
    font-size: 3.5rem; /* Extremely large */
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.pb-sub-text {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.9;
    max-width: 280px;
    line-height: 1.5;
}

/* Primary Action Button (Shared) */
.pb-primary-btn {
    background-color: #FFFFFF;
    color: var(--pb-terracotta);
    font-size: 1.2rem;
    font-weight: 700;
    padding: 22px 30px;
    border-radius: 50px; /* Pill shape */
    border: none;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.pb-primary-btn:active {
    transform: scale(0.98);
}

/* --- SCREEN B: CAMERA INTERFACE --- */
.pb-screen-camera {
    background-color: #000;
    position: relative;
}

/* Simulated Camera Feed */
.pb-camera-feed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
    /* Filters to simulate raw camera feed vibe */
}

/* 1. Top Bar (Reminder Pill) */
.pb-top-pill {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 10;
    white-space: nowrap;
}

.pb-top-pill span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 2. Viewport Overlay (Focus Frame) */
.pb-focus-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 2px solid rgba(255, 255, 255, 0.3); /* Subtle opacity */
    border-radius: 20px;
    pointer-events: none;
    z-index: 5;
}

/* 3. Bottom Control Bar */
.pb-camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%; /* Bottom 30% */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 40px;
}

/* Progress Dots */
.pb-progress-dots {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.pb-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background-color: transparent;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
}

.pb-dot-filled {
    background-color: #FFFFFF;
    border-color: #FFFFFF;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.pb-dot-preview {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 1);
    box-shadow: 0 0 20px rgba(255,255,255,0.8);
    z-index: 200;
}

/* Shutter Button */
.pb-shutter-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: transparent;
    border: 5px solid rgba(255, 255, 255, 0.9);
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;
}

.pb-shutter-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.pb-shutter-btn:active {
    transform: scale(0.9);
}

/* --- SCREEN C: RESULT & FEEDBACK --- */
.pb-screen-result {
    background-color: #FAFAFA; /* Clean off-white */
    padding: max(40px, env(safe-area-inset-top)) 20px 30px 20px;
    color: var(--pb-dark);
    justify-content: space-between;
}

.pb-result-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.pb-result-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 30px;
    color: var(--pb-terracotta);
}

/* Gallery Grid (Masonry Style) */
.pb-gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns */
    grid-template-rows: 200px 140px; /* Custom heights */
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
}

.pb-gallery-item {
    background-color: #EEE;
    border-radius: 18px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* First item spans full width (Hero Image) */
.pb-item-large {
    grid-column: span 2;
}

.pb-ai-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #FFF;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--pb-dark);
    align-self: flex-start;
}

.pb-ai-feedback .material-symbols-rounded {
    font-size: 20px;
    color: var(--pb-terracotta);
}

/* Footer overrides for Screen C */
.pb-screen-result .pb-footer-action {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.pb-btn-finish {
    background-color: var(--pb-terracotta);
    color: #FFF; /* Inverted for finish */
}

.pb-secondary-link {
    color: #999;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Lidojošā bilde */
.pb-flying-photo {
    position: absolute;
    width: 100%; /* Sākumā pilns ekrāns vai kameras izmērs */
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 20px; /* Sākumā stūri kā kameras rāmim */
    z-index: 100; /* Virs visa */
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1); /* "Ease-out" efekts */
    box-shadow: 0 0 0 rgba(255,255,255,0);
    opacity: 1;
}

/* Kad bilde ielido punktiņā */
.pb-flying-target {
    border-radius: 50%; /* Kļūst apaļa */
    opacity: 0.8;
    box-shadow: 0 0 15px rgba(255,255,255,0.8);
    z-index: 100;
}

/* ===== JOURNEY PAGE STYLES ===== */

/* Stats Grid */
.journey-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.journey-stat-card {
    border-radius: 20px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 110px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    transition: transform 0.1s;
}

.journey-stat-card:active { transform: scale(0.98); }
.journey-stat-card.journey-blue { background-color: var(--amb-blue); }
.journey-stat-card.journey-yellow { background-color: var(--amb-yellow); }

.journey-stat-icon {
    background: rgba(255,255,255,0.4);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark);
}

.journey-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1;
    margin-top: auto;
}

.journey-stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-dark);
    opacity: 0.7;
    margin-top: 4px;
}

/* Chart Container */
.journey-chart-container {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    height: 180px;
    position: relative;
}

.journey-graph-svg { width: 100%; height: 100%; overflow: visible; }
.journey-graph-line { fill: none; stroke: var(--amb-purple); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.journey-graph-point { fill: #fff; stroke: var(--amb-purple); stroke-width: 3; }

.journey-chart-days {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding: 0 10px;
}

.journey-day-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-sub);
}

/* Activity Timeline */
.journey-timeline-container {
    margin-left: 10px; /* Offset to align visually */
}

.journey-timeline-item {
    position: relative;
    padding-left: 28px; /* Space for the line */
    border-left: 2px solid #F0F0F0; /* The Line */
    padding-bottom: 24px; /* Space between items */
}

.journey-timeline-item:last-child {
    border-left: 2px solid transparent; /* Stop line at last item */
}

.journey-timeline-dot {
    position: absolute;
    left: -6px; /* Center on the 2px border */
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ccc;
    box-shadow: 0 0 0 4px #fff; /* White ring effect */
}

/* Dot Colors based on Ritual Type */
.journey-dot-orange { background-color: var(--amb-orange); }
.journey-dot-blue { background-color: var(--amb-blue); }
.journey-dot-purple { background-color: var(--amb-purple); }
.journey-dot-green { background-color: var(--amb-green); }

.journey-timeline-content {
    display: flex;
    flex-direction: column;
    top: -5px; /* Align text with dot */
    position: relative;
}

.journey-t-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
}

.journey-t-desc {
    font-size: 0.75rem;
    color: var(--text-sub);
}

.journey-t-time {
    font-size: 0.65rem;
    font-weight: 600;
    color: #B2BEC3;
    margin-top: 2px;
}

/* Visual Journal (Masonry) */
.journey-journal-grid {
    column-count: 2;
    column-gap: 12px;
}

.journey-journal-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.journey-journal-overlay {
    position: absolute;
    bottom: 0; left: 0; width: 100%; padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.journey-journal-word {
    color: #fff; font-size: 0.8rem; font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Placeholders */
.journey-ph-tall { height: 180px; display: flex; align-items: center; justify-content: center; }
.journey-ph-short { height: 120px; display: flex; align-items: center; justify-content: center; }
.journey-ph-med { height: 150px; display: flex; align-items: center; justify-content: center; }
.journey-ph-icon { font-size: 40px; color: rgba(0,0,0,0.1); }

/* Section Headers */
.journey-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 12px;
}

.journey-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
}
/* Settings Page Styles */

/* Alert Messages */
.settings-alert {
    margin: 15px 20px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-alert .material-symbols-rounded {
    font-size: 20px;
}

.settings-alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

.settings-alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

/* Save Button Section */
.settings-save-section {
    margin: 20px;
    padding: 15px 0;
}

.settings-save-btn {
    width: 100%;
    padding: 14px 20px;
    background-color: var(--amb-lime);
    color: var(--text-dark);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.settings-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 255, 87, 0.4);
}

.settings-save-btn:active {
    transform: translateY(0);
}

.settings-save-btn .material-symbols-rounded {
    font-size: 20px;
}

/* Password Change Modal Overlay */
.password-change-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Password Change Modal */
.password-change-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Password Change Header */
.password-change-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.password-change-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.password-change-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: all 0.2s ease;
    border-radius: 8px;
}

.password-change-close:hover {
    background-color: #F3F4F6;
    color: var(--text-dark);
}

.password-change-close .material-symbols-rounded {
    font-size: 24px;
}

/* Password Change Body */
.password-change-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.password-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.password-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
    display: block;
}

.password-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    background-color: #F9FAFB;
    color: var(--text-dark);
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
}

.password-input:focus {
    outline: none;
    border-color: var(--amb-lime);
    background-color: white;
}

.password-input::placeholder {
    color: #9CA3AF;
}

/* Password Change Footer */
.password-change-footer {
    padding: 20px 24px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 12px;
}

.password-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.password-btn-cancel {
    background-color: #F3F4F6;
    color: var(--text-dark);
}

.password-btn-cancel:hover {
    background-color: #E5E7EB;
}

.password-btn-submit {
    background-color: var(--amb-lime);
    color: var(--text-dark);
}

.password-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 255, 87, 0.4);
}

.password-btn-submit:active {
    transform: translateY(0);
}

/* Password Button Danger Style */
.password-btn-danger {
    background-color: #DC2626;
    color: white;
}

.password-btn-danger:hover {
    background-color: #B91C1C;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}

.password-btn-danger:active {
    transform: translateY(0);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .password-change-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .password-change-modal {
        max-width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
}

/* Active Sessions Styles */
.sessions-list {
    max-height: 400px;
    overflow-y: auto;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #F3F4F6;
    transition: all 0.3s ease;
}

.session-item:last-child {
    border-bottom: none;
}

.session-item:hover {
    background-color: #F9FAFB;
}

.session-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F3F4F6;
    border-radius: 12px;
    flex-shrink: 0;
}

.session-icon .material-symbols-rounded {
    font-size: 28px;
    color: var(--text-sub);
}

.session-info {
    flex: 1;
    min-width: 0;
}

.session-device {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.session-current-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: var(--amb-lime);
    color: var(--text-dark);
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
}

.session-details {
    font-size: 0.8rem;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.session-delete-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: var(--text-sub);
}

.session-delete-btn:hover {
    background-color: #FEE2E2;
    color: #DC2626;
}

.session-delete-btn .material-symbols-rounded {
    font-size: 20px;
}

/* Avatar Crop Modal Styles */
.avatar-crop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.avatar-crop-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
}

.avatar-crop-header {
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.avatar-crop-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.avatar-crop-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    transition: all 0.2s ease;
    border-radius: 8px;
}

.avatar-crop-close:hover {
    background-color: #F3F4F6;
    color: var(--text-dark);
}

.avatar-crop-close .material-symbols-rounded {
    font-size: 24px;
}

.avatar-crop-body {
    padding: 24px;
}

.avatar-crop-container {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: 12px;
    background-color: #F3F4F6;
}

.avatar-crop-container img {
    max-width: 100%;
    display: block;
}

.avatar-crop-footer {
    padding: 20px 24px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 12px;
}

.avatar-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-btn-cancel {
    background-color: #F3F4F6;
    color: var(--text-dark);
}

.avatar-btn-cancel:hover {
    background-color: #E5E7EB;
}

.avatar-btn-save {
    background-color: var(--amb-lime);
    color: var(--text-dark);
}

.avatar-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(225, 255, 87, 0.4);
}

.avatar-btn-save:active {
    transform: translateY(0);
}

.avatar-btn-save:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsiveness for Avatar Crop */
@media (max-width: 768px) {
    .avatar-crop-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .avatar-crop-modal {
        max-width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        animation: slideUpMobile 0.3s ease;
    }

    .avatar-crop-container {
        max-height: 300px;
    }
}

/* Avatar Pulse Animation */
@keyframes avatarPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(225, 255, 87, 0.8);
    }
    25% {
        transform: scale(1.08);
        box-shadow: 0 0 0 8px rgba(225, 255, 87, 0.4);
    }
    50% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(225, 255, 87, 0);
    }
    75% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(225, 255, 87, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(225, 255, 87, 0);
    }
}

.avatar-pulse {
    animation: avatarPulse 0.8s ease-in-out;
}

.avatar-pulse .settings-avatar-img {
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(225, 255, 87, 0.5);
}

/* ============================================
   BRAINYBITS HOME PAGE STYLES
   ============================================ */

/* Pack Colors */
:root {
    --pack-anxiety: #FF9A7B;
    --pack-focus: #7C6FAF;
    --pack-sleep: #4A6FA5;
    --pack-dopamine: #A9E900;
    --lime-dark: #A9E900;
}

/* ============================================
   STATUS BADGES (Top Row)
   ============================================ */

.bb-status-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.bb-status-badge {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #1A202C 0%, #2D3436 100%);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.bb-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #A9E900;
    box-shadow: 0 0 10px rgba(169, 233, 0, 0.8);
    animation: bb-dot-pulse 2s ease-in-out infinite;
}

@keyframes bb-dot-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(169, 233, 0, 0.8); }
    50% { opacity: 0.7; box-shadow: 0 0 16px rgba(169, 233, 0, 1); }
}

.bb-status-text {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
}

.bb-status-text strong {
    font-weight: 700;
    color: #A9E900;
}

.bb-status-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
}

.bb-status-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFFFFF;
}

/* ============================================
   WELCOME SECTION
   ============================================ */

.bb-welcome {
    margin-bottom: 20px;
    padding: 0 4px;
}

.bb-welcome-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.bb-welcome-subtitle {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.bb-welcome-note {
    font-size: 0.9rem;
    color: #999;
}

/* ============================================
   WHAT WE'RE NOTICING
   ============================================ */

.bb-noticing {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 22px 24px;
    margin-bottom: 28px;
    border: 2px solid #E8E8E8;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.bb-noticing-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 18px;
}

.bb-noticing-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bb-noticing-list li {
    font-size: 1rem;
    color: #444;
    line-height: 1.5;
    padding-left: 24px;
    position: relative;
}

.bb-noticing-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--lime-dark);
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.2;
}

.bb-noticing-footer {
    font-size: 0.9rem;
    color: #999;
    font-style: italic;
}

/* ============================================
   DAILY REFRESH - Today's Session
   ============================================ */

.bb-daily {
    position: relative;
    background: linear-gradient(135deg, #1A202C 0%, #2D3436 100%);
    border-radius: 24px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.bb-daily::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(225, 255, 87, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.bb-daily-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(225, 255, 87, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--lime);
    margin-bottom: 14px;
}

.bb-daily-date .material-symbols-rounded {
    font-size: 16px;
}

.bb-daily-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.bb-daily-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 8px;
}

.bb-daily-desc {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    line-height: 1.4;
    margin-bottom: 16px;
}

.bb-daily-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.bb-daily-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.1);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
}

.bb-daily-tag .material-symbols-rounded {
    font-size: 14px;
}

.bb-daily-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--amb-lime) 0%, var(--lime-dark) 100%);
    color: #1A202C;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(169, 233, 0, 0.35);
    transition: transform 0.2s;
    text-decoration: none;
}

.bb-daily-cta:hover {
    text-decoration: none;
}

.bb-daily-cta:active {
    transform: scale(0.96);
}

.bb-daily-cta .material-symbols-rounded {
    font-size: 20px;
}

.bb-daily-cta-disabled {
    background: #6b7280 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bb-daily-cta-disabled:hover {
    transform: none !important;
}

.bb-daily-completed-message {
    margin-top: 20px;
    padding: 18px;
    background: rgba(169, 233, 0, 0.1);
    border-left: 4px solid #A9E900;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.bb-daily-completed-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(169, 233, 0, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bb-daily-completed-icon .material-symbols-rounded {
    font-size: 24px;
    color: #A9E900;
}

.bb-daily-completed-text {
    flex: 1;
}

.bb-daily-completed-text strong {
    display: block;
    color: #FFFFFF;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.bb-daily-completed-text p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.bb-daily-completed-text a {
    color: #A9E900;
    text-decoration: underline;
    font-weight: 600;
}

.bb-daily-completed-text a:hover {
    color: #BEF264;
}

/* ============================================
   PROTOCOL PACKS
   ============================================ */

.bb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.bb-section-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bb-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark);
}

.bb-section-subtitle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 500;
}

.bb-section-subtitle .material-symbols-rounded {
    font-size: 16px;
    color: var(--lime-dark);
}

.bb-section-link {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-sub);
    text-decoration: none;
}

/* Active Pack */
.bb-pack {
    position: relative;
    background: #FFFFFF;
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.06);
    border: 2px solid #E8E8E8;
    transition: transform 0.2s;
    overflow: hidden;
}

.bb-pack:active {
    transform: scale(0.98);
}

/* Protocol Number Badge */
.bb-pack-number {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #F0F0F0;
    color: #888;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bb-pack.is-active .bb-pack-number {
    background: linear-gradient(135deg, #E1FF57, #A9E900);
    color: #1A202C;
}

.bb-pack-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.bb-pack-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #E1FF57, #A9E900);
}

.bb-pack-icon .material-symbols-rounded {
    font-size: 28px;
    color: #1A202C;
}

.bb-pack-info {
    flex: 1;
}

.bb-pack-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.bb-pack-subtitle {
    font-size: 0.9rem;
    color: var(--text-sub);
    line-height: 1.3;
}

.bb-pack-sessions-count {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #F0F0F0;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    margin-top: 8px;
}

.bb-pack-sessions-count .material-symbols-rounded {
    font-size: 14px;
}

.bb-pack.is-active .bb-pack-sessions-count {
    background: rgba(169, 233, 0, 0.15);
    color: #5A7A00;
}

.bb-pack-progress {
    margin-top: 14px;
}

.bb-pack-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bb-pack-progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
}

.bb-pack-progress-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: #7CB800;
}

.bb-pack-progress-bar {
    height: 6px;
    background: #F0F0F0;
    border-radius: 10px;
    overflow: hidden;
}

.bb-pack-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #E1FF57, #A9E900);
    transition: width 0.5s ease;
}

/* Locked Pack */
.bb-pack.is-locked {
    background: #FAFAFA;
    border: 2px solid #E0E0E0;
}

.bb-pack.is-locked .bb-pack-icon {
    filter: grayscale(0.3);
    opacity: 0.8;
}

.bb-pack.is-locked .bb-pack-title {
    color: #555;
}

.bb-pack.is-locked .bb-pack-subtitle {
    color: #888;
}

.bb-pack-locked-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #F5F5F5;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: 12px;
}

.bb-pack-locked-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #E0E0E0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bb-pack-locked-icon .material-symbols-rounded {
    font-size: 16px;
    color: #888;
    animation: bb-pulse 2s ease-in-out infinite;
}

@keyframes bb-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.bb-pack-locked-text {
    font-size: 0.8rem;
    color: #777;
    font-weight: 500;
    line-height: 1.3;
}

.bb-pack-locked-text strong {
    display: block;
    color: #555;
    font-weight: 600;
}

/* ============================================
   SESSIONS LIST (Inside Active Pack)
   ============================================ */

.bb-sessions {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #F0F0F0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bb-session {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #FAFAFA;
    border-radius: 14px;
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
}

.bb-session:hover {
    text-decoration: none;
}

.bb-session:active {
    transform: scale(0.98);
}

a.bb-session {
    cursor: pointer;
}

div.bb-session.is-locked {
    cursor: not-allowed;
}

.bb-session-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
    background: #E8E8E8;
    color: #888;
}

.bb-session-content {
    flex: 1;
    min-width: 0;
}

.bb-session-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.bb-session-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.3;
}

.bb-session-meta {
    flex-shrink: 0;
}

.bb-session-meta .material-symbols-rounded {
    font-size: 24px;
    color: #CCC;
}

/* Completed Session */
.bb-session.is-completed {
    background: rgba(169, 233, 0, 0.08);
}

.bb-session.is-completed .bb-session-number {
    background: linear-gradient(135deg, #A9E900, #8BC400);
    color: white;
}

.bb-session.is-completed .bb-session-number .material-symbols-rounded {
    font-size: 18px;
}

.bb-session.is-completed .bb-session-title {
    color: #555;
}

.bb-session.is-completed .bb-session-meta .material-symbols-rounded {
    color: #A9E900;
}

/* Next Session (Available) */
.bb-session.is-next {
    background: linear-gradient(135deg, #1A202C 0%, #2D3436 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.bb-session.is-next .bb-session-number {
    background: linear-gradient(135deg, var(--amb-lime), var(--lime-dark));
    color: #1A202C;
    font-weight: 800;
}

.bb-session.is-next .bb-session-title {
    color: #FFFFFF;
}

.bb-session.is-next .bb-session-desc {
    color: rgba(255,255,255,0.6);
}

.bb-session.is-next .bb-session-meta .material-symbols-rounded {
    color: var(--amb-lime);
    font-size: 28px;
}

/* Locked Session */
.bb-session.is-locked {
    background: #F5F5F5;
    opacity: 0.7;
}

.bb-session.is-locked .bb-session-number {
    background: #E0E0E0;
    color: #AAA;
}

.bb-session.is-locked .bb-session-title {
    color: #999;
}

.bb-session.is-locked .bb-session-desc {
    color: #BBB;
}

.bb-session.is-locked .bb-session-meta .material-symbols-rounded {
    color: #CCC;
    font-size: 20px;
}

/* ============================================
   MAP CONSTELLATION STYLES
   ============================================ */

/* Map Section Container */
.map-section {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    padding: 10px 0;
    overflow: hidden;
}

/* Mobile - reduce padding */
@media (max-width: 375px) {
    .map-section {
        padding: 5px 0;
        margin-bottom: 20px;
    }
}

/* Constellation Container */
.map-constellation {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: 280px;
    margin: 0 auto;
}

/* Mobile adjustments - smaller on small screens */
@media (max-width: 375px) {
    .map-constellation {
        height: 260px;
        max-width: 280px;
    }
}

/* Central star shape - larger */
.map-core-shape {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    animation: map-star-pulse 8s ease-in-out infinite;
}

/* Mobile - smaller star */
@media (max-width: 375px) {
    .map-core-shape {
        width: 120px;
        height: 120px;
    }
}

.map-core-shape svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 25px rgba(167, 139, 250, 0.5));
}

.map-star-main {
    fill: url(#starGradientRadial);
    opacity: 0.95;
}

.map-star-inner {
    fill: url(#starGradientRadialInner);
    opacity: 0.85;
    transform-origin: center;
    animation: map-star-rotate 30s linear infinite reverse;
}

@keyframes map-star-pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        filter: drop-shadow(0 0 25px rgba(167, 139, 250, 0.5));
    }
    50% {
        transform: translate(-50%, -50%) scale(1.06);
        filter: drop-shadow(0 0 35px rgba(132, 204, 22, 0.6));
    }
}

@keyframes map-star-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Connecting lines SVG */
.map-connections {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.map-connections line {
    stroke: var(--map-purple-accent);
    stroke-width: 1.5;
    opacity: 0.65;
    animation: map-line-fade 15s ease-in-out infinite;
}

.map-connections line:nth-child(odd) {
    stroke: var(--map-lime-accent);
    animation-delay: -7s;
}

@keyframes map-line-fade {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 0.45; }
}

/* Tag nodes */
.map-tag {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: var(--map-bg);
    border: 2px solid var(--map-purple-medium);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--map-purple-text);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 12px rgba(139, 92, 246, 0.2);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

/* Mobile - even smaller tags */
@media (max-width: 375px) {
    .map-tag {
        padding: 6px 10px;
        font-size: 0.7rem;
    }
}

.map-tag::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--map-lime-accent);
    opacity: 0.8;
    left: -3px;
    animation: map-pulse-dot 4s ease-in-out infinite;
}

.map-tag:nth-child(odd)::before {
    background: var(--map-purple-accent);
    animation-delay: -2s;
}

@keyframes map-pulse-dot {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.map-tag:hover, .map-tag:active {
    background: var(--map-purple-soft);
    border-color: var(--map-purple-accent);
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(139, 92, 246, 0.35);
}

.map-tag.map-active {
    background: var(--map-purple-soft);
    border-color: var(--map-purple-accent);
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.4);
}

/* Tag positions - organic placement */
.map-tag--focus {
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
    animation: map-float-1 18s ease-in-out infinite;
}

.map-tag--load {
    top: 20%;
    right: -2%;
    animation: map-float-2 20s ease-in-out infinite;
}

.map-tag--recovery {
    top: 58%;
    right: -4%;
    animation: map-float-3 22s ease-in-out infinite;
}

.map-tag--calm {
    bottom: 4%;
    left: 50%;
    transform: translateX(-50%);
    animation: map-float-4 19s ease-in-out infinite;
}

.map-tag--stimulation {
    top: 58%;
    left: -4%;
    animation: map-float-5 21s ease-in-out infinite;
}

.map-tag--clarity {
    top: 20%;
    left: -2%;
    animation: map-float-6 23s ease-in-out infinite;
}

@keyframes map-float-1 {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

@keyframes map-float-2 {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(4px) translateX(-3px); }
}

@keyframes map-float-3 {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-5px) translateX(-2px); }
}

@keyframes map-float-4 {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes map-float-5 {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(3px) translateX(4px); }
}

@keyframes map-float-6 {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(5px) translateX(2px); }
}

/* Center Popup */
.map-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--map-bg);
    padding: 16px 20px;
    border-radius: 16px;
    border: 2px solid var(--map-purple-medium);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    max-width: 180px;
    text-align: center;
}

/* Mobile - smaller popup */
@media (max-width: 375px) {
    .map-popup {
        padding: 14px 18px;
        max-width: 160px;
    }
}

.map-popup.map-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.map-popup p {
    font-size: 0.8rem;
    font-weight: 300;
    line-height: 1.5;
    color: var(--map-text-secondary);
}

/* Mobile - smaller text */
@media (max-width: 375px) {
    .map-popup p {
        font-size: 0.75rem;
    }
}

.map-popup-title {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--map-purple-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

/* Mobile - smaller title */
@media (max-width: 375px) {
    .map-popup-title {
        font-size: 0.65rem;
    }
}

/* Overlay for closing popup */
.map-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 68, 88, 0.1);
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.map-overlay.map-visible {
    opacity: 1;
    visibility: visible;
}

/* Ambient decoration */
.map-ambient {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.3;
}

.map-ambient--1 {
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, var(--map-lime-soft) 0%, transparent 70%);
    top: -30px;
    right: -50px;
    animation: map-ambient-drift 30s ease-in-out infinite;
}

.map-ambient--2 {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, var(--map-purple-soft) 0%, transparent 70%);
    bottom: -20px;
    left: -40px;
    animation: map-ambient-drift 25s ease-in-out infinite reverse;
}

/* Mobile - smaller ambient decorations */
@media (max-width: 375px) {
    .map-ambient--1 {
        width: 140px;
        height: 140px;
        top: -20px;
        right: -40px;
    }

    .map-ambient--2 {
        width: 110px;
        height: 110px;
        bottom: -15px;
        left: -30px;
    }
}

@keyframes map-ambient-drift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, 8px); }
}

/* --- PANIC MODE FULLSCREEN OVERLAY --- */
.panic-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    z-index: 9999;
    background-color: #FFFFFF;
    overflow: hidden;
}

/* Close Button (Top Right) */
.panic-close-btn {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    right: 20px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.panic-close-btn:active {
    background: rgba(0, 0, 0, 0.5);
}

.panic-close-btn .material-symbols-rounded {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.9);
}

/* Hide utility class */
.panic-hidden {
    display: none !important;
}

/* Base Screen Layout */
.panic-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: panic-fade-in 0.4s ease-in-out;
}

@keyframes panic-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scrollable Content Area */
.panic-screen-content {
    flex: 1;
    overflow-y: auto;
    padding: max(60px, env(safe-area-inset-top)) 24px 20px 24px;
    -webkit-overflow-scrolling: touch;
}

/* Fixed Footer for Buttons */
.panic-footer-fixed {
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 24px max(20px, env(safe-area-inset-bottom)) 24px;
    background: inherit;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 100;
}

/* Primary Button */
.panic-primary-btn {
    background-color: #FFFFFF;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 700;
    padding: 18px 30px;
    border-radius: 50px;
    border: none;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.1s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panic-primary-btn:active {
    transform: scale(0.98);
}

/* --- SCREEN 1: BIO MECHANISM --- */
.panic-bio-screen {
    background-color: #5C6BC0;
    color: #FFF;
}

.panic-bio-screen .panic-primary-btn {
    background-color: #FFFFFF;
    color: #5C6BC0;
}

.panic-bio-label {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    opacity: 0.7;
    margin-bottom: 10px;
    font-weight: 700;
}

.panic-bio-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
}

.panic-bio-diagram {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 24px 20px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.panic-bio-icon {
    font-size: 60px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    display: block;
}

.panic-bio-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #FFF;
}

/* State text - smaller, regular weight */
.panic-bio-state {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 400;
    margin-bottom: 16px;
    text-align: center;
}

/* Action text - larger, bold, different style */
.panic-bio-action {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    line-height: 1.3;
    color: #FFFFFF;
    font-weight: 800;
    text-align: center;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- SCREEN 2: MAGIC PILL --- */
.panic-pill-screen {
    background-color: var(--amb-green);
    color: var(--text-dark);
}

.panic-pill-screen .panic-primary-btn {
    background-color: var(--text-dark);
    color: #FFFFFF;
}

.panic-pill-label {
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    opacity: 0.7;
    margin-bottom: 10px;
    font-weight: 700;
    color: var(--text-dark);
}

.panic-pill-title {
    font-family: 'Abril Fatface', cursive;
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.panic-pill-diagram {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 20px;
    padding: 24px 20px;
    margin: 15px 0;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.panic-pill-icon {
    font-size: 60px;
    color: var(--text-dark);
    opacity: 0.8;
    margin-bottom: 15px;
    display: block;
}

.panic-pill-text {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dark);
    font-weight: 600;
}

/* Main title - large, bold, eye-catching */
.panic-pill-main-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.6rem;
    line-height: 1.2;
    color: var(--text-dark);
    font-weight: 900;
    text-align: center;
    margin: 20px 0 16px 0;
    letter-spacing: -0.5px;
}

/* Description - explains why it helps */
.panic-pill-description {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-dark);
    font-weight: 500;
    text-align: center;
    margin-top: 0;
    opacity: 0.9;
}

/* --- SCREEN 3: PRIMER --- */
.panic-screen-primer {
    background-color: var(--pb-terracotta);
    color: var(--pb-text-light);
}

.panic-content-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 50vh;
}

.panic-hero-text {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    text-transform: uppercase;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.panic-sub-text {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
    max-width: 320px;
    line-height: 1.5;
}

/* --- SCREEN 4: CAMERA --- */
.panic-screen-camera {
    background-color: #000;
    padding: 0;
}

.panic-camera-feed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.panic-top-pill {
    position: absolute;
    top: max(20px, env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 10;
    white-space: nowrap;
}

.panic-top-pill span {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panic-focus-frame {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    pointer-events: none;
    z-index: 5;
}

.panic-camera-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: max(40px, env(safe-area-inset-bottom));
}

.panic-progress-dots {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.panic-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background-color: transparent;
    background-size: cover;
    background-position: center;
    transition: all 0.3s ease;
}

.panic-dot-filled {
    background-color: #FFFFFF;
    border-color: #FFFFFF;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.panic-dot-preview {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 1);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    z-index: 200;
}

.panic-shutter-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: transparent;
    border: 5px solid rgba(255, 255, 255, 0.9);
    position: relative;
    cursor: pointer;
    transition: transform 0.1s;
}

.panic-shutter-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.panic-shutter-btn:active {
    transform: scale(0.9);
}

.panic-flying-photo {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    z-index: 100;
    pointer-events: none;
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    opacity: 1;
}

.panic-flying-target {
    border-radius: 50%;
    opacity: 0.8;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    z-index: 100;
}

/* --- SCREEN 5: RESULT --- */
.panic-screen-result {
    background-color: #FAFAFA;
}

.panic-result-title {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 25px;
    color: var(--pb-terracotta);
}

.panic-gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 200px 140px;
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
}

.panic-gallery-item {
    background-color: #EEE;
    border-radius: 18px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.panic-item-large {
    grid-column: span 2;
}

.panic-ai-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #FFF;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dark);
}

.panic-ai-feedback .material-symbols-rounded {
    font-size: 20px;
    color: var(--pb-terracotta);
}

.panic-btn-finish {
    background-color: var(--pb-terracotta);
    color: #FFF;
}

.panic-secondary-link {
    color: #999;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    text-align: center;
    margin-top: 15px;
}

/* --- BITS FILTER BAR --- */
.bits-filter-container {
    padding: 10px 20px 12px 20px;
    background-color: var(--bg-color);
    flex-shrink: 0;
    z-index: 15;
}

.bits-filter-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    align-items: center;
}

.bits-filter-chip {
    background-color: var(--chip-bg);
    color: var(--text-dark);
    border: none;
    padding: 7px 14px;
    border-radius: 18px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    line-height: 1.1;
    text-transform: capitalize;
}

.bits-filter-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bits-filter-chip.active {
    background-color: var(--chip-active);
    color: #FFF;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.bits-filter-chip.active:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
