:root {
    --bg-color: #f5f7fa;
    --text-color: #333;
    --highlight-bg: #e2f0cb;
    --word-hover: #b5e7a0;
    --modal-bg: rgba(0,0,0,0.5);
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
}

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

h1 {
    margin-top: 0;
    font-size: 1.5rem;
}

audio {
    width: 100%;
    margin-top: 10px;
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* コンテナ自体はスクロールさせず、中の要素をスクロールさせる */
}

#transcript-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow-y: auto;
    flex-grow: 1;
    font-size: 1.2rem;
}

.transcript-segment {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

/* 再生中のテキストのハイライト */
.transcript-segment.active {
    background-color: var(--highlight-bg);
}

.word {
    cursor: pointer;
    display: inline-block;
    padding: 0 2px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

/* 単語にホバーした時のハイライト */
.word:hover {
    background-color: var(--word-hover);
}

/* モーダル（ポップアップ）のスタイル */
#translation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#translation-modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 350px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

#close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #888;
}

#close-modal:hover {
    color: #333;
}

#modal-word {
    margin-top: 0;
    color: #e53935; /* 強調カラー */
}

#modal-translation {
    font-size: 1.2rem;
    margin-bottom: 0;
}
/* ヘッダーのレイアウト */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ボタン類 */
.action-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #008CBA;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
}

.action-btn:hover {
    background-color: #007bb5;
}

/* トースト通知 */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 200;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

#toast-container.hidden {
    display: none;
    opacity: 0;
}
