/* Main Styles */
:root {
    --primary-color: #0078d7;
    --secondary-color: #6c757d;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --border-radius: 0.25rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #fff;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: #005fa3;
}

img {
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Styles */
.site-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--box-shadow);
}

.logo-container {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.logo-link {
    color: white;
    text-decoration: none;
}

.logo h1 {
    font-size: 2rem;
    margin: 0;
    text-align: center;
}

.logo p {
    font-size: 1rem;
    margin: 0;
    text-align: center;
}

.search-container {
    display: flex;
    gap: 0.5rem;
}

.search-form {
    display: flex;
    flex: 1;
    gap: 0.5rem;
}

.search-input-container {
    position: relative;
    flex: 1;
}

#location-search {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
    z-index: 1000; /* Increased z-index */
    max-height: 300px;
    overflow-y: auto;
}

/* Hide any other search results that might be showing */
.search-results + .search-results {
    display: none !important;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    color: #333;
}

.search-result-item:hover {
    background-color: var(--light-color);
}

.powered-by-google {
    padding: 0.5rem 1rem;
    text-align: right;
    font-size: 0.8rem;
    color: #666;
    border-top: 1px solid #eee;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--dark-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: #23272b;
}

.get-location-btn {
    padding: 0.75rem;
    background-color: var(--dark-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.get-location-btn:hover {
    background-color: #23272b;
}

/* Current Weather Styles */
.current-weather {
    padding: 2rem 0;
}

.weather-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.weather-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: center;
}

.weather-header h2 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.location-flag {
    width: 24px;
    height: auto;
}

.weather-header p {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    opacity: 0.9;
}

.weather-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.weather-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.weather-icon img {
    width: 120px;
    height: 120px;
}

.weather-icon p {
    margin-top: 0.5rem;
    font-size: 1.1rem;
    text-align: center;
}

.weather-temp {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.temp-display {
    font-size: 3rem;
    font-weight: bold;
}

.feels-like {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Weather Map Styles */
.weather-map {
    padding: 2rem 0;
    background-color: var(--light-color);
}

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

.section-header h2 {
    margin: 0;
}

.map-controls {
    display: flex;
    gap: 0.5rem;
}

.map-layer-btn {
    padding: 0.5rem 1rem;
    background-color: white;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.map-layer-btn[aria-pressed="true"] {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.map-container {
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

/* Forecast Section Styles */
.forecast {
    padding: 2rem 0;
    background-color: #f0f2f5; /* A slightly off-white for the main forecast section background */
}

.forecast-items {
    display: grid; /* Changed from flex to grid */
    grid-template-columns: repeat(7, minmax(0, 1fr)); /* Responsive grid columns */
    gap: 1rem;
    padding: 1rem 0.5rem;
    overflow-x: hidden; /* Prevent scrollbar if items are slightly too wide during resize */
}

.forecast-item {
    /* min-width: 130px; Removed as grid handles sizing */
    text-align: center;
    /* flex: 0 0 auto; Removed as it's for flexbox */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%; /* Ensure item takes full width of its grid cell */
}

.forecast-day-content {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 10px; /* Space between the box and the button */
    width: 100%;
    box-sizing: border-box;
}

.forecast-day {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.forecast-icon {
    width: 50px;
    height: 50px;
    margin: 0.5rem 0;
}

.forecast-temp {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.forecast-temp-max {
    font-weight: bold;
}

.forecast-temp-min {
    color: var(--secondary-color);
}

/* Popular Locations Section */
.popular-locations {
    padding: 2rem 0;
    background-color: var(--light-color);
}

.popular-locations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.popular-location-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
    background-color: white;
}

.popular-location-item:hover {
    transform: translateY(-5px);
}

.location-image {
    height: 150px;
    position: relative;
}

.location-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.location-overlay {
    position: absolute;
    top: 0;
    right: 0;
    background-color: rgba(0,0,0,0.6);
    color: white;
    padding: 0.5rem 1rem;
    border-bottom-left-radius: 10px;
}

.location-temp {
    font-size: 1.2rem;
    font-weight: bold;
}

.location-info {
    padding: 1rem;
}

.location-name {
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location-flag {
    width: 20px;
    height: auto;
}

.location-weather {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
}

.location-weather-icon {
    width: 24px;
    height: 24px;
}

/* Weather News Section */
.weather-news {
    padding: 2rem 0;
    background-color: white;
 

}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.news-item {
    background-color: var(--light-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.news-image {
    height: 200px;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    padding: 1.5rem;
}

.news-content h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.news-date {
    color: var(--secondary-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.news-excerpt {
    margin-bottom: 1rem;
    line-height: 1.5;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.read-more:hover {
    text-decoration: underline;
}

/* Features Section Styles */
.features {
    padding: 3rem 0;
    text-align: center;
    background-color: var(--light-color);
}

.features h2 {
    margin-bottom: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    padding: 1.5rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.feature-item h3 {
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--secondary-color);
}

/* Footer Styles */
.site-footer {
    background-color: #000000; /* Pure black background */
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.site-footer p {
    margin: 0.5rem 0;
}

.visitor-counter {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Map Info Window */
.map-info-window {
    padding: 0.5rem;
    min-width: 150px;
}

.info-window-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.info-window-header h3 {
    margin: 0;
    font-size: 1rem;
}

.info-flag {
    width: 20px;
    height: auto;
}

.info-window-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-weather-icon {
    width: 40px;
    height: 40px;
}

.info-temp {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.nominatim-attribution {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    padding: 5px;
    border-top: 1px solid #eee;
    margin-top: 5px;
}

.search-result-item.loading {
    color: #666;
    font-style: italic;
}

.search-result-item.error {
    color: #f44336;
    font-style: italic;
}
.blog-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 40px;
}

.blog-preview img {
  width: 100%;
  max-width: 300px;
  height: 200px;
  border-radius: 6px;
  object-fit: cover;
  flex: 0 0 auto;
}

.blog-preview > div {
  flex: 1;
  min-width: 200px;
}

.blog-list .container {
  margin-top: 30px;
}


/* Flag animation */
@keyframes flagWave {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-1px, -1px) rotate(-1deg); }
  50% { transform: translate(0, 0) rotate(0deg); }
  75% { transform: translate(1px, -1px) rotate(1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.animated-flag {
  animation: flagWave 2s ease-in-out infinite;
}



/* Flag spinning animation */
@keyframes flagSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning-flag {
  animation: flagSpin 0.5s linear infinite; /* Adjust duration as needed */
}



/* Info Window Drop-in Animation */
@keyframes infoWindowDrop {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.info-window-drop-start {
  opacity: 0;
}

.info-window-drop-active {
  animation: infoWindowDrop 0.4s ease-out forwards;
  animation-delay: 0.1s; /* Start slightly after marker drop */
}



/* Footer Link Styles - Blue links */
.site-footer a {
    color: var(--primary-color); /* Blue link color */
    text-decoration: underline; /* Add underline for better visibility */
    margin: 0 6px; /* Maintain spacing */
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--info-color); /* Change to info color on hover */
}



/* Header Link Styles - White text, hover effect */
.site-header a {
    color: white; /* White text */
    text-decoration: none; /* No underline */
    transition: color 0.3s ease; /* Add transition for hover */
}

.site-header a:hover {
    color: var(--info-color); /* Change to info color on hover */
    text-decoration: none; /* Ensure no underline on hover */
}



/* Hourly Forecast Dropdown Styles */
.forecast-item {
    position: relative; /* Needed for absolute positioning of trigger/dropdown if that route is taken, or just for stacking context */
    padding-bottom: 5px; /* Add some space if trigger is outside */
}

.forecast-day-content {
    /* This div now wraps the original forecast item content to separate it from the trigger and dropdown */
    /* Add any specific styling if needed, but mostly it's a structural element */
}

/* Styles for the always-visible forecast trigger button */
.hourly-forecast-trigger {
    background-color: var(--dark-color); /* Dark background to match image */
    color: white;
    text-align: center;
    padding: 8px 5px; /* Adjusted padding to ensure text fits on one line */
    margin-top: 10px; /* Space above the trigger */
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    width: 100%; /* Full width of the forecast item card */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    display: block; /* Ensure it takes full width and behaves as a block */
    transition: background-color 0.3s ease; /* For hover effect on the button itself */

    /* Ensure it's always visible by default */
    opacity: 1;
    visibility: visible;
    max-height: none; /* Allow natural height, remove restriction */
    overflow: visible; /* Default, ensures content isn't clipped */
}

/* .forecast-item:hover .hourly-forecast-trigger rule is removed as the button is now always visible */

/* Keep the hover effect for the button itself if desired, or adjust */
.hourly-forecast-trigger:hover {
    background-color: #495057; /* A slightly lighter dark color for hover, adjust as needed */
}

.hourly-forecast-trigger:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

.hourly-forecast-dropdown {
    background-color: #f9f9f9; /* Light grey background */
    border: 1px solid #ddd;
    border-top: none; /* Avoid double border with trigger if styled as a bar */
    border-radius: 0 0 4px 4px;
    margin-top: 0px; /* Attach to trigger or forecast item */
    padding: 0;
    max-height: 0;
    overflow-y: auto; /* Changed from hidden to auto for scrolling */
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.7s ease-in-out, opacity 0.5s ease-in-out, padding 0.5s ease-in-out, visibility 0s 0.7s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.hourly-forecast-dropdown.active {
    padding: 10px;
    max-height: 300px; /* Adjust based on content, allows for scrolling */
    opacity: 1;
    visibility: visible;
    transition: max-height 0.7s ease-in-out, opacity 0.5s ease-in-out, padding 0.5s ease-in-out, visibility 0s 0s;
}

.hourly-item {
    display: flex;
    flex-direction: column; /* Stack line1 and line2 */
    padding: 8px 5px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

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

.hourly-item-line1, .hourly-item-line2 {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Distribute elements in the line */
    width: 100%;
    flex-wrap: wrap; /* Allow items to wrap to the next line if needed */
}

.hourly-item-line1 {
    margin-bottom: 4px; /* Space between line1 and line2 */
}

.hourly-time {
    font-weight: bold;
    /* min-width: 50px; Ensure time has enough space */
    flex-shrink: 1; /* Allow time to shrink */
    margin-right: 5px; /* Add some space to the right */
    white-space: nowrap; /* Keep time on one line if possible, but will wrap due to parent flex-wrap */
}

.hourly-icon {
    width: 30px; /* Smaller icon for hourly view */
    height: 30px;
    margin: 0 5px; /* Reduced margin */
    flex-shrink: 0; /* Icon should not shrink */
}

.hourly-temp {
    /* min-width: 100px; Ensure temp has enough space */
    text-align: right;
    white-space: normal; /* Allow temp to wrap if very long */
    flex-shrink: 1; /* Allow temp to shrink */
    margin-left: 5px; /* Add some space to the left */
}

.hourly-feels-like {
    font-size: 0.9em;
    color: #555;
    text-align: right; /* Align to the right, under temp */
    width: 100%; /* Take full width to push to right */
    white-space: normal; /* Allow feels like to wrap */
}

/* Responsive adjustments for hourly forecast if needed */
@media (max-width: 768px) {
    .hourly-forecast-trigger {
        font-size: 0.8em;
        padding: 6px 0;
    }
    .forecast-item:hover .hourly-forecast-trigger {
        padding: 6px 0;
    }
    .hourly-item {
        font-size: 0.85em;
    }
    .hourly-icon {
        width: 25px;
        height: 25px;
        margin: 0 5px;
    }
    .hourly-temp {
        min-width: 90px;
    }
    .hourly-forecast-dropdown.active {
        max-height: 250px; /* Adjust for smaller screens */
    }
}

