/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f4f4f4;
}

/* Hero Banner */
/* Hero Banner */
.hero {
    height: 100vh;
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.85) 0%, rgba(42, 82, 152, 0.85) 50%, rgba(126, 139, 163, 0.85) 100%),
                url('images/flood-background.jpg') center/cover no-repeat;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,60 Q300,90 600,60 T1200,60 L1200,120 L0,120 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
    animation: wave 15s ease-in-out infinite;
    opacity: 0.3;
}

@keyframes wave {
    0%, 100% { transform: translateX(0) translateY(0); }
    50% { transform: translateX(-50px) translateY(-20px); }
}

.hero-content {
    text-align: center;
    color: white;
    z-index: 1;
    padding: 20px;
    max-width: 900px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: fadeInDown 1s ease-out;
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out 0.3s backwards;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-indicator::before {
    content: '↓';
    color: white;
    font-size: 2rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    background: rgba(30, 60, 114, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 0 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 8px 15px;
    border-radius: 5px;
}

nav a:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* Content Sections */
.section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section:nth-child(even) {
    background: white;
}

.section-title {
    font-size: 2.5rem;
    color: #1e3c72;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #1e3c72, #2a5298);
    border-radius: 2px;
}

.section-intro {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    margin: 0 auto 50px;
}

/* Overview Content Layout */
.overview-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    margin: 40px 0;
}

.overview-text {
    padding-right: 20px;
}

.overview-text p {
    text-align: left;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.overview-image {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.overview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #6c757d;
    border-radius: 10px;
}

.image-placeholder::before {
    content: '🌊';
    font-size: 4rem;
    margin-bottom: 15px;
}

/* Info Cards */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.info-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s;
    border-left: 5px solid #2a5298;
}

.section:nth-child(even) .info-card {
    background: #f9f9f9;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.info-card h3 {
    color: #1e3c72;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.info-card ul {
    margin-left: 20px;
    color: #555;
}

.info-card li {
    margin-bottom: 8px;
}

/* Map Container */
.map-container {
    width: 100%;
    height: 600px;
    background: #e9ecef;
    border-radius: 10px;
    margin: 40px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 1.2rem;
    position: relative;
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

.map-placeholder {
    text-align: center;
    padding: 40px;
}

.map-placeholder::before {
    content: '🗺️';
    display: block;
    font-size: 4rem;
    margin-bottom: 20px;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 40px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #1e3c72, #2a5298);
}

.timeline-item {
    margin-bottom: 50px;
    position: relative;
}

.timeline-content {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    width: 45%;
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
    margin-right: 55%;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 55%;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 20px;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: #2a5298;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 4px #2a5298;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.stat-box {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.stat-box:hover {
    transform: scale(1.05);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 60px 20px 30px;
    margin-top: 80px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.footer-header p {
    margin: 5px 0;
}

.footer-header strong {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

.footer-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.footer-section p {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin: 10px 0;
    padding-left: 20px;
    position: relative;
    line-height: 1.6;
    font-size: 0.95rem;
}

.footer-section ul li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #7e8ba3;
}

.footer-section strong {
    color: #7e8ba3;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    margin-top: 20px;
}

.footer-bottom p {
    margin: 5px 0;
}

/* Responsive Footer */
@media (max-width: 768px) {
    footer {
        padding: 40px 20px 20px;
    }

    .footer-sections {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-header strong {
        font-size: 1.2rem;
    }
}

/* Kelani River Basin Info Section */
.basin-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 40px;
    border-radius: 15px;
    margin: 60px 0 40px 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.basin-title {
    color: #1e3c72;
    font-size: 2rem;
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.basin-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: #2a5298;
}

.basin-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.basin-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.basin-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.fact-item {
    background: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.fact-item:hover {
    transform: translateY(-5px);
}

.fact-icon {
    font-size: 2rem;
}

.fact-label {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fact-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1e3c72;
}

.basin-highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.highlight-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s;
}

.highlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

.highlight-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 10px;
}

.highlight-card h4 {
    color: #1e3c72;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.highlight-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.basin-map-section {
    margin: 60px 0;
}

.map-section-title {
    color: #1e3c72;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 30px;
}

/* Hazard Analysis Layout */
.hazard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin: 40px 0;
}

.hazard-images {
    width: 100%;
}

.image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grid-image {
    width: 100%;
    height: 220px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transition: transform 0.3s, box-shadow 0.3s;
}

.grid-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
}

.grid-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hazard-text {
    padding-left: 20px;
}

.hazard-text p {
    text-align: left;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

/* Download Notification */
.download-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #28a745;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.download-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Map Header with Download Button */
.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.map-section-title {
    color: #1e3c72;
    font-size: 1.8rem;
    margin: 0;
}

.download-btn {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.3);
    transition: all 0.3s;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(30, 60, 114, 0.4);
    background: linear-gradient(135deg, #2a5298, #1e3c72);
}

.download-btn:active {
    transform: translateY(0);
}

.download-icon {
    font-size: 1.2rem;
}

.map-caption {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 0.95rem;
    font-style: italic;
}

/* Building Exposure Story Section */
.exposure-story {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    margin: 40px 0 0 0;
    padding: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
}

.story-images {
    width: 100%;
}

.story-text {
    padding-left: 20px;
}

.story-text p {
    text-align: left;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

.story-text strong {
    color: #1e3c72;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 968px) {
    .exposure-story {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 20px;
    }
    
    .story-text {
        padding-left: 0;
    }
}

/* Vulnerability Layout */
.vulnerability-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
    margin: 40px 0;
}

.vulnerability-text {
    padding-right: 20px;
}

.vulnerability-text p {
    text-align: left;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

.vulnerability-text strong {
    color: #1e3c72;
    font-weight: 600;
}

/* Vulnerability Factors */
.vulnerability-factors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.factor-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.factor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.factor-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.factor-card h3 {
    color: #1e3c72;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.factor-card p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Vulnerability Map Section */
.vulnerability-map-section {
    margin: 60px 0;
}

.map-image-container {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    background: white;
    padding: 20px;
}

.map-layout-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
}

/* Vulnerability Legend - Compact */
.vulnerability-legend {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 30px;
    border-radius: 15px;
    margin-top: 40px;
}

.legend-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    border: 2px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.legend-item.very-high .legend-color {
    background: #8B0000;
}

.legend-item.high .legend-color {
    background: #FF0000;
}

.legend-item.medium .legend-color {
    background: #FFA500;
}

.legend-item.low .legend-color {
    background: #FFFF00;
}

.legend-item.very-low .legend-color {
    background: #90EE90;
}

.legend-item span {
    color: #1e3c72;
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .legend-grid {
        gap: 20px;
    }
    
    .legend-color {
        width: 35px;
        height: 35px;
    }
    
    .legend-item span {
        font-size: 0.85rem;
    }
}


/* Map Loading Overlay */
.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 10px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e9ecef;
    border-top: 6px solid #1e3c72;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #1e3c72;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.loading-subtext {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
    opacity: 0.8;
}

/* Hide loading overlay when map is loaded */
.map-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Responsive */
@media (max-width: 968px) {
    .vulnerability-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .vulnerability-text {
        padding-right: 0;
    }
    
    .vulnerability-factors {
        grid-template-columns: 1fr;
    }
    
    .map-image-container {
        padding: 10px;
    }
    
    .legend-item {
        flex-direction: column;
        text-align: center;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .map-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .map-section-title {
        font-size: 1.5rem;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
}


/* Responsive */
@media (max-width: 968px) {
    .hazard-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .hazard-text {
        padding-left: 0;
    }
    
    .grid-image {
        height: 180px;
    }
}

/* Responsive */
@media (max-width: 968px) {
    .basin-content {
        grid-template-columns: 1fr;
    }
    
    .basin-highlights {
        grid-template-columns: 1fr;
    }
    
    .basin-facts {
        grid-template-columns: 1fr;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-content {
        width: calc(100% - 60px);
        margin-left: 60px !important;
    }

    .timeline-dot {
        left: 20px;
    }

    nav ul {
        gap: 15px;
    }

    .map-container {
        height: 400px;
    }

    .overview-content {
    grid-template-columns: 1fr;
    gap: 30px;
}

.overview-text {
    padding-right: 0;
}

.overview-image {
    min-height: 300px;
}
}