/* 旅行英会話マスター - 共通スタイル */
body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: #333;
    margin-bottom: 10px;
}

.controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.category-select {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.category-select label {
    font-weight: bold;
}

select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    min-width: 200px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
    display: none;
}

.word-count {
    color: #666;
    font-size: 14px;
    margin-left: auto;
}

.word-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.word-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #4CAF50;
}

.word-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.word-english {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.word-meaning {
    font-size: 16px;
    color: #e74c3c;
    font-weight: 500;
}

.word-example {
    margin: 15px 0;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-style: italic;
    color: #555;
    line-height: 1.4;
}

.word-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #666;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.error {
    text-align: center;
    padding: 20px;
    color: #e74c3c;
    background: #fff5f5;
    border: 1px solid #fedede;
    border-radius: 8px;
    margin: 20px 0;
}

/* タブ機能 */
.tabs {
    display: flex;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: #f8f9fa;
    color: #666;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #e9ecef;
}

.tab-button:last-child {
    border-right: none;
}

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

.tab-button.active {
    background: #4CAF50;
    color: white;
}

/* 会話表示 */
.conversation-list {
    display: grid;
    gap: 20px;
}

.conversation-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-left: 4px solid #2196F3;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.conversation-title-section {
    flex: 1;
}

.conversation-title {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.conversation-situation {
    color: #666;
    font-style: italic;
    margin-bottom: 0;
}

.conversation-toggle-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    min-width: 160px;
    justify-content: center;
}

.conversation-toggle-btn:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.conversation-toggle-btn.expanded {
    background: linear-gradient(135deg, #FF5722, #E64A19);
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3);
}

.conversation-toggle-btn.expanded:hover {
    background: linear-gradient(135deg, #E64A19, #D84315);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.4);
}

.toggle-text {
    font-size: 14px;
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.conversation-toggle-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

.dialogue-content {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.dialogue {
    margin: 20px 0;
}

.dialogue-line {
    margin: 10px 0;
    padding: 12px;
    border-radius: 6px;
    line-height: 1.5;
}

.dialogue-you {
    background: #e3f2fd;
    margin-left: 20px;
    border-left: 3px solid #2196F3;
}

.dialogue-staff {
    background: #f1f8e9;
    margin-right: 20px;
    border-left: 3px solid #4CAF50;
}

.speaker {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 14px;
}

.speaker-you {
    color: #1976d2;
}

.speaker-staff {
    color: #388e3c;
}

.dialogue-english {
    font-weight: 600;
    margin-bottom: 5px;
}

.dialogue-japanese {
    color: #666;
    font-size: 14px;
    font-style: italic;
    margin-top: 5px;
}

.word-example-section {
    margin: 15px 0;
}

.word-example {
    color: #555;
    font-style: italic;
    margin-bottom: 5px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    line-height: 1.4;
}

.word-example-japanese {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

/* カテゴリページ専用スタイル */
.category-title {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 20px;
}

.category-title .emoji {
    font-size: 48px;
    margin-bottom: 10px;
    display: block;
}

.category-description {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
}

/* ナビゲーション */
.navigation {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.nav-links a:hover {
    background-color: #f8f9fa;
}

.nav-links a.active {
    background-color: #4CAF50;
    color: white;
}

/* ホームページ専用 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.category-item {
    background: white;
    border-radius: 8px;
    padding: 30px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.category-emoji {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.category-name {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.category-desc {
    color: #666;
    line-height: 1.5;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .word-list {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .category-select {
        flex-direction: column;
        align-items: stretch;
    }
    
    .word-count {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* クイズ機能用スタイル */
.quiz-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
    display: none;
}

.quiz-tab {
    background: #f8f9fa;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
}

.quiz-tab:hover {
    background: #e9ecef;
}

.quiz-tab.active {
    background: #4CAF50;
    color: white;
}

/* クイズ開始画面 */
.quiz-start {
    padding: 30px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.quiz-start-header h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 28px;
}

.quiz-intro {
    color: #666;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 1.6;
}

.quiz-options {
    margin: 30px 0;
}

.quiz-options h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 22px;
}

.quiz-option-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 25px;
    margin: 20px auto;
    max-width: 400px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.quiz-option-card:hover {
    border-color: #4CAF50;
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.2);
}

.quiz-option-icon {
    font-size: 36px;
    margin-bottom: 15px;
}

.quiz-option-title {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 10px;
}

.quiz-option-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.quiz-option-button {
    color: #4CAF50;
    font-weight: bold;
    font-size: 16px;
}

.quiz-rules {
    text-align: left;
    max-width: 600px;
    margin: 0 auto;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.quiz-rule {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.rule-number {
    background: #4CAF50;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.rule-text {
    color: #555;
    line-height: 1.5;
}

.quiz-unavailable {
    background: #fff3cd;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #ffeaa7;
}

.quiz-unavailable h3 {
    color: #856404;
    margin-bottom: 15px;
}

.quiz-unavailable p {
    color: #856404;
    margin: 0;
}

.quiz-type-selector {
    margin: 20px 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-type-selector label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}

.quiz-type-selector select {
    width: 100%;
}

.quiz-description {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-description h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.quiz-description ul {
    color: #555;
    padding-left: 20px;
}

.quiz-description li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.start-quiz-btn {
    background: linear-gradient(135deg, #4CAF50, #388e3c);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.start-quiz-btn:hover {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

/* クイズ質問画面 */
.quiz-question {
    padding: 30px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.quiz-progress {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.quiz-score {
    font-size: 16px;
    color: #4CAF50;
    font-weight: bold;
}

.question-text {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
    line-height: 1.4;
    white-space: pre-line;
}

.question-situation {
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 6px;
    color: #1976d2;
    margin-bottom: 15px;
    font-weight: 500;
}

.question-speaker {
    background: #f1f8e9;
    padding: 10px 15px;
    border-radius: 6px;
    color: #388e3c;
    margin-bottom: 15px;
    font-weight: 500;
}

.question-example {
    background: #f1f8e9;
    padding: 15px;
    border-radius: 6px;
    color: #2e7d32;
    margin: 20px 0;
    font-style: italic;
    border-left: 4px solid #4CAF50;
    animation: slideIn 0.3s ease-in-out;
}

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

.quiz-choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.quiz-choice {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.quiz-choice:hover:not(:disabled) {
    border-color: #4CAF50;
    background: #f1f8e9;
    transform: translateX(5px);
}

.quiz-choice:disabled {
    cursor: not-allowed;
}

.quiz-choice.correct {
    background: #e8f5e8;
    border-color: #4CAF50;
    color: #2e7d32;
}

.quiz-choice.incorrect {
    background: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

/* クイズ説明 */
.quiz-explanation {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #4CAF50;
}

.explanation-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2c3e50;
}

.explanation-text {
    color: #555;
    line-height: 1.6;
    white-space: pre-line;
}

/* クイズ結果画面 */
.quiz-results {
    padding: 30px;
    text-align: center;
}

.result-header {
    margin-bottom: 30px;
}

.result-title {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 20px;
}

.result-score {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 10px;
}

.result-percentage {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 15px;
}

.result-message {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* 結果の色分け */
.quiz-results.excellent .result-score,
.quiz-results.excellent .result-percentage {
    color: #4CAF50;
}

.quiz-results.good .result-score,
.quiz-results.good .result-percentage {
    color: #2196F3;
}

.quiz-results.average .result-score,
.quiz-results.average .result-percentage {
    color: #ff9800;
}

.quiz-results.needs-improvement .result-score,
.quiz-results.needs-improvement .result-percentage {
    color: #f44336;
}

.result-details {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
}

.result-details h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.result-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 5px solid #e0e0e0;
}

.result-item.correct {
    border-left-color: #4CAF50;
    background: #f1f8e9;
}

.result-item.incorrect {
    border-left-color: #f44336;
    background: #ffebee;
}

.result-question {
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}

.result-answer {
    color: #555;
    line-height: 1.5;
}

.result-actions {
    margin-top: 30px;
}

.quiz-restart-btn {
    background: linear-gradient(135deg, #4CAF50, #388e3c);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

.quiz-restart-btn:hover {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

/* クイズボタン */
.quiz-button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
}

.quiz-button:hover {
    background: #388e3c;
    transform: translateY(-2px);
}

.quiz-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 音声再生ボタン */
.audio-button {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.audio-button:hover {
    background: #45a049;
    transform: scale(1.1);
}

.audio-button:active {
    transform: scale(0.95);
}

/* 音声ボタンのサイズバリエーション */
.audio-button.small {
    width: 20px;
    height: 20px;
    font-size: 12px;
}

.audio-button.medium {
    width: 24px;
    height: 24px;
    font-size: 14px;
}

/* クイズ用レスポンシブデザイン */
@media (max-width: 768px) {
    .quiz-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .question-text {
        font-size: 20px;
    }
    
    .quiz-choice {
        padding: 15px;
        font-size: 14px;
    }
    
    .result-score {
        font-size: 36px;
    }
    
    .result-percentage {
        font-size: 28px;
    }
    
    .quiz-question,
    .quiz-start,
    .quiz-results {
        padding: 20px;
    }
    
    /* モバイルでは音声ボタンを少し大きく */
    .audio-button.small {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}