@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

.egh-phoneme-chart-wrapper {
    position: relative;
    --primary-bg: #f2e6f2;
    --container-bg: #ffffff;
    --text-color: #333;
    --primary-accent: #800080;
    --secondary-accent: #6a006a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    font-family: 'Poppins', sans-serif;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--container-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.chart-title {
    text-align: center;
    color: var(--primary-accent);
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.phoneme-section {
    margin-bottom: 2rem;
}

.chart-subtitle {
    color: var(--primary-accent);
    margin-bottom: 1rem;
    font-size: 1.8rem;
    border-bottom: 2px solid var(--primary-accent);
    padding-bottom: 0.5rem;
}

.vowel-grid {
    display: flex;
    gap: 2rem;
}

.vowel-column {
    flex: 1;
}

.vowel-type {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--secondary-accent);
    background-color: var(--primary-bg);
    padding: 0.5rem;
    border-radius: 10px;
}

.phoneme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 0.5rem;
}

.phoneme-cell {
    background-color: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.phoneme-cell:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(128, 0, 128, 0.2);
    border-color: var(--primary-accent);
}

.phoneme-cell span {
    display: block;
    font-size: 0.9rem;
    color: #777;
    margin-top: 0.5rem;
}

.phoneme-tooltip {
    position: absolute;
    background-color: var(--secondary-accent);
    color: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 100;
    width: 200px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.phoneme-tooltip.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-phoneme {
    font-size: 2rem;
    font-weight: bold;
}

.tooltip-example {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.play-sound-btn {
    background-color: white;
    color: var(--primary-accent);
    border: none;
    border-radius: 5px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.play-sound-btn:hover {
    background-color: #f2e6f2;
}

.audio-player-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 5px;
    transform: scale(0);
    transition: transform 0.3s ease-in-out;
}

.audio-player-container.visible {
    transform: scale(1);
}

.play-pause-btn {
    background-color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-right: 10px;
}

.play-pause-btn:hover {
    background-color: var(--primary-bg);
}

.play-pause-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--primary-accent);
}

.waveform-container {
    width: 120px;
    height: 30px;
    background-color: transparent;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.waveform-canvas {
    width: 100%;
    height: 100%;
}

@media (max-width: 600px) {
    .egh-phoneme-chart-wrapper {
        padding: 1rem;
    }

    .vowel-grid {
        flex-direction: column;
        gap: 1rem;
    }

    .phoneme-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
