/* 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: 14px;
}

.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;
    }
}
/* Satellite Map Image Smoothing - Enable bilinear interpolation */
#satelliteMapView canvas,
#satelliteMapView .esri-view-surface canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: smooth;
    -ms-interpolation-mode: bicubic;
}

/* Date Input Container */
.date-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.date-input {
    padding: 12px 45px 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    width: 160px;
    height: 46px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.date-input:hover {
    border-color: #0066cc;
}

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

.calendar-icon-btn {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.calendar-icon-btn:hover {
    color: #0066cc;
}

/* Calendar Dropdown */
.calendar-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.calendar-nav-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 22px;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}

.calendar-nav-btn:hover {
    color: #0066cc;
}

.calendar-select {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    background: white;
}

.calendar-select:focus {
    outline: none;
    border-color: #0066cc;
}

.calendar-body {
    min-width: 280px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 5px;
}

.calendar-weekdays div {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    padding: 5px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    background: white;
}

.calendar-day:hover:not(.disabled):not(.out-of-range) {
    background-color: #f0f0f0;
}

.calendar-day.selected {
    background-color: #0066cc;
    color: white;
    font-weight: 600;
}

.calendar-day.today {
    border: 2px solid #0066cc;
}

.calendar-day.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.calendar-day.out-of-range {
    color: #ddd;
    cursor: not-allowed;
}

/* Play Button */
.play-button {
    padding: 12px 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: white;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 46px;
    width: 110px;
    margin: 0 50px;
}

.play-button:hover {
    border-color: #0066cc;
    color: #0066cc;
    background-color: #f5f9ff;
}

.play-button:active {
    transform: scale(0.98);
}

/* Day Navigation Buttons */
.day-nav-btn {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background-color: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    font-weight: bold;
    height: 46px;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-nav-btn:hover {
    border-color: #0066cc;
    color: #0066cc;
    background-color: #f5f9ff;
}

.day-nav-btn:active {
    transform: scale(0.98);
}

/* Speed Slider */
.speed-slider {
    width: 140px;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    transition: background 0.2s;
}

.speed-slider::-webkit-slider-thumb:hover {
    background: #0052a3;
}

.speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0066cc;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.speed-slider::-moz-range-thumb:hover {
    background: #0052a3;
}

/* MHW Statistics Display Styles */
.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.category-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.category-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
}

.category-count {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.events-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.events-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.events-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
}

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

.events-table tr:hover {
    background: #f8f9fa;
}

.event-category-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.event-category-1 {
    background: #fee8c8;
    color: #333;
}

.event-category-2 {
    background: #fdbb84;
    color: #333;
}

.event-category-3 {
    background: #fc8d59;
    color: white;
}

.event-category-4 {
    background: #d7301f;
    color: white;
}

/* Introductory Figure */
.intro-figure-inline {
    text-align: center;
    margin: 25px auto;
    max-width: 800px;
}

.intro-figure-inline .intro-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.intro-figure-inline .photo-credit {
    margin-top: 8px;
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.intro-figure-inline .photo-credit a {
    color: #0066cc;
    text-decoration: none;
}

.intro-figure-inline .photo-credit a:hover {
    text-decoration: underline;
}
