/**
 * 英語学習アプリ専用CSS
 * 赤シート式英語動詞学習画面のスタイル定義
 */

/* 背景設定 */
body {
    background-image: url('linguistic-background.svg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
}

/* ヘッダースタイル */
header {
    background: transparent !important;
    backdrop-filter: none;
    padding: 0 !important;
    position: relative;
    z-index: 50;
}

.header-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-container {
    color: #333 !important;
    display: flex;
    align-items: center;
    padding: 8px 0 12px;
}

header h1 {
    color: #0078a8 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    font-size: 1.3rem !important;
    margin: 0 !important;
}

header h1 i {
    color: #0078a8 !important;
    font-size: 1.1rem;
    margin-right: 5px;
}

/* メインコンテナ */
.english-container {
    display: flex;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 20px;
    padding-top: 15px;
    min-height: calc(100vh - 65px);
}

/* 左側：単語選択パネル */
.word-selection-panel {
    width: 350px;
    min-width: 350px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    margin-right: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(5px);
}

.search-box {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
}

.word-categories {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.category-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.category-option {
    display: inline-block;
    margin-right: 5px;
    margin-bottom: 5px;
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 12px;
    font-size: 0.85rem;
    cursor: pointer;
}

.category-option.active {
    background: #0078a8;
    color: white;
}

.word-list {
    flex-grow: 1;
    padding: 0;
}

.word-list-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.word-list-item:hover {
    background: #f9f9f9;
}

.word-list-item.active {
    background: #e6f7ff;
    border-left: 3px solid #0078a8;
}

.word-text {
    font-weight: bold;
}

.word-phonetic {
    color: #666;
    font-size: 0.85rem;
}

.level-badge {
    background: #eee;
    color: #333;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* 右側: 詳細パネル */
.detail-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.control-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.control-button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background: #0078a8;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 1.1rem;
}

.control-button:hover {
    background: #005f86;
}

/* 非表示状態のボタン（目に線が入っている状態） */
.control-button.inactive-btn {
    background: #999;
}

.control-button.inactive-btn:hover {
    background: #777;
}

/* 赤シートボタン特有のスタイル */
.redsheet-button {
    background: #FFC0CB;
    color: #006400;
    font-size: 1.1rem;
    padding: 10px 20px;
    font-weight: bold;
}

.redsheet-button:hover {
    background: #FFB6C1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.verb-details {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    flex-grow: 1;
    backdrop-filter: blur(5px);
}

.verb-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.verb-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.verb-title {
    font-size: 2rem;
    color: #333;
    margin: 0;
}

.verb-pronunciation {
    color: #666;
    font-style: italic;
    font-size: 1.2rem;
}

.verb-forms {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.form-item {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 5px;
}

.form-label {
    font-weight: bold;
    color: #555;
    display: block;
    margin-bottom: 5px;
}

.form-value {
    font-size: 1rem;
}

.meanings-container {
    margin-top: 20px;
}

.meaning-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.meaning-header {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.example-sentence {
    margin: 10px 0;
    padding: 10px;
    background: #fff;
    border-radius: 5px;
    border-left: 3px solid #0078a8;
}

.translation {
    color: #666;
    margin-top: 5px;
    font-style: italic;
}

.red-text {
    color: #e74c3c;
}

/* 赤シートで隠れたテキストのスタイル */
.covered {
    visibility: hidden !important;
}

/* 赤シートオーバーレイ */
#redsheet-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    z-index: 9999;
    display: flex;
    overflow: visible;
    resize: both;
}

#redsheet {
    width: 100%;
    height: 100%;
    background: #DC143C; /* 完全不透明の赤 - 神の赤シートと同じ */
    cursor: move;
    border: 4px solid rgba(220, 20, 60, 0.95);
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.8);
    border-radius: 8px;
    /* 重要: 物理的に上に重ねて下の文字を隠す */
    opacity: 1;
}

.redsheet-controls-vertical {
    position: absolute;
    top: 0;
    right: -35px;
    width: 35px;
    padding: 5px 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

#close-redsheet {
    background: #e74c3c;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    margin-top: 8px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.hidden {
    display: none !important;
}

.alphabet-links {
    display: flex;
    flex-wrap: wrap;
    margin: 5px 0;
    gap: 2px;
}

.alphabet-link {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 3px;
    font-size: 0.8rem;
    cursor: pointer;
}

.alphabet-link:hover {
    background: #e6e6e6;
}

.alphabet-link.active {
    background: #0078a8;
    color: white;
}

#no-results {
    padding: 20px;
    text-align: center;
    color: #666;
}

/* パンくずリスト */
.breadcrumb {
    list-style: none;
    padding: 8px 0 6px;
    margin: 0;
    display: flex;
    gap: 5px;
    font-size: 0.7rem;
    color: #666;
    border-bottom: 1px solid rgba(0, 120, 168, 0.1);
}

.breadcrumb li {
    display: inline;
}

.breadcrumb li:not(:last-child)::after {
    content: ">"; 
    margin: 0 5px;
    color: #999;
}

.breadcrumb a {
    color: #0078a8;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #005f86;
    text-decoration: underline;
}

.breadcrumb li:last-child {
    color: #999;
}

/* ホットキーヒント */
.hotkey-hint {
    display: inline-block;
    margin-left: 5px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    vertical-align: middle;
}

/* ヘルプボタン共通スタイル */
.help-btn-common {
    width: 40px;
    height: 40px;
    padding: 0;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 120, 168, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
    color: #0078a8;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.help-btn-common:hover {
    background: rgba(0, 120, 168, 0.1);
    transform: translateY(-1px) scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.help-btn-common:active {
    transform: scale(0.95);
}

.help-btn-common i {
    color: #0078a8;
}

/* 右端ボタン群（簡素化） */
.hotkey-help-btn {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 100;
}

.phonetic-help-btn {
    position: fixed;
    top: 120px;
    right: 20px;
    z-index: 100;
    text-decoration: none;
}

.usage-guide-btn {
    position: fixed;
    top: 170px;
    right: 20px;
    z-index: 100;
    text-decoration: none;
}

/* ホットキーサイドパネル */
.hotkey-dialog {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1500;
    transition: right 0.3s ease-out;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hotkey-dialog.open {
    right: 0;
}

.hotkey-dialog-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hotkey-dialog-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hotkey-dialog-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.close-dialog-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-dialog-btn:hover {
    background: #e9ecef;
}

.close-dialog-btn i {
    color: #666;
}

/* ナビゲーションボタン */
.nav-button {
    background: #5cb85c;
}

.nav-button:hover {
    background: #4cae4c;
}

.nav-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.hotkey-dialog-body {
    flex: 1;
    padding: 20px;
}

.hotkey-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 5px;
    transition: background 0.2s;
}

.hotkey-item:hover {
    background: #f0f0f0;
}

.hotkey-key {
    display: inline-block;
    min-width: 60px;
    padding: 5px 10px;
    background: #0078a8;
    color: white;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
    text-align: center;
    margin-right: 15px;
}

.hotkey-desc {
    color: #666;
    font-size: 0.95rem;
}

.hotkey-divider {
    height: 1px;
    background: #ddd;
    margin: 20px 0;
}

/* 発音記号パネルは削除済み - phonetics/ ページへリンク */

/* 音声読み上げボタン */
.speak-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #0078a8;
    transition: all 0.2s;
    font-size: 1.2rem;
    margin-left: 10px;
    vertical-align: middle;
}

.speak-btn:hover {
    color: #005f86;
    transform: scale(1.2);
}

.speak-btn:active {
    transform: scale(0.95);
}

/* 単語タイトルの音声ボタン */
.verb-header .speak-btn {
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
}

/* 音声ボタン内のホットキーヒント */
.speak-btn .hotkey-hint {
    font-size: 0.75rem;
    margin-left: 0;
    background: rgba(255, 255, 255, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

/* 例文の音声ボタン */
.example-sentence {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.example-content {
    flex: 1;
    padding-right: 10px;
}

.example-sentence .speak-btn {
    flex-shrink: 0;
    color: #28a745;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.example-sentence .speak-btn:hover {
    color: #218838;
}

/* 例文内の単語強調 */
.highlighted-word {
    font-weight: bold;
    color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
    padding: 1px 3px;
    border-radius: 3px;
}

/* 日本語訳表示ボタン */
.translation-toggle-btn {
    background: none;
    border: 1px solid #ddd;
    cursor: pointer;
    padding: 2px 6px;
    color: #666;
    font-size: 0.75rem;
    margin-left: 8px;
    border-radius: 3px;
    transition: all 0.2s;
}

.translation-toggle-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.translation-toggle-btn.active {
    background: #e6f7ff;
    border-color: #0078a8;
    color: #0078a8;
}



/* モバイル対応 */
@media (max-width: 768px) {
    /* ヘッダー調整 */
    header {
        padding: 0 !important;
    }
    
    .header-container {
        padding: 6px 0 8px;
    }
    
    header h1 {
        font-size: 1.1rem !important;
    }
    
    header h1 i {
        font-size: 1rem;
    }
    
    /* パンくずリスト調整 */
    .breadcrumb {
        font-size: 0.65rem;
        padding: 5px 0 4px;
    }
    
    .header-wrapper {
        padding: 0 15px;
    }
    
    .help-btn-common {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* 右端ボタン群（モバイル） */
    .hotkey-help-btn {
        top: 55px;
        right: 10px;
    }
    
    .phonetic-help-btn {
        top: 95px;
        right: 10px;
    }
    
    .usage-guide-btn {
        top: 135px;
        right: 10px;
    }
    
    .hotkey-dialog {
        width: 100%;
        right: -100%;
    }
    
    .english-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
        padding-top: 10px;
    }
    
    .word-selection-panel {
        width: 100%;
        min-width: auto;
        margin-right: 0;
        margin-bottom: 20px;
    }
}
