:root {
    --primary: #2E5D4B;
    --secondary: #8FBC8F;
    --accent: #D4A373;
    --background: #F0F4F1;
    --card-bg: #FFFFFF;
    --text-main: #2C3E50;
    --text-muted: #7F8C8D;
    --border-radius: 12px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.1);
    --font-stack: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-stack);
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
}

.app-header {
    background-color: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 500;
    gap: 2rem;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.top-actions button {
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.top-actions button:hover {
    opacity: 1;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-grow: 1;
    justify-content: center;
}

.view-nav {
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem;
    border-radius: 20px;
}

.nav-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 15px;
    cursor: pointer;
    font-family: var(--font-stack);
    font-weight: 600;
    transition: all 0.2s;
}

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

.nav-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.user-toggles {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.3rem;
    border-radius: 20px;
}

.user-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    cursor: pointer;
    font-family: var(--font-stack);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.user-btn:hover {
    color: white;
}

.user-btn.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    color: var(--secondary);
}

.logo-icon {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .logo h1 {
        font-size: 1.2rem;
    }
    .logo-icon {
        width: 3.5rem;
        height: 3.5rem;
    }
}

.actions-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.year-filter-container {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.year-filter-container select {
    background: transparent;
    border: none;
    color: white;
    font-family: var(--font-stack);
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
}

.year-filter-container select:focus {
    outline: none;
}

.year-filter-container option {
    color: var(--text-main);
}

.icon-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.icon-btn:hover {
    opacity: 1;
}


/* Main Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Stats */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.action-card {
    background: var(--accent);
    color: white;
    cursor: pointer;
    border: 2px solid transparent;
}

.action-card:hover {
    background: #c08e5e;
    border-color: rgba(255, 255, 255, 0.2);
}

.action-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.action-card .stat-label {
    color: white;
    font-weight: 600;
}

/* Tabs */
/* Tabs Removed - Styles moved to header */

/* Sections */
.view-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Grids */
.sightings-grid,
.birds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* Compact View Toggle Button */
.compact-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: white;
    color: var(--text-main);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    flex-shrink: 0;
}

.compact-toggle-btn:hover {
    background: var(--primary);
    color: white;
}

.compact-toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(46, 93, 75, 0.3);
}

/* Compact Grid Mode */
.sightings-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.6rem;
}

.sightings-grid.compact .bird-card {
    border-radius: 10px;
}

.sightings-grid.compact .bird-image-container {
    height: 0;
    padding-bottom: 100%; /* Square aspect ratio */
}

.sightings-grid.compact .bird-image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}

.sightings-grid.compact .bird-image-name {
    font-size: 0.7rem;
    padding: 0.3rem 0.4rem;
}

.sightings-grid.compact .bird-card:not(.log-card) .bird-info {
    display: none;
}

.sightings-grid.compact .bird-info {
    display: none;
}

.sightings-grid.compact .edit-image-btn,
.sightings-grid.compact .delete-sighting-btn {
    display: none;
}

.sightings-grid.compact .sighting-count-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
}

/* Bird Card */
.bird-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.bird-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.bird-image-container {
    height: 200px;
    background-color: #f0f0f0;
    position: relative;
    overflow: hidden;
}

.bird-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.5s;
}

.bird-card:hover .bird-image-container img {
    transform: scale(1.05);
}

.edit-image-btn,
.delete-sighting-btn,
.quick-add-btn {
    position: absolute;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.edit-image-btn {
    top: 10px;
    right: 10px;
}

.delete-sighting-btn {
    top: 10px;
    left: 10px;
    background: rgba(220, 53, 69, 0.8);
}

.quick-add-btn {
    bottom: 10px;
    right: 10px;
    background: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.bird-card:hover .edit-image-btn,
.bird-card:hover .delete-sighting-btn,
.bird-card:hover .quick-add-btn {
    opacity: 1;
}

.bird-card.selected {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.5), var(--shadow-md);
}

.edit-image-btn:hover {
    background: var(--primary);
}

.quick-add-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: rgba(46, 93, 75, 0.85);
    color: white;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s, transform 0.2s;
    font-size: 1rem;
}

.bird-card:hover .quick-add-btn {
    opacity: 1;
}

.quick-add-btn:hover {
    background: var(--secondary);
    transform: scale(1.15);
}

.instant-add-btn {
    position: absolute;
    bottom: 10px;
    left: 55px;
    /* Next to quick-add (search) btn */
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: all 0.2s;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.bird-card:hover .instant-add-btn {
    opacity: 1;
}

.instant-add-btn:hover {
    background: white;
    color: var(--secondary);
    transform: scale(1.15);
}

.delete-sighting-btn:hover {
    background: #c82333;
}


.sighting-count-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(2px);
}

.bird-info {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.bird-primary-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main) !important;
    margin-bottom: 0.2rem;
}

.bird-secondary-name {
    font-size: 0.95rem;
    color: var(--secondary);
    /* Greenish tint */
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.bird-scientific {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    color: var(--text-muted);
}

.bird-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* No special log-card styles */

@media (min-width: 600px) {
    .sightings-grid:not(.compact) .log-card {
        flex-direction: row;
        height: auto;
        min-height: 180px;
    }
    
    .sightings-grid:not(.compact) .log-card .bird-image-container {
        width: 200px;
        height: 100%;
        flex-shrink: 0;
    }
    
    .sightings-grid:not(.compact) .log-card .bird-info {
        padding: 1.5rem;
    }
}

.log-card .sighting-details {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #eee;
}

#detail-description {
    font-size: 0.95rem;
    color: var(--text-main);
    margin: 1rem 0;
    line-height: 1.6;
    display: block !important;
}

.bird-card-rarity {
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.notes-text {
    margin-top: 0.5rem;
    font-style: italic;
    color: #666;
    background: #f9f9f9;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
}


/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeInOverlay 0.3s ease-out forwards;
}

.modal-overlay.active .modal-content {
    animation: slideUpModal 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards;
}

@keyframes fadeInOverlay {
    from {
        background: rgba(0, 0, 0, 0);
        backdrop-filter: blur(0px);
    }
    to {
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
    }
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(100px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-main);
}

.modal-content h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-stack);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(46, 93, 75, 0.1);
}

.submit-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-btn:hover {
    background-color: #244a3c;
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-items {
    position: absolute;
    border: 1px solid #ddd;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.autocomplete-item:hover {
    background-color: #f9f9f9;
}

.autocomplete-item strong {
    color: var(--primary);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: #f9f9f9;
    border-radius: 12px;
    border: 2px dashed #ddd;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ccc;
}

/* Bird Detail Modal */
.bird-detail-modal {
    max-width: 800px;
    width: 95%;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bird-detail-content {
    background: white;
    padding: 2rem;
    overflow-y: auto;
    max-height: 60vh;
}

.bird-detail-header {
    position: relative;
    height: 300px;
    background-color: #eee;
    flex-shrink: 0;
}

.bird-detail-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

/* --- Image Carousel --- */
.bird-image-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #111;
}

.carousel-slides {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(4px);
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn-prev {
    left: 12px;
}

.carousel-btn-next {
    right: 12px;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.3);
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.85);
}

.carousel-counter {
    position: absolute;
    top: 12px;
    right: 56px;
    /* leave room for close button */
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    z-index: 10;
    backdrop-filter: blur(4px);
    letter-spacing: 0.05em;
}


.close-detail-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    transition: transform 0.2s;
    color: var(--text-main);
}

.close-detail-modal:hover {
    transform: scale(1.1);
}

.bird-detail-title {
    margin-bottom: 0.5rem;
    font-size: 2rem;
    color: var(--primary);
}

.bird-detail-scientific {
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    display: block;
}

.bird-facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}



.fact-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-main);
}

.fact-title i {
    color: var(--accent);
}

.rarity-stars {
    color: #FFD700;
    letter-spacing: 2px;
}

.season-map-container {
    width: 100%;
    height: 15rem;
    background: #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 0.5rem;
    position: relative;
}

.season-map-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fun-fact-text {
    font-style: italic;
    color: #555;
    line-height: 1.6;
}

.artportalen-section {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
}

.artportalen-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background-color: #E67E22;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(230, 126, 34, 0.3);
}


.artportalen-btn:hover {
    background-color: #D35400;
    transform: translateY(-2px);
}

.add-sighting-detail-btn.secondary:hover {
    background-color: #7a9c7a !important;
    /* Darker secondary */
}


/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.category-card {
    background: white;
    aspect-ratio: 1 / 1.1;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
    padding: 1.2rem;
    position: relative;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
}

.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.category-icon {
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-icon-img {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: contain;
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.category-card:hover .category-icon-img {
    transform: scale(1.1);
}

.category-name {
    font-weight: 700;
    color: inherit;
    font-size: 1rem;
    line-height: 1.2;
    margin-top: 0.2rem;
}

.category-count {
    font-size: 0.8rem;
    color: var(--cat-text, var(--text-muted));
    margin-top: 0.5rem;
    opacity: 0.85;
    font-weight: 500;
}

/* Guide Navigation */
/* Guide Navigation */
.guide-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.search-bar-container {
    background: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    /* Cleaner shadow */
    margin-bottom: 2rem;
    max-width: 800px;
    /* Stretch further */
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid transparent;
}

.search-bar-container:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--secondary);
}

.search-bar-container i {
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-bar-container input {
    border: none;
    flex-grow: 1;
    font-family: var(--font-stack);
    font-size: 1.1rem;
    color: var(--text-main);
    background: transparent;
}

.search-bar-container input:focus {
    outline: none;
}

.nav-back-btn {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: background 0.2s;
}

.nav-back-btn:hover {
    background: rgba(46, 93, 75, 0.1);
}

#current-category-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Sort Controls */
.list-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eee;
}

.sort-controls label {
    color: var(--primary);
    font-size: 1.1rem;
    cursor: pointer;
}

.sort-controls select {
    border: none;
    font-family: var(--font-stack);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    background: white;
    font-size: 0.95rem;
    padding-right: 1.5rem;
    outline: none;
}


.sort-controls select:focus {
    outline: none;
}


.hidden {
    display: none !important;
}

/* Detail Actions */
.detail-actions {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.detail-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background-color: transparent;
    color: #dc3545;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    border: 1.5px solid #dc3545;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-delete-btn:hover {
    background-color: #dc3545;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

.detail-delete-btn i {
    font-size: 0.9rem;
}

.add-sighting-detail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background-color: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 30px;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(46, 93, 75, 0.3);
    transition: transform 0.2s, background-color 0.2s;
}

.add-sighting-detail-btn:hover {
    background-color: #244a3c;
    transform: translateY(-2px);
}

#detail-camera-btn {
    background-color: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    box-shadow: none;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    transition: all 0.2s;
}

#detail-camera-btn:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(46, 93, 75, 0.3);
}

/* ========================================
   SWEDEN INTERACTIVE MAP
   ======================================== */

.sweden-map-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

.map-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.map-header h2 {
    font-size: 1.8rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.map-header h2 i {
    color: var(--accent);
}

.map-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Month Selector */
.map-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e8e8e8;
}

.month-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--background);
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.month-nav-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.month-display {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    min-width: 180px;
    justify-content: center;
}

.month-name {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-main);
}

.season-badge {
    padding: 0.2rem 0.7rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.season-badge.spring {
    background: #e8f5e9;
    color: #2e7d32;
}

.season-badge.summer {
    background: #fff8e1;
    color: #f9a825;
}

.season-badge.autumn {
    background: #fff3e0;
    color: #e65100;
}

.season-badge.winter {
    background: #e3f2fd;
    color: #1565c0;
}

/* Map Content Layout */
.map-content {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
    min-height: 500px;
}

/* SVG Container */
.map-svg-container {
    background: linear-gradient(145deg, #0a1628 0%, #0f2030 50%, #0a1628 100%);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.map-svg-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 30%, rgba(46, 125, 155, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.sweden-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Region Interactions */
.sweden-region {
    cursor: pointer;
    transition: all 0.2s ease;
}

.sweden-region .region-path {
    transition: fill 0.25s ease, stroke 0.25s ease, filter 0.3s ease;
}

.sweden-region:hover .region-path {
    fill-opacity: 0.85;
    stroke-width: 2;
    filter: brightness(1.5) drop-shadow(0 0 6px rgba(100, 200, 255, 0.4));
}

.sweden-region.active .region-path {
    fill-opacity: 0.95;
    stroke: #fff;
    stroke-width: 2.5;
    filter: brightness(1.8) drop-shadow(0 0 10px rgba(100, 200, 255, 0.6));
}

.sweden-region:hover .region-label {
    fill: white;
    font-size: 7px;
}

.sweden-region.active .region-label {
    fill: white;
    font-weight: 700;
    font-size: 7px;
}

.sweden-region .region-count {
    transition: fill 0.25s ease;
}

.sweden-region:hover .region-count,
.sweden-region.active .region-count {
    fill: #fff;
}

/* Region Info Panel */
.region-info-panel {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    max-height: 580px;
    overflow-y: auto;
    border: 1px solid #e8e8e8;
}

.region-info-panel::-webkit-scrollbar {
    width: 6px;
}

.region-info-panel::-webkit-scrollbar-track {
    background: transparent;
}

.region-info-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.region-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.region-placeholder i {
    font-size: 3rem;
    color: #d0d0d0;
    margin-bottom: 1rem;
    animation: pulse-gentle 2s infinite;
}

@keyframes pulse-gentle {

    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }
}

.region-placeholder p {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.region-placeholder .subtitle {
    font-size: 0.9rem;
    font-weight: 400;
    color: #aaa;
}

/* Region Detail */
.region-detail {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.region-detail-header {
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #f8faf9 0%, #eef3f0 100%);
    border-bottom: 1px solid #e0e0e0;
}

.region-detail-header h3 {
    font-size: 1.3rem;
    color: var(--primary);
    margin: 0 0 0.4rem;
}

.region-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.region-bird-count {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
}

.region-season {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Bird Type Groups */
.region-bird-types {
    padding: 0.5rem;
}

.region-type-group {
    margin-bottom: 0.25rem;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}

.region-type-group.collapsed .type-birds {
    display: none;
}

.region-type-group.collapsed .type-chevron {
    transform: rotate(-90deg);
}

.type-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    border-radius: 8px;
}

.type-header:hover {
    background: #f0f0f0;
}

.type-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.type-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
    flex-grow: 1;
}

.type-count {
    background: var(--background);
    color: var(--text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-chevron {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.type-birds {
    padding: 0 0.5rem 0.5rem;
}

/* Map Bird Card (Compact) */
.map-bird-card {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.map-bird-card:hover {
    background: #e8f5e9;
    transform: translateX(3px);
}

.map-bird-card img {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
    margin-top: 2px;
}

.map-bird-info {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
}

.map-bird-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
}

.map-bird-name {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-bird-en {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-bird-rarity {
    color: #FFD700;
    font-size: 0.65rem;
    letter-spacing: 1px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Month Presence Dots */
.month-dots {
    display: flex;
    gap: 2px;
    margin-top: 3px;
}

.month-dot {
    width: 17px;
    height: 15px;
    border-radius: 3px;
    font-size: 0.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    color: #bbb;
    transition: all 0.2s;
    line-height: 1;
}

.month-dot.active {
    color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.month-dot.current {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
    border-radius: 3px;
    z-index: 1;
}

/* No Birds Message */
.no-birds-message {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.no-birds-message i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    color: #90caf9;
}

/* Map Legend */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.legend-color.north {
    background: linear-gradient(135deg, #0f2d3a, #1a4a5e);
}

.legend-color.central {
    background: linear-gradient(135deg, #123820, #1e5a35);
}

.legend-color.south {
    background: linear-gradient(135deg, #2e2e14, #4a4a22);
}

/* ========================================
   RESPONSIVE / MOBILE STYLES
   ======================================== */

/* --- Tablet breakpoint (â‰¤ 768px) --- */
@media (max-width: 768px) {

    /* Header */
    .app-header {
        flex-wrap: wrap;
        gap: 0.6rem;
        padding: 0.75rem 1rem;
    }

    .header-center {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 0.8rem;
        flex-wrap: wrap;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .actions-right {
        gap: 0.6rem;
    }

    /* Container */
    .app-container {
        padding: 1rem;
    }

    /* Stats */
    .stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    /* Grids */
    .sightings-grid,
    .birds-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1.2rem;
    }

    /* Categories */
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 1rem;
    }

    /* Map - Sweden view */
    .map-content {
        grid-template-columns: 1fr;
    }

    .map-svg-container {
        max-width: 360px;
        margin: 0 auto;
    }

    .region-info-panel {
        max-height: none;
    }

    .map-legend {
        gap: 1rem;
    }

    .month-display {
        min-width: 140px;
    }

    /* Detail modal */
    .bird-detail-modal {
        max-width: 95vw;
    }

    .bird-detail-header {
        height: 220px;
    }

    .bird-detail-title {
        font-size: 1.5rem;
    }

    .bird-detail-content {
        padding: 1.5rem;
    }
}


/* --- Phone breakpoint (â‰¤ 600px) --- */
@media (max-width: 600px) {

    /* Header: stack vertically */
    .app-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.6rem 0.8rem;
    }

    .header-top {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        width: 100%;
    }

    .header-top .logo {
        grid-column: 2;
        margin: 0 auto;
        display: flex;
        justify-content: center;
    }

    .header-top .top-actions {
        grid-column: 3;
        display: flex;
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .header-center {
        order: unset;
        flex-direction: column;
        gap: 0.5rem;
    }

    .view-nav {
        width: 100%;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.25rem;
    }

    .nav-btn {
        flex: 1;
        text-align: center;
        padding: 0.45rem 0.5rem;
        font-size: 0.85rem;
    }

    .user-toggles {
        justify-content: center;
    }

    .user-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
    }

    .actions-right {
        justify-content: center;
        width: 100%;
    }

    .year-filter-container {
        padding: 0.4rem 0.8rem;
    }

    .year-filter-container select {
        font-size: 0.9rem;
    }

    /* Container */
    .app-container {
        padding: 0.75rem;
    }

    /* Stats */
    .stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
        margin-bottom: 1.2rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .action-card i {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }

    /* List header */
    .list-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.6rem;
    }

    .list-header-row h2 {
        font-size: 1.1rem;
        text-align: center;
    }

    .sort-controls {
        justify-content: center;
        padding: 0.5rem 1rem;
    }

    /* Bird card grids */
    .sightings-grid,
    .birds-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Make action buttons always visible on touch devices */
    .edit-image-btn,
    .delete-sighting-btn,
    .quick-add-btn,
    .instant-add-btn {
        opacity: 1;
    }

    /* Bird card image */
    .bird-image-container {
        height: 180px;
    }

    .bird-info {
        padding: 1rem;
    }

    .bird-primary-name {
        font-size: 1.15rem;
    }

    /* Category grid */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .category-card {
        padding: 0.8rem;
    }

    .category-icon {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .category-name {
        font-size: 0.85rem;
    }

    /* Guide search */
    .search-bar-container {
        margin-bottom: 1rem;
        padding: 0.6rem 1rem;
        gap: 0.6rem;
        flex-wrap: wrap;
    }

    .search-bar-container input {
        font-size: 1rem;
        min-width: 0;
    }

    #guide-sort-select {
        font-size: 0.85rem !important;
    }

    /* Guide navigation */
    .guide-nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-back-btn {
        font-size: 0.9rem;
    }

    /* Modals: full-screen on phones */
    .modal-content {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
        margin-top: auto;
        padding: 1.5rem;
    }

    .modal-overlay.active {
        align-items: flex-end;
    }

    .modal-content h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }

    .submit-btn {
        padding: 0.85rem;
        font-size: 1rem;
    }

    /* Bird Detail Modal: full-screen */
    .bird-detail-modal {
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }

    #bird-detail-modal-overlay.active {
        align-items: stretch;
    }

    .bird-detail-header {
        height: 200px;
    }

    .bird-detail-content {
        padding: 1.2rem;
        max-height: none;
        flex: 1;
    }

    .bird-detail-title {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }

    .bird-detail-scientific {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    /* Facts grid */
    .bird-facts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        margin-bottom: 1.2rem;
    }

    .fact-card {
        padding: 0.8rem;
    }

    .fact-title {
        font-size: 0.85rem;
        gap: 0.3rem;
    }

    .fact-value {
        font-size: 1.1rem;
    }

    /* Detail actions: stack vertically */
    .detail-actions {
        flex-direction: column;
        margin-top: 1.2rem;
        gap: 0.6rem;
    }

    .add-sighting-detail-btn {
        width: 100%;
        justify-content: center;
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
    }

    .add-sighting-detail-btn.secondary {
        margin-left: 0 !important;
    }

    .artportalen-btn {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1.2rem;
        font-size: 0.95rem;
    }

    /* Artportalen section */
    .artportalen-section {
        margin-top: 0.8rem;
        padding-top: 1rem;
    }

    .artportalen-section p {
        font-size: 0.85rem;
    }

    /* Fun fact */
    .fun-fact-text {
        font-size: 0.9rem;
    }

    /* Empty state */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state i {
        font-size: 2.5rem;
    }

    /* Sweden map */
    .map-header h2 {
        font-size: 1.3rem;
    }

    .map-subtitle {
        font-size: 0.85rem;
    }

    .month-selector {
        gap: 0.5rem;
        padding: 0.5rem 0.8rem;
    }

    .month-name {
        font-size: 1rem;
    }

    .month-display {
        min-width: 120px;
    }

    .map-svg-container {
        max-width: 280px;
        padding: 1rem;
    }

    /* Map bird cards */
    .map-bird-card {
        padding: 0.6rem;
    }

    .month-dot {
        width: 14px;
        height: 13px;
        font-size: 0.45rem;
    }

    /* Region detail header */
    .region-detail-header {
        padding: 1rem;
    }

    .region-detail-header h3 {
        font-size: 1.1rem;
    }

    /* Sort select in search bar */
    .search-bar-container .sort-controls {
        width: 100%;
        justify-content: center;
    }
}


/* --- Very small phones (â‰¤ 380px) --- */
@media (max-width: 380px) {

    .stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
    }

    .bird-facts-grid {
        grid-template-columns: 1fr;
    }

    .nav-btn {
        font-size: 0.78rem;
        padding: 0.4rem 0.4rem;
    }

    .logo h1 {
        font-size: 1rem;
    }

    .bird-detail-header {
        height: 160px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
}

/* ========================================
   BIRD QUIZ
   ======================================== */

.quiz-menu {
    text-align: center;
    padding: 2rem 0;
}

.quiz-title {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.quiz-title i {
    color: var(--accent);
}

.quiz-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

.quiz-modes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.quiz-mode-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quiz-mode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
}

.quiz-mode-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: var(--secondary);
}

.quiz-mode-card:hover::before {
    opacity: 1;
}

.quiz-mode-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #3a8a6a);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1.2rem;
    box-shadow: 0 4px 12px rgba(46, 93, 75, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.quiz-mode-card:hover .quiz-mode-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(46, 93, 75, 0.4);
}

.quiz-mode-card h3 {
    font-size: 1.2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.quiz-mode-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Difficulty Selection */
.difficulty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    max-width: 900px;
    margin: 0 auto;
}

.difficulty-card {
    background: white;
    border-radius: 20px;
    padding: 2rem 1rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.difficulty-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-light);
}

.diff-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.difficulty-card:hover .diff-icon {
    transform: scale(1.2) rotate(5deg);
}

.difficulty-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.4rem;
    color: var(--primary-dark);
}

.difficulty-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Colors for each difficulty */
.difficulty-card[data-difficulty="nyborjare"] {
    border-bottom: 4px solid #4caf50;
}

.difficulty-card[data-difficulty="intresserad"] {
    border-bottom: 4px solid #2196f3;
}

.difficulty-card[data-difficulty="skadare"] {
    border-bottom: 4px solid #ff9800;
}

.difficulty-card[data-difficulty="orakel"] {
    border-bottom: 4px solid #f44336;
}

/* Quiz Area */
.quiz-area {
    max-width: 700px;
    margin: 0 auto;
    padding: 1rem 0;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.quiz-score-display {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    background: white;
    padding: 0.5rem 1.2rem;
    border-radius: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.quiz-quit-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: #fee;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.quiz-quit-btn:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Quiz Question */
.quiz-question-container {
    text-align: center;
    animation: quizFadeIn 0.4s ease;
}

@keyframes quizFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-question-number {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 1.2rem;
}

.quiz-image-container {
    width: 100%;
    max-height: 320px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.quiz-bird-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
}

.quiz-prompt {
    font-size: 1.15rem;
    font-style: italic;
    color: #555;
    background: #f8f9fa;
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent);
    line-height: 1.6;
}

.quiz-question-text {
    font-size: 1.3rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.quiz-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    max-width: 600px;
    margin: 0 auto;
}

.quiz-option-btn {
    padding: 1rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: var(--font-stack);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-main);
}

.quiz-option-btn:hover {
    border-color: var(--primary);
    background: #f0f8f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.quiz-option-btn.correct {
    border-color: #27ae60;
    background: #e8f8ef;
    color: #1a7a42;
    animation: quizCorrect 0.4s ease;
    box-shadow: 0 0 15px rgba(39, 174, 96, 0.3);
}

.quiz-option-btn.incorrect {
    border-color: #e74c3c;
    background: #fdecea;
    color: #c0392b;
    animation: quizIncorrect 0.4s ease;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.3);
}

@keyframes quizCorrect {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes quizIncorrect {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

/* Quiz Results */
.quiz-results {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 2rem;
}

.quiz-results-card {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    animation: quizFadeIn 0.5s ease;
}

.quiz-results-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: quizBounce 0.6s ease;
}

@keyframes quizBounce {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.quiz-results-card h2 {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
}

.quiz-results-score {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.quiz-results-difficulty {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.quiz-results-score strong {
    color: var(--primary);
    font-size: 1.4rem;
}

.quiz-results-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.quiz-results-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #27ae60);
    border-radius: 5px;
    transition: width 1s ease;
}

.quiz-results-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quiz-btn {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-stack);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.quiz-btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(46, 93, 75, 0.3);
}

.quiz-btn.primary:hover {
    background: #244a3c;
    transform: translateY(-2px);
}

.quiz-btn.secondary {
    background: #f0f0f0;
    color: var(--text-main);
}

.quiz-btn.secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* Quiz Responsive */
@media (max-width: 600px) {
    .quiz-modes-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .quiz-mode-card {
        padding: 1.8rem 1.2rem;
    }

    .quiz-options {
        grid-template-columns: 1fr;
    }

    .quiz-bird-image {
        height: 220px;
    }

    .quiz-results-card {
        padding: 2rem 1.5rem;
    }

    .quiz-question-text {
        font-size: 1.1rem;
    }
}


/* Träboken Mode Styles */
body.mode-trees #sound-recording-group {
    display: none !important;
}

/* Optional: Slight theme adjustment for trees */
body.mode-trees .app-header {
    background-color: #27ae60;
    /* Green */
}

body.mode-trees .nav-btn.active {
    color: #27ae60;
}

body.mode-trees .stat-value {
    color: #27ae60;
}


/* Träboken Sage/Forest Theme */
body.mode-trees {
    --primary: #385a3c;
    --primary-light: #5e8c61;
    --primary-dark: #1e3a1e;
    --background: #f0f4f1;
}

body.mode-trees .app-header {
    background-color: var(--primary);
}

body.mode-trees .nav-btn.active {
    color: var(--primary);
}

body.mode-trees .stat-value {
    color: var(--primary);
}

body.mode-trees .quiz-results-score strong {
    color: var(--primary);
}

body.mode-trees .quiz-btn.primary {
    background-color: var(--primary);
}


/* --- Library Menu Styles --- */
.library-menu {
    border-radius: 20px;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.library-menu h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.library-card {
    border: none;
    border-radius: 12px;
    padding: 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    min-height: 90px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.library-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

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

.lib-icon {
    font-size: 2rem;
    margin-bottom: 0.2rem;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.lib-icon-img {
    width: 2.4rem;
    height: 2.4rem;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    display: block;
}

.lib-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    z-index: 1;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
    letter-spacing: 0.2px;
}

/* Background overlay for depth */
.library-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.05));
    z-index: 0;
}

/* Subject Specific Styles */

/* Subject Specific Styles */

/* Birds: Forest Mist */
.library-card.mode-birds {
    background: linear-gradient(135deg, #2E5D4B 0%, #3e7a63 100%);
    color: white;
}

.library-card.mode-birds .lib-icon {
    color: white;
}

/* Trees: Deep Sage */
.library-card.mode-trees {
    background: linear-gradient(135deg, #385a3c 0%, #4a7a50 100%);
    color: white;
}

.library-card.mode-trees .lib-icon {
    color: white;
}

/* Fish: Oceanic Slate */
.library-card.mode-fish {
    background: linear-gradient(135deg, #2c3e50 0%, #3d5a71 100%);
    color: white;
}

.library-card.mode-fish .lib-icon {
    color: white;
}

/* Animals: Warm Earth */
.library-card.mode-animals {
    background: linear-gradient(135deg, #795548 0%, #8d6e63 100%);
    color: white;
}

.library-card.mode-animals .lib-icon {
    color: white;
}

/* Fungi: Deep Cinnamon */
.library-card.mode-fungi {
    background: linear-gradient(135deg, #5a2d1a 0%, #7d3c26 100%);
    color: white;
}

.library-card.mode-fungi .lib-icon {
    color: white;
}

/* Secondary Button */
.secondary-btn {
    background-color: #f1f2f6;
    color: #7f8fa6;
    border: none;
    border-radius: 12px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-stack);
}

.secondary-btn:hover {
    background-color: #ddd;
    color: #2c3e50;
}

/* View Modes Fixed */
#log-view .bird-info {
    display: none !important;
}

#log-view .bird-image-container img {
    border-radius: var(--border-radius) !important;
}

.bird-image-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem 0.5rem 0.5rem 0.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
    pointer-events: none;
    display: none;
    z-index: 10;
}

#log-view .bird-image-name {
    display: block;
}

/* =============================================
   Blomboken (Flower Mode) — Lavender/Iris Theme
   ============================================= */
body.mode-flowers {
    --primary: #5d4485;
    --secondary: #856db5;
    --accent: #b1a5c1;
    --background: #f3f0f8;
}

body.mode-flowers .app-header {
    background: linear-gradient(135deg, #3a2a5a 0%, #5d4485 60%, #856db5 100%);
}

body.mode-flowers .nav-btn.active {
    color: #5d4485;
}

body.mode-flowers .stat-value {
    color: #5d4485;
}

body.mode-flowers .action-card {
    background: linear-gradient(135deg, #5d4485, #856db5);
}

body.mode-flowers .action-card:hover {
    background: linear-gradient(135deg, #443266, #5d4485);
}

body.mode-flowers .submit-btn {
    background-color: #5d4485;
}

body.mode-flowers .submit-btn:hover {
    background-color: #443266;
}

body.mode-flowers .form-group input:focus,
body.mode-flowers .form-group textarea:focus {
    border-color: #5d4485;
    box-shadow: 0 0 0 3px rgba(93, 68, 133, 0.12);
}

body.mode-flowers .modal-content h2 {
    color: #5d4485;
}

body.mode-flowers .autocomplete-item strong {
    color: #5d4485;
}

body.mode-flowers .quiz-btn.primary {
    background-color: #5d4485;
}

body.mode-flowers .quiz-btn.primary:hover {
    background-color: #443266;
}

body.mode-flowers .quiz-results-score strong {
    color: #5d4485;
}

body.mode-flowers .add-sighting-detail-btn {
    background-color: #5d4485;
}

body.mode-flowers .bird-secondary-name {
    color: #5d4485;
}

/* Blomboken Library Card: Soft Iris */
.library-card.mode-flowers {
    background: linear-gradient(135deg, #5d4485 0%, #7d63a8 100%);
    color: white;
}

.library-card.mode-flowers .lib-icon {
    color: white;
}

/* =============================================
   Växtboken (Plants Mode) — Fresh Leaf Green
   ============================================= */
body.mode-plants {
    --primary: #2e7d32;
    --secondary: #4caf50;
    --accent: #81c784;
    --background: #f1f8e9;
}

body.mode-plants .app-header {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 60%, #388e3c 100%);
}

body.mode-plants .nav-btn.active {
    color: #2e7d32;
}

body.mode-plants .stat-value {
    color: #2e7d32;
}

body.mode-plants .action-card {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
}

body.mode-plants .action-card:hover {
    background: linear-gradient(135deg, #1b5e20, #2e7d32);
}

body.mode-plants .submit-btn {
    background-color: #2e7d32;
}

body.mode-plants .submit-btn:hover {
    background-color: #1b5e20;
}

body.mode-plants .form-group input:focus,
body.mode-plants .form-group textarea:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

body.mode-plants .modal-content h2 {
    color: #2e7d32;
}

body.mode-plants .autocomplete-item strong {
    color: #2e7d32;
}

body.mode-plants .quiz-btn.primary {
    background-color: #2e7d32;
}

body.mode-plants .quiz-btn.primary:hover {
    background-color: #1b5e20;
}

body.mode-plants .quiz-results-score strong {
    color: #2e7d32;
}

body.mode-plants .add-sighting-detail-btn {
    background-color: #2e7d32;
}

body.mode-plants #sound-recording-group {
    display: none !important;
}

/* Växtboken Library Card: Lush Green */
.library-card.mode-plants {
    background: linear-gradient(135deg, #2e7d32 0%, #43a047 100%);
    color: white;
}

.library-card.mode-plants .lib-icon {
    color: white;
}

/* =============================================
   Naturboken (Nature Mode) — Earth & Sky
   ============================================= */
body.mode-nature {
    --primary: #1a3a2a;
    --secondary: #2e6e50;
    --accent: #6dbf8e;
    --background: #f0f5f2;
}

body.mode-nature .app-header {
    background: linear-gradient(135deg, #0d2a1a 0%, #1a3a2a 40%, #2e6e50 100%);
}

body.mode-nature .nav-btn.active {
    color: #1a3a2a;
}

body.mode-nature .stat-value {
    color: #1a3a2a;
}

body.mode-nature .action-card {
    background: linear-gradient(135deg, #1a3a2a, #2e6e50);
}

body.mode-nature .action-card:hover {
    background: linear-gradient(135deg, #0d2a1a, #1a3a2a);
}

body.mode-nature .submit-btn {
    background-color: #1a3a2a;
}

body.mode-nature .submit-btn:hover {
    background-color: #0d2a1a;
}

body.mode-nature .form-group input:focus,
body.mode-nature .form-group textarea:focus {
    border-color: #1a3a2a;
    box-shadow: 0 0 0 3px rgba(26, 58, 42, 0.12);
}

body.mode-nature .modal-content h2 {
    color: #1a3a2a;
}

body.mode-nature .autocomplete-item strong {
    color: #2e6e50;
}

body.mode-nature .quiz-btn.primary {
    background-color: #1a3a2a;
}

body.mode-nature .quiz-btn.primary:hover {
    background-color: #0d2a1a;
}

body.mode-nature .quiz-results-score strong {
    color: #1a3a2a;
}

body.mode-nature .add-sighting-detail-btn {
    background-color: #1a3a2a;
}

/* Naturboken Library Card: Deep Forest */
.library-card.mode-nature {
    background: linear-gradient(135deg, #1a3a2a 0%, #2e6e50 100%);
    color: white;
}

.library-card.mode-nature .lib-icon {
    color: white;
}

/* =============================================
   App Themes
   ============================================= */
body.mode-fish {
    --primary: #2c3e50;
    --primary-light: #4a6b8c;
    --primary-dark: #1a2a3a;
    --background: #f0f4f8;
}

body.mode-fish .app-header,
body.mode-fish .quiz-btn.primary,
body.mode-fish .submit-btn {
    background-color: var(--primary);
}

body.mode-fish .nav-btn.active,
body.mode-fish .stat-value,
body.mode-fish .quiz-results-score strong {
    color: var(--primary);
}

body.mode-animals {
    --primary: #795548;
    --primary-light: #a1887f;
    --primary-dark: #4e342e;
}

body.mode-animals .app-header,
body.mode-animals .quiz-btn.primary,
body.mode-animals .submit-btn {
    background-color: var(--primary);
}

body.mode-animals .nav-btn.active,
body.mode-animals .stat-value,
body.mode-animals .quiz-results-score strong {
    color: var(--primary);
}

body.mode-fungi {
    --primary: #5a2d1a;
    --primary-light: #8c4a2d;
    --primary-dark: #3a1a0a;
    --background: #f8f4f0;
}

body.mode-fungi .app-header,
body.mode-fungi .quiz-btn.primary,
body.mode-fungi .submit-btn {
    background-color: var(--primary);
}

body.mode-fungi .nav-btn.active,
body.mode-fungi .stat-value,
body.mode-fungi .quiz-results-score strong {
    color: var(--primary);
}

/* ===================================================
   STATISTICS TAB
   =================================================== */

.stats-view-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 0 3rem;
}

/* --- Profile Card --- */
.stats-profile-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #1a4a36 50%, #0d2e22 100%);
    border-radius: 20px;
    padding: 1.8rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(46, 93, 75, 0.4);
    position: relative;
    overflow: hidden;
}

.stats-profile-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(143, 188, 143, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.stats-rank-badge {
    font-size: 3.5rem;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-6px);
    }
}

.stats-profile-info {
    flex-grow: 1;
    color: white;
}

.stats-rank-title {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stats-rank-subtitle {
    font-size: 0.95rem;
    opacity: 0.75;
    margin-bottom: 0.8rem;
    font-style: italic;
}

.stats-rank-progress-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stats-rank-progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    max-width: 380px;
}

.stats-rank-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8FBC8F, #D4A373);
    border-radius: 10px;
    transition: width 1s ease;
    width: 0%;
}

.stats-rank-progress-label {
    font-size: 0.8rem;
    opacity: 0.65;
}

/* --- Overview Grid --- */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-overview-card {
    background: white;
    border-radius: 14px;
    padding: 1.2rem 1rem;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.stats-overview-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.stats-overview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.stats-overview-icon {
    font-size: 1.6rem;
    margin-bottom: 0.4rem;
}

.stats-overview-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stats-overview-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Sections Grid --- */
.stats-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.stats-panel {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
}

.stats-panel-wide {
    grid-column: 1 / -1;
}

.stats-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.7rem;
}

.stats-panel-title i {
    color: var(--accent);
}

/* --- Stat Rows --- */
.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-row-label {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.stats-row-value {
    font-weight: 700;
    color: var(--text-main);
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.stats-row-value.highlight {
    color: var(--primary);
}

.stats-row-value.rarity-score {
    color: #e67e22;
}

/* --- Rarity Breakdown --- */
.rarity-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.rarity-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
}

.rarity-bar-label {
    width: 100px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.rarity-bar-wrap {
    flex-grow: 1;
    height: 7px;
    background: #f0f0f0;
    border-radius: 5px;
    overflow: hidden;
}

.rarity-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 1s ease;
}

.rarity-bar-count {
    width: 25px;
    text-align: right;
    font-weight: 600;
    color: var(--text-main);
}

/* --- Badges Grid --- */
.stats-badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.stats-badge {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem 0.8rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.stats-badge.earned {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-color: #86efac;
    box-shadow: 0 3px 10px rgba(46, 93, 75, 0.1);
}

.stats-badge.earned:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 18px rgba(46, 93, 75, 0.2);
}

.stats-badge.locked {
    opacity: 0.45;
    filter: grayscale(0.6);
}

.stats-badge-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.stats-badge-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.stats-badge-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.stats-badge-earned-glow {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-top: 24px solid #22c55e;
    border-left: 24px solid transparent;
}

.stats-badge-earned-glow::after {
    content: '✓';
    position: absolute;
    top: -22px;
    right: 2px;
    font-size: 0.6rem;
    color: white;
    font-weight: 700;
}

/* --- Nature Profile Subject Bars --- */
.nature-subject-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
    font-size: 0.87rem;
}

.nature-subject-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
}

.nature-subject-name {
    width: 80px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.nature-subject-bar-wrap {
    flex-grow: 1;
    height: 10px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.nature-subject-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease;
}

.nature-subject-count {
    font-weight: 700;
    width: 30px;
    text-align: right;
    color: var(--text-main);
}

/* --- Specialization label --- */
.stats-specialization {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-top: 0.4rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* --- Empty State for Stats --- */
.stats-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.stats-empty i {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    opacity: 0.4;
}

/* Responsive */
@media (max-width: 600px) {
    .stats-profile-card {
        flex-direction: column;
        text-align: center;
    }

    .stats-rank-progress-bar {
        max-width: 100%;
    }

    .stats-sections-grid {
        grid-template-columns: 1fr;
    }

    .stats-badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

/* --- Sighting Actions Row & Sections --- */
.sighting-actions-row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.sighting-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem 0;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
}

.sighting-action-btn:hover {
    background: #f1f1f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.sighting-action-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.sighting-hidden-section {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.2rem;
    margin-bottom: 1.2rem;
    animation: fadeIn 0.3s ease-in-out;
}

.sighting-hidden-section.hidden {
    display: none;
}

/* --- Achievement Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column; /* Stack naturally */
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

@media (max-width: 600px) {
    .toast-container {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}

.achievement-toast {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    color: var(--text-main);
    border-left: 4px solid var(--accent);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    pointer-events: auto;
}

@media (max-width: 600px) {
    .achievement-toast {
        transform: translateY(120px);
    }
}

.achievement-toast.show {
    transform: translateX(0);
    opacity: 1;
}

@media (max-width: 600px) {
    .achievement-toast.show {
        transform: translateY(0);
    }
}

.toast-icon {
    font-size: 2rem;
    margin-right: 12px;
}

.toast-content {
    display: flex;
    flex-direction: column;
}

.toast-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.toast-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- Unseen Highlight Notifications --- */
@keyframes unseen-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 163, 115, 0.6), inset 0 0 5px rgba(212, 163, 115, 0.4);
        border: 2px solid rgba(212, 163, 115, 0.2);
    }
    50% {
        box-shadow: 0 0 15px 5px rgba(212, 163, 115, 0.8), inset 0 0 10px rgba(212, 163, 115, 0.6);
        border: 2px solid rgba(212, 163, 115, 1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(212, 163, 115, 0.6), inset 0 0 5px rgba(212, 163, 115, 0.4);
        border: 2px solid rgba(212, 163, 115, 0.2);
    }
}

.unseen-highlight {
    animation: unseen-pulse 1.5s infinite ease-in-out !important;
    position: relative;
    box-sizing: border-box;
}

/* --- Photographers View --- */
.photographers-container {
    max-width: 1000px;
    margin: 0 auto;
}

.photographers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.photographer-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-align: center;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.photographer-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.photographer-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
}

.photographer-card h3 {
    color: var(--text-main);
    font-size: 1.25rem;
}

.photographer-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.photographer-detail {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease-in-out;
}

.photographer-profile-header {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.photographer-avatar-large {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
    flex-shrink: 0;
}

.photographer-profile-info {
    flex-grow: 1;
}

.photographer-profile-info h2 {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #d46a6a;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: bold;
    color: white;
    transition: background-color 0.2s, transform 0.2s;
}

.donate-btn:hover {
    background-color: #b55a5a;
    transform: translateY(-2px);
}

.photographer-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.photographer-gallery-item {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s;
    cursor: pointer;
}

.photographer-gallery-item:hover {
    transform: scale(1.05);
}

/* Photographer Tag on Images */
.photographer-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    z-index: 10;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(2px);
}

.photographer-tag:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

/* Gender Symbol Badge on Images */
.gender-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    font-weight: 900;
    z-index: 10;
    pointer-events: none;
    user-select: none;
    backdrop-filter: blur(4px);
    transition: opacity 0.2s;
}

.gender-badge.male {
    background: rgba(59, 130, 246, 0.45);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.gender-badge.female {
    background: rgba(236, 72, 153, 0.45);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.gender-badge.juvenile {
    background: rgba(250, 204, 21, 0.45);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.gender-badge.pair {
    background: rgba(168, 85, 247, 0.45);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    font-size: 0.75rem;
    letter-spacing: -1px;
}

.gender-badge.same {
    background: rgba(100, 116, 139, 0.40);
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    font-size: 1.05rem;
}

@media (max-width: 600px) {
    .photographer-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* ========================================
   SIGHTING MAP (PIN PLACEMENT)
   ======================================== */

.sighting-map-wrapper {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    transition: border-color 0.3s;
}

.sighting-map-wrapper:hover {
    border-color: var(--primary);
}

.sighting-map {
    height: 260px;
    width: 100%;
    z-index: 0;
    background: #f1f5f9;
}

.map-gps-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: white;
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.map-gps-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.map-gps-btn:active {
    transform: scale(0.95);
}

.map-gps-btn.locating {
    animation: pulse-gps 1s infinite;
}

@keyframes pulse-gps {
    0%, 100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); }
    50% { box-shadow: 0 2px 20px rgba(46, 125, 50, 0.5); }
}

/* ========================================
   SIGHTINGS OVERVIEW MAP
   ======================================== */

.sightings-map-header {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.map-expand-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f1f5f9;
    color: var(--text-main);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.map-expand-btn:hover {
    background: var(--primary);
    color: white;
}

.sightings-map-modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

/* Fullscreen mode */
.sightings-map-modal-content.fullscreen {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    margin: 0;
    padding: 0.8rem;
}

.sightings-map-modal-content.fullscreen .sightings-overview-map {
    height: calc(100vh - 100px);
    min-height: unset;
    border-radius: 8px;
}

.sightings-map-modal-content.fullscreen .sightings-map-title,
.sightings-map-modal-content.fullscreen .sightings-map-subtitle {
    display: none;
}

#sightings-map-modal.active .sightings-map-modal-content.fullscreen {
    border-radius: 0;
}

.sightings-overview-map {
    height: 60vh;
    min-height: 350px;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid #e2e8f0;
    flex: 1;
}

/* Custom Leaflet popup */
.leaflet-popup-content-wrapper {
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
    overflow: hidden;
}

.leaflet-popup-content {
    margin: 0 !important;
    min-width: 120px;
}

/* Square popup style */
.square-popup .leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    padding: 0 !important;
}

.square-popup .leaflet-popup-content {
    margin: 0 !important;
    min-width: 0;
}

.square-popup .leaflet-popup-tip {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sighting-popup-square {
    position: relative;
    width: 130px;
    height: 130px;
    overflow: hidden;
    border-radius: 10px;
}

.sighting-popup-img-square {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Top-biased crop: keeps the upper portion (where bird heads typically are) */
    object-position: center 25%;
    display: block;
    transition: transform 0.3s;
}

.sighting-popup-square:hover .sighting-popup-img-square {
    transform: scale(1.05);
}

.sighting-popup-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    padding: 0.6rem 0.5rem 0.4rem;
    pointer-events: none;
}

.sighting-popup-label {
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    display: block;
    line-height: 1.2;
}

/* Keep old styles for non-map popups just in case */
.sighting-popup {
    padding: 0.8rem 1rem;
    font-family: 'Outfit', sans-serif;
}

.sighting-popup-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main, #1a1a2e);
    margin-bottom: 0.2rem;
}

.sighting-popup-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    object-position: center 25%;
    display: block;
}

/* Responsive map adjustments */
@media (max-width: 600px) {
    .sighting-map {
        height: 220px;
    }

    .sightings-map-modal-content {
        max-height: 100vh;
        border-radius: 16px 16px 0 0;
    }

    .sightings-map-modal-content.fullscreen {
        border-radius: 0;
        padding: 0.5rem;
    }

    .sightings-overview-map {
        height: 50vh;
        min-height: 280px;
        border-radius: 10px;
    }

    .sighting-popup-square {
        width: 110px;
        height: 110px;
    }
}

