:root {
    --primary-dark: #333333;
    --accent-green: #8dc63f;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    --focus-outline: #8dc63f;
    --container-width: 1000px;
    --footer-bg: #fdfaf0;
    --footer-link: #4eb9f3;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Titillium Web', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-header {
    background-color: #fff;
    padding: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 140px;
}

.logo-area a {
    display: block;
    outline: none;
}

.logo-area a:focus {
    outline: 3px solid var(--accent-green);
    outline-offset: 10px;
}

.logo-icon {
    height: 100px;
    display: block;
}

.nav-bar {
    background-color: var(--primary-dark);
    padding: 10px 0;
    margin-bottom: 2rem;
}

.nav-bar h1 {
    color: #fff;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 300;
}

.nav-bar h1:focus {
    outline: 2px solid var(--accent-green);
    outline-offset: 4px;
}

.nav-bar .subtitle {
    color: var(--accent-green);
    font-weight: 700;
}

.tabs-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
}

.samples-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 640px;
}

.language-sidebar {
    background: #f8f9fa;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
}

.samples-content {
    min-width: 0;
    background: #fff;
}

.search-box {
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 0.9rem;
    font: inherit;
    color: var(--text-color);
    background: #fff;
}

.search-input:focus {
    outline: 3px solid rgba(141, 198, 63, 0.25);
    border-color: var(--accent-green);
}

.tablist {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.tab-button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.9rem 1rem;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    color: #495057;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.tab-button:hover {
    background: #eef1f4;
}

.tab-button:focus {
    outline: 3px solid var(--accent-green);
    outline-offset: 1px;
    z-index: 10;
}

.tab-button[aria-selected="true"] {
    background: #ffffff;
    color: var(--accent-green);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.tab-button[aria-selected="true"]::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    bottom: 10px;
    width: 4px;
    right: auto;
    background-color: var(--accent-green);
    border-radius: 999px;
}

.flag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 15px;
    flex: 0 0 auto;
}

.flag-image {
    display: block;
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 1px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

.flag-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 15px;
    border-radius: 2px;
    background: #dfe3e8;
    color: #495057;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.flag-badge[hidden] {
    display: none;
}

.tab-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-panel {
    padding: 2rem;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-panel:focus {
    outline: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

h3 {
    font-family: 'Titillium Web', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    font-size: 30px;
    margin: 0;
    color: #6fd019;
    outline: none;
}

h3:focus {
    outline: 2px solid #6fd019;
    outline-offset: 4px;
    background: #f9fff0;
}

.region-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 1.5rem;
}

.region-section {
    min-width: 0;
}

.region-heading {
    margin: 0 0 1rem;
    color: #495057;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
}

.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.voice-card {
    background: #fdfdfd;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.voice-card:hover, .voice-card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: var(--accent-green);
}

.voice-info h5 {
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    color: var(--text-color);
    outline: none;
    font-weight: 600;
    line-height: 1.25;
}

.audio-player {
    width: 100%;
}

audio {
    width: 100%;
    height: 40px;
}

.empty-state {
    padding: 2rem;
}

.site-footer {
    background-color: var(--footer-bg);
    padding: 4rem 0;
    margin-top: 6rem;
    border-top: 1px solid #f1ece0;
}

.footer-content {
    text-align: left;
}

.footer-info p {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
}

.footer-info p:first-child {
    color: #333;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 10px;
    font-size: 18px;
}

.footer-content a {
    color: var(--footer-link);
    text-decoration: none;
    font-weight: 400;
}

.footer-content a:hover, .footer-content a:focus {
    text-decoration: underline;
}

.footer-links {
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    .samples-layout {
        grid-template-columns: 1fr;
    }

    .language-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .tablist {
        gap: 0.5rem;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .tab-button {
        width: 100%;
    }

    .tab-button[aria-selected="true"]::after {
        top: auto;
        left: 10px;
        right: 10px;
        bottom: 0;
        width: auto;
        height: 3px;
    }

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