/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --secondary-color: #06b6d4;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 3rem 0;
    text-align: center;
    position: static;
    top: auto;
    z-index: 100;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.logo-section {
    margin-bottom: 1.5rem;
}

.logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.4);
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.repo-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.repo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(79, 70, 229, 0.2);
    border: 1px solid rgba(79, 70, 229, 0.4);
    padding: 0.6rem 1.5rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    color: #a5b4fc;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 150px;
}

.repo-link:hover {
    background: rgba(79, 70, 229, 0.4);
    border-color: rgba(79, 70, 229, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.repo-link i {
    font-size: 1.1rem;
}

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

section {
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
}

.section-title i {
    color: var(--primary-color);
}

.section-description {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* Teaser Section */
.teaser-section {
    text-align: center;
    margin-bottom: 3rem;
}

.teaser-image {
    max-width: var(--teaser-max-width, 100%);
    border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.teaser-image:hover {
    transform: scale(1.02);
}

/* Abstract Section */
.abstract-section {
    background: rgba(30, 41, 59, 0.6);
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Teaser figure + caption */
.teaser-figure {
    margin: 0 auto;
    max-width: var(--teaser-max-width, 100%);
}

.teaser-caption {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: left;
}

.abstract-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.05rem;
    text-align: justify;
}

.abstract-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.abstract-content strong.highlight-result {
    color: #ef4444;
    font-weight: 700;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(30, 41, 59, 0.6);
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-1);
}

.stat-card:nth-child(2)::before {
    background: var(--gradient-2);
}

.stat-card:nth-child(3)::before {
    background: var(--gradient-3);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(79, 70, 229, 0.3);
}

.stat-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Dimensions Container */
.dimensions-container {
    margin-top: 2rem;
}

.dimension-card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dimension-card:hover {
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
}

.dimension-header {
    padding: 1.5rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(51, 65, 85, 0.4);
    transition: all 0.3s ease;
}

.dimension-header:hover {
    background: rgba(79, 70, 229, 0.2);
}

.dimension-title-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.dimension-icon {
    width: 50px;
    height: 50px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--gradient-1);
}

.dimension-name {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dimension-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: auto;
    margin-right: 1rem;
}

.dimension-toggle {
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.dimension-header.active .dimension-toggle {
    transform: rotate(180deg);
}

.dimension-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.dimension-content.active {
    max-height: 10000px;
}

/* Sub-type Section */
.subtype-card {
    border-top: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.4);
}

.subtype-header {
    padding: 1.2rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.subtype-header:hover {
    background: rgba(79, 70, 229, 0.1);
}

.subtype-name {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subtype-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.subtype-toggle {
    color: var(--secondary-color);
    transition: transform 0.3s ease;
}

.subtype-header.active .subtype-toggle {
    transform: rotate(180deg);
}

.subtype-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.subtype-content.active {
    max-height: 5000px;
}

/* Sample Card */
.sample-card {
    padding: 2rem;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    background: rgba(30, 41, 59, 0.3);
}

.sample-card:last-child {
    border-bottom: none;
}

.sample-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sample-index {
    background: var(--gradient-1);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.sample-title {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Audio Section */
.audio-section {
    margin-bottom: 1.5rem;
}

.audio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.audio-player-wrapper {
    background: rgba(51, 65, 85, 0.4);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.8rem;
}

audio {
    width: 100%;
    height: 40px;
    border-radius: 0.5rem;
    outline: none;
}

audio::-webkit-media-controls-panel {
    background: rgba(79, 70, 229, 0.2);
}

.text-content {
    background: rgba(15, 23, 42, 0.6);
    padding: 1rem 1.2rem;
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    font-style: italic;
}

.instruction-text {
    border-left-color: var(--secondary-color);
}

.response-text {
    border-left-color: var(--success-color);
}

/* Style Description */
.style-description {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    color: #fbbf24;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: rgba(30, 41, 59, 0.8);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid rgba(79, 70, 229, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

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

    .section-title {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .dimension-header,
    .subtype-header,
    .sample-card {
        padding: 1rem;
    }

    .dimension-name {
        font-size: 1.1rem;
    }

    .container {
        padding: 0 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Style */
::selection {
    background: rgba(79, 70, 229, 0.4);
    color: white;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6366f1;
}

/* Comparison Table */
.comparison-table-wrapper {
    overflow-x: auto;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.comparison-table thead {
    background: rgba(79, 70, 229, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison-table th {
    padding: 1.2rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--primary-color);
    white-space: nowrap;
}

.comparison-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.comparison-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.1);
}

.comparison-table tbody tr:last-child {
    border-bottom: none;
}

.comparison-table td {
    padding: 1.5rem 1rem;
    color: var(--text-secondary);
    vertical-align: top;
}

.dimension-cell {
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
    background: rgba(79, 70, 229, 0.15);
    border-right: 3px solid var(--primary-color);
    vertical-align: middle;
    text-align: center;
    font-size: 1rem;
    min-width: 100px;
    max-width: 120px;
    padding: 1.5rem 0.6rem;
}

.subdimension-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(79, 70, 229, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    color: #a5b4fc;
    font-weight: 500;
    text-transform: capitalize;
    font-size: 0.9rem;
}

/* Sub-dimension column width */
.comparison-table td:nth-child(2) {
    min-width: 130px;
    max-width: 150px;
    padding: 1.5rem 0.6rem;
}

.audio-query-cell {
    min-width: 220px;
    width: auto;
}

.query-audio-wrapper {
    background: rgba(51, 65, 85, 0.4);
    padding: 0.8rem;
    border-radius: 0.5rem;
    position: relative;
    cursor: help;
    transition: all 0.3s ease;
}

.query-audio-wrapper:hover {
    background: rgba(51, 65, 85, 0.6);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.query-audio-wrapper audio {
    width: 100%;
    height: 35px;
}

/* Tooltip styles - default position (top) */
.query-audio-wrapper[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-secondary);
    padding: 1rem 1.2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--secondary-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    font-size: 0.85rem;
    line-height: 1.6;
    font-style: italic;
    white-space: normal;
    max-width: 400px;
    min-width: 250px;
    width: max-content;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.query-audio-wrapper[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 6px solid transparent;
    border-top-color: var(--secondary-color);
    opacity: 0;
    pointer-events: none;
    z-index: 1001;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.query-audio-wrapper[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

.query-audio-wrapper[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px);
}

/* Tooltip bottom position (for top rows) */
.query-audio-wrapper[data-tooltip].tooltip-bottom::before {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(8px);
}

.query-audio-wrapper[data-tooltip].tooltip-bottom::after {
    bottom: auto;
    top: 100%;
    transform: translateX(-50%) translateY(2px);
    border-top-color: transparent;
    border-bottom-color: var(--secondary-color);
}

.query-audio-wrapper[data-tooltip].tooltip-bottom:hover::before {
    transform: translateX(-50%) translateY(12px);
}

.query-audio-wrapper[data-tooltip].tooltip-bottom:hover::after {
    transform: translateX(-50%) translateY(6px);
}

.model-output-cell {
    min-width: 220px;
    width: auto;
}

.model-audio-wrapper {
    background: rgba(51, 65, 85, 0.4);
    padding: 0.8rem;
    border-radius: 0.5rem;
}

.model-audio-wrapper audio {
    width: 100%;
    height: 35px;
}

.base-model-badge {
    display: inline-block;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.2rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sft-model-badge {
    display: inline-block;
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    padding: 0.2rem 0.6rem;
    border-radius: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Responsive Table */
@media (max-width: 1200px) {
    .comparison-table {
        font-size: 0.85rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 1rem 0.6rem;
    }
    
    .dimension-cell {
        font-size: 0.9rem;
        min-width: 90px;
        max-width: 110px;
        padding: 1rem 0.5rem;
    }
    
    .comparison-table td:nth-child(2) {
        min-width: 120px;
        max-width: 140px;
        padding: 1rem 0.5rem;
    }
    
    .subdimension-cell {
        font-size: 0.85rem;
        gap: 0.25rem;
        padding: 0.25rem 0.5rem;
    }
    
    .audio-query-cell,
    .model-output-cell {
        min-width: 190px;
    }
    
    /* Adjust tooltip for smaller screens */
    .query-audio-wrapper[data-tooltip]::before {
        max-width: 300px;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .comparison-table-wrapper {
        border-radius: 0.5rem;
    }
    
    .comparison-table {
        font-size: 0.8rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.8rem 0.4rem;
    }
    
    .dimension-cell {
        font-size: 0.85rem;
        min-width: 80px;
        max-width: 100px;
        padding: 0.8rem 0.4rem;
    }
    
    .comparison-table td:nth-child(2) {
        min-width: 110px;
        max-width: 130px;
        padding: 0.8rem 0.4rem;
    }
    
    .subdimension-cell {
        font-size: 0.8rem;
        gap: 0.2rem;
        padding: 0.2rem 0.4rem;
    }
    
    .audio-query-cell,
    .model-output-cell {
        min-width: 160px;
    }
    
    /* Adjust tooltip for mobile */
    .query-audio-wrapper[data-tooltip]::before {
        max-width: 250px;
        min-width: 180px;
        font-size: 0.8rem;
        padding: 0.8rem 1rem;
    }
    
    /* Bottom tooltip adjustments for mobile */
    .query-audio-wrapper[data-tooltip].tooltip-bottom::before {
        max-width: 250px;
        min-width: 180px;
    }
}
