@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(to right, #6dd5ed, #2193b0);
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
}

#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#loader-overlay.visible {
    display: flex;
}

.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#weather-alerts {
    width: 95%;
    max-width: 1400px;
    margin-bottom: 20px;
}

.weather-alert {
    background-color: #ffc107;
    color: #333;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.weather-alert h3 {
    margin-top: 0;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.boat-icon {
    width: 60px;
    height: 60px;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.2));
    color: #fff;
}

#location-container {
    margin-bottom: 20px;
    text-align: center;
}

#location-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

#location-input {
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1em;
    width: 300px;
}

#location-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#location-form button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background-color: #fff;
    color: #005f73;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

#location-form button:hover {
    background-color: #f0f8ff;
    color: #003459;
}

#current-location {
    font-size: 1.1em;
    font-weight: 300;
    opacity: 0.9;
}

h1 {
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

#weather-forecast {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 20px;
    width: 95%;
    max-width: 1400px;
    margin-top: 20px;
}

.day-forecast {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
    display: flex;
    flex-direction: column;
}

.day-forecast:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-10px);
}

.day-forecast.selected {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.day-forecast h2 {
    margin: 0 0 15px 0;
    font-size: 1.5em;
    font-weight: 600;
}

.day-forecast img {
    width: 70px;
    height: 70px;
    margin-bottom: 15px;
}

.day-forecast .temp {
    font-size: 1.2em;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.day-forecast .temp .max {
    font-weight: 700;
}

.sunrise-sunset {
    font-size: 0.9em;
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
    opacity: 0.9;
}

.sunrise-sunset div {
    display: flex;
    align-items: center;
    gap: 8px;
}

#hourly-forecast-container {
    margin-top: 30px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    width: 95%;
    max-width: 1400px;
}

#hourly-forecast-day {
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: center;
}

#hourly-forecast-details {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#hourly-forecast-details::-webkit-scrollbar {
    display: none;
}

.hourly-item {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    flex: 0 0 140px;
    background: rgba(255, 255, 255, 0.25);
    transition: background-color 0.3s;
}

.hourly-item:hover {
    background: rgba(255, 255, 255, 0.4);
}

.hourly-item .time {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.hourly-item div {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.boating-day {
    font-size: 1em;
    font-weight: 600;
    margin-top: 15px;
}

.boating-day .yes {
    color: #28a745;
    font-weight: 700;
}

.boating-day .no {
    color: #dc3545;
    font-weight: 700;
}

.boating-day div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.weather-description {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
    font-style: italic;
    opacity: 0.9;
    flex-grow: 1;
}

.tide-disclaimer {
    font-size: 0.9em;
    text-align: center;
    margin-top: 20px;
    font-style: italic;
    opacity: 0.8;
}

#charts-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chart-container {
    height: 250px;
    position: relative;
}

#radar-map-container {
    width: 95%;
    max-width: 1400px;
    margin-top: 30px;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Settings Icon and Modal Styles */
.settings-icon {
    width: 30px;
    height: 30px;
    cursor: pointer;
    transition: transform 0.3s;
}

.settings-icon:hover {
    transform: rotate(45deg);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #2193b0;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    border-radius: 15px;
    width: 80%;
    max-width: 500px;
    color: #fff;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

#thresholds-form .form-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

#thresholds-form label {
    margin-bottom: 5px;
}

#thresholds-form input {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background-color: rgba(255, 255, 255, 0.9);
    color: #333;
}

#thresholds-form button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background-color: #fff;
    color: #005f73;
    cursor: pointer;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    .title-container {
        gap: 10px;
    }

    .boat-icon {
        width: 40px;
        height: 40px;
    }

    #location-container {
        width: 100%;
    }

    #location-form {
        flex-direction: column;
        width: 90%;
        margin: 0 auto 10px auto;
    }

    #location-input {
        width: 100%;
        box-sizing: border-box;
    }

    #weather-forecast {
        display: flex;
        overflow-x: auto;
        width: 100%;
        gap: 10px;
        padding-bottom: 10px;
        -ms-overflow-style: none;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
    }

    #weather-forecast::-webkit-scrollbar {
        display: none;
    }

    #hourly-forecast-container,
    #radar-map-container {
        width: 100%;
        box-sizing: border-box;
    }

    .day-forecast {
        flex: 0 0 140px;
        padding: 15px;
        scroll-snap-align: start;
    }

    .day-forecast h2 {
        font-size: 1.2em;
    }

    .day-forecast .temp {
        font-size: 1em;
    }

    .hourly-item {
        flex: 0 0 110px;
        padding: 15px;
    }
}