/* css/styles.css */
body {
    /* font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; */
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', monospace;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #FAFAFA;
    color: #333;
    line-height: 1.6;
    scroll-behavior: smooth;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

/* Header Styles */
.page-header {
    text-align: center;
    padding: 30px 20px 20px 20px;
    background: #f0f0f0;
    border-bottom: 1px solid #d5d5d5;
    margin-bottom: 30px;
}

.page-header h1 {
    margin: 0 0 15px 0;
    font-size: 2.5em;
    color: #2c3e50;
    font-weight: 700;
}

.language-info {
    margin-bottom: 10px;
}

.language-classification {
    font-size: 1.1em;
    color: #34495e;
    margin: 0 0 5px 0;
    font-weight: 500;
}

.project-description {
    font-size: 1em;
    color: #7f8c8d;
    margin: 0;
    font-style: italic;
}

.author-info {
    padding-top: 15px;
    border-top: 1px solid #bdc3c7;
}

.author-info p {
    margin: 0;
    color: #34495e;
    font-size: 0.95em;
}

/* Navigation styles */
.navigation {
    background: none;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.navigation a {
    margin: 0 10px;
    color: #2980b9;
    text-decoration: none;
}

.navigation a:hover {
    text-decoration: underline;
}

/* Section divider styles */
.section-divider {
    margin: 40px 0;
    padding: 10px;
    background: #f0f0f0;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
}

/* Example container styles */
.example {
    border: 1px solid #DDD;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    background-color: #FFF;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Highlight targeted example */
.example:target {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    background-color: #f8f9ff;
}

.example h3 {
    margin-top: 0;
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Linguistic gloss container */
.gloss-container {
    margin: 20px 0;
    background-color: #F8F9FA;
    padding: 20px;
    border-radius: 0 4px 4px 0;
    overflow-x: auto;
    /* border-left: 4px solid #3498db; */
}

/* Three-line gloss format */
.gloss-line {
    display: flex;
    flex-wrap: wrap;
    gap: 1em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', monospace;
    font-size: 0.95em; /* Explicit font size for consistency */
    line-height: 1.4;
    margin-bottom: 0px; /* Consistent spacing between lines */
}

/* Remove bottom margin from the last line */
/* .gloss-line:last-child {
    margin-bottom: 0;
} */

/* Each aligned word/gloss pair */
.gloss-word-group {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    white-space: nowrap;
    gap: 2px; /* Small consistent gap between morpheme and gloss within each group */
}

/* Source language line (morphemes) */
.gloss-morpheme {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', sans-serif;
    /* font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', monospace; */
    font-size: 0.95em; /* Explicit font size */
    font-weight: normal; /* Explicit font weight */
    font-style: normal; /* Explicit font style */
    color: #2c3e50;
    margin: 0; /* Remove any default margins */
    padding: 0; /* Remove any default padding */
    line-height: 1.4; /* Consistent line height */
    margin-bottom: 2px;
}

/* Morphological glosses line */
.gloss-gloss {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', sans-serif;
    /* font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', monospace; */
    font-size: 0.95em; /* Same font size as morphemes */
    font-weight: normal; /* Same font weight as morphemes */
    font-style: normal; /* Same font style as morphemes */
    color: #2c3e50;
    margin: 0; /* Remove any default margins */
    padding: 0; /* Remove any default padding */
    line-height: 1.4; /* Consistent line height */
    margin-bottom: 2px;
}

/* Translation line */
.gloss-translation {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', sans-serif;
    /* font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', monospace; */
    font-size: 0.95em; /* Same font size as other lines */
    font-weight: normal; /* Same font weight as other lines */
    font-style: normal; /* Normal style, not italic */
    color: #34495e;
    margin: 0; /* Remove any default margins */
    padding: 0; /* Remove any default padding */
    line-height: 1.4; /* Consistent line height */
}

/* Add quotation marks to translation */
.gloss-translation:before {
    content: "'";
}

.gloss-translation:after {
    content: "'";
}

/* Fallback for simple pre-formatted glosses */
.gloss {
    margin: 15px 0;
    background-color: #F8F9FA;
    padding: 15px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', sans-serif;
    /* font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', 'DejaVu Sans Mono', 'Noto Sans Mono', 'Liberation Mono', 'Consolas', monospace; */
    white-space: pre-wrap;
    /* border-left: 4px solid #5E7982; */
    font-size: 0.95em;
    border-radius: 0 4px 4px 0;
}

/* Native HTML5 audio player */
audio {
    display: block;
    width: 100%;
    margin: 15px 0;
    border-radius: 4px;
}

/* WaveSurfer waveform container */
.waveform-container {
    border: 1px solid #BDC3C7;
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

/* Hover plugin styling for all examples */
[id^="waveform"] ::part(hover-label):before {
    content: '⏱️ ';
}

/* Footer Styles */
.page-footer {
    margin-top: 50px;
    background-color: #f8f9fa;
    border-top: 2px solid #e9ecef;
    padding: 40px 20px 30px 20px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}

.footer-content h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
    display: inline-block;
}

.footer-content p {
    margin: 8px 0;
    color: #34495e;
    font-size: 0.9em;
    line-height: 1.5;
}

.footer-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-content li {
    margin: 8px 0;
}

.footer-content a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s ease;
}

.footer-content a:hover {
    color: #2980b9;
    text-decoration: underline;
}

.footer-content a[target="_blank"]:after {
    content: " ↗";
    font-size: 0.8em;
    opacity: 0.7;
}

/* Loading state */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Error state */
.error {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    .page-header {
        padding: 20px 15px 15px 15px;
    }

    .page-header h1 {
        font-size: 2em;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }

    .footer-content h3 {
        text-align: center;
    }
}

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

    .example {
        padding: 15px;
    }

    .navigation {
        font-size: 0.9em;
    }

    .navigation a {
        display: inline-block;
        margin: 5px;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.8em;
    }

    .language-classification {
        font-size: 1em;
    }

    .project-description {
        font-size: 0.9em;
    }
}