/* FONT IMPORT */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@700&family=Montserrat:wght@400;500;600&display=swap');

/* BASIC RESET & THEME */
:root {
    --primary-green: #556b2f;
    --dark-green: #2e4034;
    --background-dark: #1a2a26;
    --text-light: #f2f2f2;
    --text-muted: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.15);
    --module-bg: rgba(255, 255, 255, 0.05);
    --hover-bg: rgba(255, 255, 255, 0.1);
    --success-green: #4caf50;
    --warning-orange: #ff9800;
    --error-red: #f44336;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    margin: 0;
    padding-top: 120px; /* --- THIS IS THE FIX: Added padding to push content below the shorter header --- */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* BACKGROUND CYCLER */
#background-cycler {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transition: background-image 1.5s ease-in-out;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(26, 42, 38, 0.9), rgba(26, 42, 38, 0.7));
    z-index: -1;
}

/* 
    --- THIS IS THE FIX ---
    The old header styles have been REMOVED from this file.
    The dashboard will now inherit the universal header styles from style.css,
    ensuring consistency and fixing the notification bell visibility.
*/

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background-color: inherit;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #333;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 5px;
    overflow: hidden;
    right: 0; /* Align dropdown to the right */
}

.dropdown-content a {
    color: var(--text-light);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.dropdown-content a:hover {
    background-color: #444;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* MAIN DASHBOARD LAYOUT */
.dashboard-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

.dashboard-layout {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.left-column {
    flex: 3;
}

.right-column {
    flex: 1;
    position: sticky;
    top: 100px;
}

/* PROFILE HEADER */
.profile-header-section {
    margin-bottom: 2rem;
}

.cover-photo {
    height: 250px;
    background-size: cover;
    background-position: center;
    border-radius: 12px 12px 0 0; /* Only round the top corners */
    position: relative;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: opacity 0.3s ease-in;
    opacity: 0.7; /* Start with slightly faded opacity */
}

/* Added class for image loading transition */
.cover-photo.loaded {
    opacity: 1;
}

.profile-picture-link {
    display: block;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 5px solid var(--background-dark);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    overflow: hidden;
    position: relative; /* Ensure it's on top of the bio section */
    z-index: 2;
}

.profile-picture-link:hover, .profile-picture-link:focus {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    outline: none;
}

.profile-picture {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    transition: opacity 0.3s ease-in;
    opacity: 0.7; /* Start with slightly faded opacity */
}

/* Added class for image loading transition */
.profile-picture.loaded {
    opacity: 1;
}

.profile-info-and-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    text-shadow: 1px 1px 3px #000;
}

.profile-info h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
}

.profile-info p {
    margin: 5px 0 0;
    color: #ddd;
    font-size: 1.1rem;
}

.action-button {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    display: inline-block;
    margin-left: 10px;
}

.action-button:hover, .action-button:focus {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    outline: none;
}

/* ** THIS IS THE NEW STYLE FOR THE BIO SECTION ** */
.profile-bio-section {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1) inset;
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem; /* Space before the stats bar */
    border-radius: 0 0 12px 12px; /* Round the bottom corners */
}

#bio-display {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
    text-align: center;
    max-width: 700px; /* Keep it readable */
    margin-left: auto;
    margin-right: auto;
}

/* STATS BAR */
.stats-bar {
    background-color: var(--module-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    justify-content: space-around;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat {
    padding: 0 15px;
}

.stat h3 {
    margin: 0;
    font-size: 2rem;
    color: var(--text-light);
    font-weight: 700;
}

.stat p {
    margin: 5px 0 0;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* DASHBOARD MODULES */
.dashboard-module {
    background-color: var(--module-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-module:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.dashboard-module h2 {
    margin-top: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    position: relative;
    padding-bottom: 10px;
}

.dashboard-module h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-green);
    border-radius: 3px;
}

/* TABS NAVIGATION */
.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.tab-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.tab-nav a {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-nav a:hover, .tab-nav a:focus {
    color: var(--text-light);
    background-color: var(--hover-bg);
    outline: none;
}

.tab-nav a.active {
    color: var(--text-light);
    border-bottom-color: var(--primary-green);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s;
}

/* HEAT MAP */
.heat-map-placeholder {
    width: 100%;
    height: 200px;
    background-color: rgba(0,0,0,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-style: italic;
}

/* SIGHTINGS & CONTENT STYLING */
.sightings-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-green) var(--background-dark);
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.sightings-carousel::-webkit-scrollbar {
    height: 8px;
}

.sightings-carousel::-webkit-scrollbar-track {
    background: var(--background-dark);
    border-radius: 4px;
}

.sightings-carousel::-webkit-scrollbar-thumb {
    background-color: var(--primary-green);
    border-radius: 4px;
}

/* --- THIS IS THE FIX: Added color and text-decoration to the sighting card link --- */
.sighting-carousel-card {
    flex: 0 0 200px;
    background-color: var(--hover-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    color: inherit; /* Make text color the same as the parent */
    text-decoration: none; /* Remove underline */
}

.sighting-carousel-card:hover, .sighting-carousel-card:focus {
    transform: translateY(-5px);
    outline: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.sighting-carousel-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.card-info {
    padding: 10px;
}

.card-info h4 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
}

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

/* SIGHTING ITEM AND LISTING ITEM */
/* --- THIS IS THE FIX: Added color and text-decoration to the sighting item link --- */
.sighting-item, .listing-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 10px;
    background-color: var(--hover-bg);
    border-radius: 8px;
    transition: all 0.2s ease;
    color: inherit; /* Make text color the same as the parent */
    text-decoration: none; /* Remove underline */
}

.sighting-item:hover, .listing-item:hover, .sighting-item:focus, .listing-item:focus {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    outline: none;
}

.sighting-item img, .listing-item img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 15px;
}

.sighting-item div h4, .listing-item div h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.sighting-item div p, .listing-item div p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* PIN ITEMS */
.pin-item {
    padding: 15px;
    margin-bottom: 10px;
    background-color: var(--hover-bg);
    border-radius: 8px;
    border-left: 3px solid var(--primary-green);
    transition: all 0.2s ease;
}

.pin-item:hover, .pin-item:focus {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    outline: none;
}

.pin-item h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.pin-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* UPLOAD BUTTON */
.upload-sighting-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.upload-sighting-btn:hover, .upload-sighting-btn:focus {
    transform: scale(1.1);
    background-color: #3d4c21;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    outline: none;
}

/* EMPTY STATE MESSAGES */
.empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.empty-state i {
    margin-bottom: 10px;
    opacity: 0.7;
}

.error-state {
    text-align: center;
    padding: 20px;
    color: var(--error-red);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-left: 3px solid var(--error-red);
    background-color: rgba(244, 67, 54, 0.1);
    border-radius: 8px;
}

.error-state i {
    margin-bottom: 10px;
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
}

.loading-indicator i {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* RESPONSIVE STYLES */
@media (max-width: 768px) {
    .dashboard-layout {
        flex-direction: column;
    }
    
    .right-column {
        position: static;
        width: 100%;
    }
    
    .profile-info-and-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-actions {
        margin-top: 1rem;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .profile-actions .action-button {
        margin-left: 0;
        margin-bottom: 10px;
    }
    
    .stats-bar {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .stat {
        flex: 1 0 45%;
        margin-bottom: 1rem;
    }
    
    .tab-nav {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .profile-picture-link {
        width: 100px;
        height: 100px;
    }
    
    .cover-photo {
        height: 200px;
    }
    
    .profile-info h1 {
        font-size: 1.8rem;
    }
    
    .stat {
        flex: 0 0 100%;
    }
    
    .upload-sighting-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* ANIMATIONS */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

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

.fadeInUp {
    animation: fadeInUp 0.5s ease-out;
}

/* Accessibility Focus Styles */
:focus {
    outline: 2px solid var(--primary-green);
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Print Styles */
@media print {
    .main-header, .upload-sighting-btn {
        display: none;
    }
    
    body {
        background-color: #fff;
        color: #000;
        padding-top: 0;
    }
    
    .dashboard-container {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .cover-photo {
        border: 1px solid #ddd;
    }
}

/* --- THIS IS THE FIX: New Suggested Species Styles --- */
.suggestion-item {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    padding: 10px;
    background-color: var(--hover-bg);
    border-radius: 8px;
    transition: all 0.2s ease;
    color: inherit;
    text-decoration: none;
}

.suggestion-item:last-child {
    margin-bottom: 0;
}

.suggestion-item:hover, .suggestion-item:focus {
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    outline: none;
}

.suggestion-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%; /* Circular images for suggestions */
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid var(--border-color);
}

.suggestion-item div h4 {
    margin: 0 0 4px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.suggestion-item div p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}


/* --- THIS IS THE FIX: Full Width Map & InfoWindow Styles --- */

/* The new full-width section for the map */
.full-width-map-section {
    grid-column: 1 / -1; /* This makes it span all columns if it were in a grid */
    margin-top: 2rem;
    padding-top: 20px; /* Reduced padding-top */
}

.sighting-map-container {
    width: 100%;
    height: 500px; /* Increased height for a bigger map */
    background-color: rgba(0,0,0,0.3);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.sighting-infowindow {
    background-color: var(--background-dark);
    color: var(--text-light);
    padding: 10px;
    border-radius: 6px;
    max-width: 220px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    font-family: 'Montserrat', sans-serif;
    border: 1px solid var(--border-color);
}

.sighting-infowindow a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.infowindow-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.infowindow-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.infowindow-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* Customizations to override default Google Maps styles */
.gm-style-iw {
    padding: 0 !important;
    background-color: transparent !important;
}

.gm-style-iw-d {
    overflow: hidden !important;
}

.gm-style-iw-c {
    box-shadow: none !important;
    border-radius: 6px !important;
}

/* --- NEW: Map empty-state overlay that does not remove the map DOM --- */
.map-empty-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.5);
    padding: 12px 16px;
    border-radius: 8px;
    z-index: 2;
    pointer-events: none;
    color: var(--text-light);
    text-align: center;
}

/* Responsive tweaks for map overlay */
@media (max-width: 480px) {
    .map-empty-overlay {
        width: 90%;
        font-size: 0.95rem;
    }
}