/* Globishモード専用スタイル */

/* カスタムフォント定義 */
@font-face {
    font-family: 'GlobishEnglish';
    src: url('../font/font.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* モーダルヘッダーのフォントは普通のフォントに */
#globish-modal .modal-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Segoe UI', '游ゴシック Medium', 'メイリオ', 'Meiryo', sans-serif !important;
}

/* === Globishモーダル: 全画面表示 === */
#globish-modal .modal-body {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* 学習コンテンツエリア */
#globish-modal .globish-learning-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 20px 120px 20px; /* 下部のパディングを調整してさらに下へ */
}

/* 進捗情報 */
#globish-modal .globish-progress-info {
    text-align: center;
    font-size: 16px;
    color: #9ca3af;
    margin-bottom: 20px;
}

/* 英文表示エリア */
#globish-modal .globish-main-sentence {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 20px 20px 20px; /* 上部パディングを大幅に増やす */
    width: 100%;
    margin-top: auto; /* 上部の空白を自動調整 */
}

/* 英文 - 大きく表示 */
#globish-modal .globish-english-large {
    font-size: 42px;
    color: #000000;
    margin: 0;
    line-height: 1.5;
    text-align: center;
    font-family: 'GlobishEnglish', 'Times New Roman', serif;
    font-weight: 500;
}

/* 英文の和訳表示エリア */
#globish-modal .globish-translation-sentence {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 20px 30px 20px;
    width: 100%;
}

/* 英文の和訳 */
#globish-modal .globish-japanese-medium {
    font-size: 26px;
    color: #4b5563;
    margin: 0;
    line-height: 1.6;
    text-align: center;
}

/* ターゲットの単語表示エリア */
#globish-modal .globish-target-word {
    flex: 0 0 auto;
    text-align: center;
    color: #9ca3af;
    font-size: 22px;
    margin: 10px auto auto auto; /* 下部に余裕を持たせない */
    padding-bottom: 20px;
    width: 100%;
    display: block;
}

#globish-modal .globish-word-display {
    font-family: 'GlobishEnglish', 'Times New Roman', serif;
    color: #9ca3af;
    font-size: 35px;
}

#globish-modal .globish-word-meaning {
    color: #9ca3af;
    font-size: 28px;
}

#globish-modal .globish-word-separator {
    color: #9ca3af;
    font-size: 22px;
}

/* 音声認識結果表示エリア（下部に固定） */
#globish-recognition-result {
    position: fixed;
    bottom: 90px; /* ボタンの少し上に配置 */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    padding: 16px 24px;
    background: #f8f9fa; /* パールホワイト */
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    min-height: 90px; /* 2行分の高さに固定 */
    height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 10;
}

/* 認識中の状態 */
#globish-recognition-result.recognition-active {
    display: flex;
    background: #f8f9fa; /* パールホワイト */
    border-color: #93C5FD;
    animation: pulse 2s infinite;
}

/* 成功時の状態 */
#globish-recognition-result.recognition-success {
    display: flex;
    background: #f8f9fa; /* パールホワイト */
    border-color: #86EFAC;
}

/* エラー時の状態 */
#globish-recognition-result.recognition-error {
    display: flex;
    background: #f8f9fa; /* パールホワイト */
    border-color: #FCA5A5;
}

/* アイドル状態 */
#globish-recognition-result.recognition-idle {
    display: flex;
    background: #f8f9fa; /* パールホワイト */
    border-color: #e5e7eb;
}

/* 認識結果のテキスト */
#globish-recognition-result .recognition-text {
    font-size: 20px;
    color: #6b7280; /* グレー */
    margin: 0;
    font-family: 'GlobishEnglish', 'Times New Roman', serif;
}

/* スコア表示 */
#globish-recognition-result .recognition-score {
    font-size: 20px; /* テキストと同じサイズ */
    font-weight: normal;
    margin-top: 8px;
    color: #6b7280; /* グレー */
}

/* パルスアニメーション */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* コントロールボタン - 画面下部に固定 */
#globish-modal .globish-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: rgba(255,255,255,1);
    z-index: 10;
}

/* ボタンスタイル */
#globish-modal .reading-btn {
    padding: 14px 28px;
    font-size: 18px;
    font-weight: 500;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#globish-modal .reading-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #94a3b8;
}

/* 再生ボタン強調 */
#globish-modal .reading-btn.play-btn {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    color: #374151;
    border-color: #9ca3af;
    padding: 14px 40px;
    font-weight: 600;
}

#globish-modal .reading-btn.play-btn:hover {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    border-color: #6b7280;
}

/* タブレット対応 */
@media (max-width: 768px) {
    #globish-modal .globish-english-large {
        font-size: 32px;
    }
    
    #globish-modal .globish-japanese-medium {
        font-size: 22px;
    }
    
    #globish-modal .globish-target-word {
        font-size: 20px;
        margin-bottom: 140px;
    }
    
    #globish-modal .globish-word-display,
    #globish-modal .globish-word-meaning,
    #globish-modal .globish-word-separator {
        font-size: 20px;
    }
    
    #globish-modal .reading-btn {
        padding: 12px 20px;
        font-size: 16px;
    }
    
    #globish-modal .reading-btn.play-btn {
        padding: 12px 30px;
    }
    
    #globish-recognition-result {
        bottom: 85px;
        width: 92%;
    }
}

/* スマートフォン対応 */
@media (max-width: 480px) {
    #globish-modal .globish-learning-content {
        padding: 20px 15px 180px 15px;
    }
    
    #globish-modal .globish-main-sentence {
        padding: 30px 15px 15px 15px;
    }
    
    #globish-modal .globish-english-large {
        font-size: 24px;
    }
    
    #globish-modal .globish-translation-sentence {
        padding: 15px 15px 20px 15px;
    }
    
    #globish-modal .globish-japanese-medium {
        font-size: 18px;
    }
    
    #globish-modal .globish-target-word {
        font-size: 18px;
        margin: 10px auto auto auto;
        padding-bottom: 15px;
    }
    
    #globish-modal .globish-word-display,
    #globish-modal .globish-word-meaning,
    #globish-modal .globish-word-separator {
        font-size: 18px;
    }
    
    #globish-modal .globish-progress-info {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    #globish-modal .globish-controls {
        gap: 8px;
        padding: 15px;
    }
    
    #globish-modal .reading-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    #globish-modal .reading-btn.play-btn {
        padding: 10px 24px;
    }
    
    #globish-recognition-result {
        bottom: 80px;
        padding: 12px 20px;
        width: 94%;
    }
}

/* 大画面対応 */
@media (min-width: 1024px) {
    #globish-modal .globish-main-sentence,
    #globish-modal .globish-translation-sentence {
        max-width: 1200px;
        margin: 0 auto;
        width: 100%;
    }
    
    #globish-modal .globish-english-large {
        font-size: 48px;
    }
    
    #globish-modal .globish-japanese-medium {
        font-size: 30px;
    }
}