/**
 * フラッシュカード学習専用CSS
 * さくらエディタ風シンプルデザインを継承
 */

/* ベース設定 */
body {
    background-image: url('../css/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;
}

/* パンくずリスト */
.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;
}

/* メインコンテナ */
.flashcard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 200px);
}

/* 戻るボタン */
.back-to-main {
    margin-bottom: 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #666;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #555;
    transform: translateY(-1px);
}

/* フラッシュカード表示エリア */
.flashcard-display {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    backdrop-filter: blur(5px);
}

/* 進捗表示 */
.progress-info {
    text-align: center;
    margin-bottom: 30px;
}

.progress-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0078a8, #00a8d8);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* フラッシュカード */
.flashcard {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 0 auto 30px;
    perspective: 1000px;
    cursor: pointer;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border: 2px solid #0078a8;
    border-radius: 15px;
    backface-visibility: hidden;
    transition: transform 0.6s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-front {
    transform: rotateY(0deg);
}

.card-back {
    transform: rotateY(180deg);
}

.flashcard.flipped .card-front {
    transform: rotateY(-180deg);
}

.flashcard.flipped .card-back {
    transform: rotateY(0deg);
}

.card-content {
    text-align: center;
    padding: 20px;
    width: 100%;
}

/* 表面のスタイル */
.card-word {
    font-size: 3rem;
    font-weight: bold;
    color: #0078a8;
    margin-bottom: 20px;
    font-family: 'Arial', sans-serif;
}

.card-hint {
    font-size: 1rem;
    color: #666;
    font-style: italic;
}

/* 裏面のスタイル */
.card-pronunciation {
    font-size: 1.8rem;
    color: #666;
    margin-bottom: 30px;
    font-family: 'Arial Unicode MS', sans-serif;
}

.card-forms {
    display: none; /* 活用形は非表示 */
}

.card-meanings {
    margin-bottom: 15px;
    display: block; /* 明示的に表示を指定 */
}

.meaning-item {
    text-align: center;
    display: block; /* 明示的に表示を指定 */
}

.meaning-content {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    line-height: 1.4;
    margin: 0;
    display: block; /* 明示的に表示を指定 */
    visibility: visible; /* 可視性を明示的に指定 */
}

/* 操作ボタン */
.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.control-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    background: #0078a8;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-btn:hover:not(:disabled) {
    background: #005f86;
    transform: translateY(-1px);
}

.control-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.flip-btn {
    background: #28a745;
}

.flip-btn:hover {
    background: #218838;
}

/* 学習ボタン */
.learning-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.learning-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.know-btn {
    background: #28a745;
    color: white;
}

.know-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.unknown-btn {
    background: #dc3545;
    color: white;
}

.unknown-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* 音声ボタン */
.audio-controls {
    text-align: center;
}

.audio-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background: #17a2b8;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.audio-btn:hover {
    background: #138496;
    transform: scale(1.05);
}

/* お気に入りが空の場合 */
.empty-message {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
}

.empty-content i {
    font-size: 4rem;
    color: #ffd700;
    margin-bottom: 20px;
}

.empty-content h2 {
    color: #333;
    margin-bottom: 15px;
}

.empty-content p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.empty-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0078a8;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.empty-link:hover {
    background: #005f86;
    transform: translateY(-1px);
}

/* フッター */
footer {
    background: transparent;
    color: #333;
    padding: 20px 0;
    text-align: center;
    margin-top: 30px;
    backdrop-filter: none;
}

.footer-links {
    margin-bottom: 15px;
}

.footer-links a {
    color: #0078a8;
    margin: 0 10px;
    text-decoration: none;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

/* モバイル警告 */
#mobile-warning {
    display: none;
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    background: #f44336;
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 3000;
}

#mobile-warning p {
    margin: 0;
}

/* レスポンシブ対応（基本的にPC専用） */
@media (max-width: 768px) {
    .flashcard-container {
        padding: 15px;
    }
    
    .card-word {
        font-size: 2rem;
    }
    
    .card-pronunciation {
        font-size: 1.4rem;
    }
    
    .meaning-content {
        font-size: 1.5rem;
    }
    
    .flashcard {
        height: 300px;
    }
    
    .flashcard-controls {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .learning-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .learning-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
}