/* Marine Heatwaves Application Styles */
@import url('https://fonts.googleapis.com/css2?family=Proxima+Nova:wght@400;700&display=swap');

/* Select dropdown styling */
.select-container {
    display: flex;
    gap: 30px;
    margin: 20px 0;
    justify-content: center;
    flex-wrap: wrap;
}

.select-group {
    display: flex;
    flex-direction: column;
    min-width: 250px;
}

.select-label {
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.styled-select {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

.styled-select:hover {
    border-color: #0066cc;
}

.styled-select:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.styled-select:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Responsive design */
@media (max-width: 768px) {
    .select-container {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .select-group {
        width: 100%;
        max-width: 300px;
    }
}

/* Map container styles */
.map-container {
    display: flex;
    justify-content: center;
}

.map-instruction {
    text-align: center;
    color: #373b3b;
    font-style: italic;
}

#mapView {
    height: 800px;
    width: 95%;
    position: relative;
}

.coordinate-display {
    position: absolute;
    bottom: 25px;
    left: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    border: 1px solid #ccc;
    z-index: 1000;
}

.buoy-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    z-index: 1001;
    white-space: nowrap;
    transform: translate(-50%, -100%);
    margin-top: -10px;
}

.duration-legend {
    position: absolute;
    bottom: 25px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    font-size: 12px;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #2c3e50;
    text-align: center;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

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

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid white;
}

.legend-color.red {
    background-color: #e74c3c;
}

.legend-color.yellow {
    background-color: #f39c12;
}

.legend-color.green {
    background-color: #27ae60;
}

.legend-text {
    color: #333;
    font-size: 11px;
}

body {
    font-family: 'Proxima Nova', Arial, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.controls {
    margin: 20px 0;
    text-align: center;
}
#mhwPlot {
    width: 100%;
    height: 400px;
    margin-top: 20px;
}
#fullTimeSeriesPlot {
    width: 100%;
    height: 500px;
    margin-top: 20px;
}
#monthlyMhwPlot {
    width: 100%;
    height: 400px;
    margin-top: 20px;
}
/* Ranking section titles */
.ranking-section-title {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    margin: 30px 0 10px 0;
    text-align: left;
}

.ranking-divider {
    border: none;
    border-top: 2px solid #000000;
    margin: 10px 0 0 0;
}

/* Ranking plots - unified styling */
#warmestMhwPlot,
#detrendWarmestMhwPlot,
#longestMhwPlot,
#detrendLongestMhwPlot,
#strongestMhwPlot,
#detrendStrongestMhwPlot {
    width: 100%;
    margin-top: 20px;
}
#detrendMonthlyMhwPlot {
    width: 100%;
    height: 400px;
    margin-top: 20px;
}
.plot-row {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}
.plot-column {
    flex: 1;
}
.loading {
    text-align: center;
    margin: 50px 0;
    color: #7f8c8d;
}
.plot-section {
    margin: 20px 0;
}
.plot-title {
    color: #2c3e50;
    font-size: 16px;
    font-weight: bold;
    margin: 20px 0 10px 0;
}
.analysis-section {
    margin: 30px 0 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}
.section-header {
    color: #2c3e50;
    font-size: 24px;
    margin: 0 0 10px 0;
    font-weight: 600;
}
.section-description {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* Overview Section */
.overview-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding-top: 70px;
}

/* Tracking Marine Heatwaves Section */
.mhw-tracking {
    background-color: #f8f9fa;
    padding: 50px 0;
}

.tracking-content {
    max-width: 800px;
    margin: 0 auto;
}

.tracking-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #333;
}

/* Tabbed Section */
.tabbed-section {
    background-color: white;
    padding: 50px 0;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-title {
    font-size: 2.2rem;
    color: #003366;
    text-align: center;
    margin-bottom: 30px;
    font-weight: bold;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e0e0e0;
}

.tab-button {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-family: 'Proxima Nova', sans-serif;
}

.tab-button:hover {
    color: #1e40af;
    background-color: #f8f9fa;
}

.tab-button.active {
    color: #1e40af;
    border-bottom-color: #1e40af;
    background-color: #f8f9fa;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Reports Tab with Bootstrap */
.reports-intro {
    margin-bottom: 20px;
    margin-left: 70px;
}

.reports-intro p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: #333;
}

.reports-instructions {
    margin: 20px 0 0 0;
    padding-left: 20px;
}

.reports-instructions li {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #555;
}

.reports-instructions a {
    color: #1e40af;
    text-decoration: none;
    font-weight: 600;
}

.reports-instructions a:hover {
    text-decoration: underline;
}

/* Overview Image Styling */
.overview-img {
    max-width: none !important;
    width: 400px !important;
    height: auto !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

.overview-img:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    transform: translateY(-3px);
}

/* Report Items */
.report-item {
    transition: transform 0.3s ease;
    position: relative;
    text-align: center;
    margin-bottom: 70px;
}

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

.report-item a {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.report-item img {
    width: 100%;
    max-width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.report-item:hover img {
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.report-item h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: #333;
    line-height: 1.3;
    text-align: center;
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
}

/* Remove extra row spacing since we want space between text and next row images */
.container-fluid .row {
    margin-bottom: 0;
}





/* Calculations Tab */
.calculation-container {
    margin-top: 20px;
}

/* News Tab */
.news-content {
    max-width: 800px;
    margin: 0 auto;
}




.news-item {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}


/* Info link styling */
.info-link {
    font-size: 16px;
    color: #3498db;
    cursor: pointer;
    margin-left: 15px;
    font-weight: 600;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}

.info-link:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Data download link styling */
.data-download-link {
    font-size: 16px;
    color: -webkit-link;
    text-decoration: underline;
    display: inline-block;
    margin-top: 10px;
    cursor: pointer;
}

.data-download-link:hover {
    color: -webkit-link;
}

.info-icon {
    width: 22px;
    height: 22px;
    display: inline-block;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #ffffff;
    margin: 4% auto 0;
    padding: 30px;
    border-radius: 12px;
    width: 900px;
    max-width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    position: relative;
}

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

.modal-close {
    color: #aaa;
    float: right;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: #000;
}

#modalTitle {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
}

#modalBody {
    color: #333;
    line-height: 1.8;
    font-size: 15px;
}

#modalBody h3 {
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
}

#modalBody p {
    margin-bottom: 15px;
}

#modalBody ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

#modalBody li {
    margin-bottom: 8px;
}

#modalBody a {
    color: #3498db;
    text-decoration: none;
}

#modalBody a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
    }

    .tracking-content p,
    .reports-intro p {
        font-size: 1rem;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }

    .info-link {
        display: block;
        margin-left: 0;
        margin-top: 10px;
        font-size: 13px;
    }

    /* Tab Navigation Responsive */
    .tab-navigation {
        flex-direction: column;
        align-items: center;
    }

    .tab-button {
        width: 100%;
        max-width: 300px;
        margin-bottom: 5px;
        padding: 12px 20px;
        font-size: 1rem;
    }
}