.centered {
    text-align: center;

}
* {
    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: linear-gradient(135deg, #a9bfdd 0%, #b8cce2 100%);
    min-height: 100vh;
}

.container {
    max-width: 98%;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}


/* Navigation */
nav {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

nav a {
    color: white;
    text-decoration: none;
    margin-right: 2rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

nav a.active {
    color: #0c0901;;
    background-color: rgba(255, 255, 255, 0.829); /* When clicked / active */
    transform: none;
}
/* Header */
/* header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    background-image: url('/static/oldmandam.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-blend-mode: overlay;
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
} */

header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(52, 152, 219, 0.3);
    z-index: 1;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    position: relative;
    z-index: 2;
}

header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

/* Main Content */
.main-content {
    padding: 2rem;
}

.page-title {
    text-align: center;
    color: #2c3e50;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    position: relative;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 2px;
}

/* Buttons */
button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

button:hover {
    background: linear-gradient(135deg, #2980b9, #1f618d);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* historical forecast */
/* Chart Section */
.chart-section {
    background: white;
    border-radius: 15px;
    padding: 1rem 1rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin: 1rem auto;
    max-width: 95vw;
    width: 90%;
    border-top: 4px solid #3498db;
    overflow-x: hidden;
}

.chart-container {
    display: flex;
    text-align: center;
    flex-direction: column;
    justify-content: center; /* center horizontally */
    align-items: flex-start; /* top align inside container */
    margin: 1rem auto; /* vertical margin */
    width: 100%;
    padding: 0.5rem 0;
    overflow-x: auto; /* Add scroll if absolutely necessary */
}

.chart-wrapper-forecast {
    position: relative;
    width: 100%;
    max-width: 95vw; /* still limits width on very large monitors */
    /* min-width: 1500px; */
    margin: 0 auto; 
    height: 600px;
}

#pastChart {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: block;
    width: 95%;
    height: auto;
    max-height: 600px;
    margin: 0 auto; 
}

#model-selector { 
    color: #000;
    font-weight: bold;
    display: flex;
    justify-content: center;  /* center horizontally */
    align-items: center;      /* align vertically */
    flex-wrap: wrap;
    width: 100%;              /* take full width of chart container */
    margin-top: 1rem;
    gap: 10px;                /* spacing between checkboxes */
    text-align: center;       /* extra safeguard for inline elements */
}


/* forecast specific page css */
.chart-section-forecast {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: flex-start;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin: 1rem auto;
    max-width: 95%;
    border-top: 4px solid #3498db;
}

.chart-container-forecast {
    flex: 1 1 400px; /* Grow/shrink but at least 400px wide */
    display: flex;
    justify-content: center;
}

.chart-wrapper,
#forecastsummary {
    flex: 1 1 48%; /* % width each, nearly half of container */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
}

.chart-title,
.table-title {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 1rem;
    width: 100%;
}

#forecastChart {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    /* margin: 2rem 0;  */
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}


/* Tables */
table {
    border: none;
    border-collapse: collapse;
    width: 90%;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

th, td {
    border: none;
    border-bottom: 1px solid #ecf0f1;
    padding: 15px;
    text-align: left;
}

th {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    background: white;
    transition: background-color 0.3s ease;
}

tr:hover td {
    background-color: #f8f9fa;
}

tr:last-child td {
    border-bottom: none;
}

/* Content Sections */
.content-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    margin: 2rem 0;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.content-section h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.content-section h3 {
    color: #34495e;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.content-section p {
    margin-bottom: 1rem;
    color: #555;
}

.content-section ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.content-section li {
    margin-bottom: 0.5rem;
    color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chart-section-forecast {
        flex-direction: column;
        align-items: center;
    }

    .chart-container-forecast {
        width: 100%;
    }
    
    .chart-wrapper-forecast {
        width: 95%;   /* almost full width on small screens */
        height: 350px;
    }

    #pastChart {
        max-height: 400px;  /* smaller height on mobile */
    }

    .chart-section {
        width: 100%;
        max-width: 100%;
        max-height: 400px;
        padding: 1rem;
    }

    #forecastChart {
        max-width: 100%;  /* Allow full width on small screens */
        height: auto;
    }
   
    .chart-wrapper,
    #forecastsummary {
        width: 100%;
        margin-top: 1rem;
        overflow-x: auto;
    }
    nav a {
        display: block;
        margin: 0.5rem 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    canvas {
        margin: 0;
    }
    
    table {
        width: 100%;
        font-size: 14px;
    }
    
    th, td {
        padding: 10px 8px;
    }
}

  .forecast-btn {
    padding: 8px 12px;
    margin-bottom: 8px;
    border: none;
    background-color: #eee;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
  }

  .forecast-btn.active {
    background-color: #1d4ed8;
    color: white;
    border-color: #041a61;            /* darker blue border */
    box-shadow: 0 0 0 2px rgba(2, 8, 100, 0.35);
  }

  .forecast-btn:hover {
    background-color: #d4d4d4;
  }

    footer {
    margin-top: 2rem;
    padding: 1rem;
    text-align: center;
    background-color: #f0f0f0;
    font-size: 0.9rem;
    color: #555;
    border-top: 1px solid #ddd;
}


/* Home page styles */
        .home-container {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            max-width: 1300px;
            min-height: 55vh;
            margin: 2rem auto;
            padding: 2rem;
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
        }

        /* Left Section */
        .home-left {
            flex: 1;
            max-width: 50%;
        }

        .home-left h1 {
            font-size: 2.2rem;
            color: #2c3e50;
            margin-bottom: 1rem;
        }

        .home-left h2 {
            font-size: 1.1rem;
            color: #333;
            margin-bottom: 1.8rem;
            font-weight: normal;
        }

        /* Fancy "See Forecast →" link style */
        .see-forecast {
            display: inline-flex;
            align-items: center;
            font-weight: bold;
            color: #1d4ed8;
            font-size: 1.1rem;
            text-decoration: none;
            margin-right: 2rem;
            transition: transform 0.2s ease, color 0.3s ease;
        }

        .see-forecast:hover {
            color: #153eaf;
            transform: translateX(4px);
        }

        .see-forecast span {
            margin-left: 6px;
            font-size: 1.3rem;
            transition: transform 0.3s ease;
        }

        .see-forecast:hover span {
            transform: translateX(3px);
        }

        /* About teaser */
        .about-teaser {
            margin-top: 2rem;
            font-size: 1rem;
            color: #444;
            max-width: 450px;
        }

        .about-teaser button {
            margin-top: 1rem;
            background: linear-gradient(135deg, #48cae4, #0096c7);
            padding: 10px 16px;
            border-radius: 8px;
        }

        /* Right Section (Image) */
        .home-right {
            flex: 1;
            max-width: 50%;
            position: relative;
        }

        .home-right img {
            width: 100%;
            height: auto;
            object-fit: cover;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            mask-image: linear-gradient(to left, black 80%, transparent);
            -webkit-mask-image: linear-gradient(to left, black 80%, transparent);
        }

        .dam-subtitle {
            font-size: 1.0rem;
            color: #2c3e50;
            margin-bottom: 1rem;
        }
        
        /* Responsive layout */
        @media (max-width: 900px) {
            .home-container {
                flex-direction: column;
                text-align: center;
                padding: 1rem;
            }
            .home-left, .home-right {
                max-width: 100%;
            }
            .home-right::after {
                display: none;
            }
            .see-forecast {
                display: block;
                margin: 1rem auto;
            }
            .chart-wrapper-forecast {
                width: 100%;
                max-width: 100%;
            }
            #pastChart {
                max-height: 400px; /* smaller height on mobile */
            }
        }