body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    color: #333;
    margin: 0 0 10px 0;
}

header p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.paper-download-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2c6ecb;
    color: white;
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.paper-download-btn:hover {
    background-color: #1f52a0;
}


#plots-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.plot-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.subsection-title {
    font-size: 20px;
    font-weight: bold;
    color: #555;
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.plots-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
}

.component-grid-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.grid-legend {
    width: 100%;
}

.plots-grid.component-grid {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    row-gap: 20px !important;
    column-gap: 10px !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
}

.component-plot-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.component-plot-container {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    width: fit-content;
    margin: 0 auto;
}

.y-axis-label {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-align: center;
    white-space: nowrap;
    padding-right: 3px;
    align-self: center;
    margin-top: -8px;
}

.plot-with-x-label {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.x-axis-label {
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-align: center;
    margin-top: 3px;
}

.plot-wrapper {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.plot-wrapper h2 {
    margin-top: 0;
    color: #333;
    text-align: center;
}

.legend-toggle-btn {
    display: block;
    margin: 10px auto;
    padding: 8px 16px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.legend-toggle-btn:hover {
    background: #1976D2;
}

.toggle-icon {
    display: inline-block;
    font-size: 12px;
    margin-right: 4px;
}

.plot-legend {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.plot-legend.visible {
    max-height: 500px;
    opacity: 1;
    padding: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 14px;
    color: #333;
    min-height: 36px;
}

.legend-symbol {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    flex-shrink: 0;
}

.legend-circle {
    border-radius: 50%;
}

.legend-cross {
    width: 36px;
    height: 36px;
    margin-left: -8px;
}

.legend-line {
    display: inline-block;
    width: 20px;
    height: 2px;
    background: black;
    margin-right: 10px;
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
}

.legend-multi-column {
    column-count: 3;
    column-gap: 20px;
}

.legend-multi-column .legend-item {
    break-inside: avoid;
}

.plot-iframe {
    width: 100%;
    height: 630px;
    border: none;
    border-radius: 4px;
}

.component-iframe {
    width: 300px;
    height: 300px;
    overflow: hidden;
}

.clickable-point {
    cursor: pointer;
}

.clickable-point:hover {
    opacity: 0.8;
}

#hover-tooltip {
    position: fixed;
    display: none;
    background-color: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 95vw;
    pointer-events: auto;
}

#tooltip-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 10001;
}

#tooltip-close-btn:hover {
    background: #d32f2f;
}

#hover-tooltip.visible {
    display: block;
}

#hover-tooltip h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    text-align: center;
}

.tooltip-audio-player {
    margin: 10px 0;
    text-align: center;
}

.tooltip-audio-player audio {
    width: 100%;
    max-width: 400px;
    outline: none;
}

.tooltip-images {
    display: block;
    width: 100%;
}

#response-maps-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 10px;
}

.tooltip-image-container {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
}

.tooltip-image-container h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.tooltip-image-container img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

@media (max-width: 768px) {
    #plots-container {
        grid-template-columns: 1fr;
    }

    .plot-wrapper {
        padding: 15px;
    }

    .plot-iframe {
        height: 400px;
    }

    #hover-tooltip {
        max-width: 90vw;
        max-height: 90vh;
        overflow-y: auto;
    }

    .tooltip-images {
        flex-direction: column;
    }
}

/* Sound Browser Section */
.sound-browser-section {
    background-color: white;
    padding: 30px;
    margin-bottom: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sound-browser-section .section-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
}

.sound-browser-section .section-description {
    color: #666;
    margin: 10px 0 20px 0;
    font-size: 15px;
}

.sound-browser-container {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.sound-selector {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sound-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.sound-selector-header label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.toggle-btn {
    padding: 6px 12px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.toggle-btn:hover {
    background-color: #357abd;
}

.selected-sounds-summary {
    background-color: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
}

.selected-sounds-summary.empty {
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 13px;
}

.sound-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #4a90e2;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.sound-tag-remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.sound-tag-remove:hover {
    opacity: 1;
}

.sound-checkbox-container {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    column-count: 3;
    column-gap: 15px;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.sound-checkbox-container.collapsed {
    max-height: 0;
    padding: 0 15px;
    overflow: hidden;
    border-width: 0;
}

.sound-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    break-inside: avoid;
    page-break-inside: avoid;
}

.sound-checkbox-item input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sound-checkbox-item label {
    cursor: pointer;
    font-size: 13px;
    color: #333;
    user-select: none;
    flex: 1;
}

.sound-checkbox-item:hover {
    background-color: #f5f5f5;
}

.selected-sounds-display {
    flex: 1;
    min-width: 0;
}

#selected-sounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.sound-card {
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.sound-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    border-color: #4a90e2;
}

.sound-card-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    word-break: break-word;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
}

.sound-card-audio {
    width: 100%;
}

.sound-card-audio audio {
    width: 100%;
    height: 35px;
}

.sound-card-cochleagram {
    width: 100%;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.sound-card-cochleagram img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

@media (max-width: 1024px) {
    .sound-browser-container {
        flex-direction: column;
    }

    .sound-selector {
        flex: 1 1 auto;
        width: 100%;
    }

    .sound-checkbox-container {
        column-count: 2;
    }

    #selected-sounds-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 640px) {
    .sound-checkbox-container {
        column-count: 1;
    }

    #selected-sounds-grid {
        grid-template-columns: 1fr;
    }
}