/* style.css - SNG Kanji */

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.nav {
    display: flex;
    gap: 1rem;
}

.nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav a:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.card-header {
    border-bottom: 2px solid #667eea;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
}

/* Formulaires */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.form-input {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

.form-input.japanese {
    font-size: 1.2rem;
    font-family: 'Hiragino Kaku Gothic Pro', 'Yu Gothic', 'Meiryo', sans-serif;
}

/* Boutons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-block {
    width: 100%;
}

/* Kanji display */
.kanji-display {
    text-align: center;
    padding: 3rem;
    margin: 2rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.kanji-character {
    font-size: 8rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
    font-family: 'Hiragino Kaku Gothic Pro', 'Yu Gothic', 'Meiryo', sans-serif;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.word-display {
    font-size: 4rem;
    color: #333;
    font-family: 'Hiragino Kaku Gothic Pro', 'Yu Gothic', 'Meiryo', sans-serif;
    margin-bottom: 1rem;
}

/* Grille de statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Calendrier */
.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
}

.calendar-day.studied {
    background-color: #28a745;
    color: white;
}

.calendar-day.not-studied {
    background-color: #6c757d;
    color: white;
}

.calendar-day.today {
    border: 2px solid #667eea;
}

/* Tableaux */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.table th,
.table td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table-striped tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

/* Messages d'alerte */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #cce7f0;
    color: #0c5460;
    border: 1px solid #b3d7e6;
}

/* Timer */
.timer {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    color: #667eea;
    margin: 1rem 0;
    padding: 1rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Progress bar */
.progress {
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 20px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #667eea;
}

.modal-title {
    font-size: 1.3rem;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-direction: column;
        text-align: center;
    }
    
    .kanji-character {
        font-size: 6rem;
    }
    
    .word-display {
        font-size: 3rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar {
        grid-template-columns: repeat(7, 1fr);
        gap: 0.3rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Couvertures de livres - Format A4 optimisé */
.book-cover {
    text-align: center;
    margin-bottom: 1rem;
}

.book-cover img {
    width: 120px;  /* Largeur fixe pour cohérence */
    height: 170px; /* Ratio A4 (1:1.414) adapté à la taille */
    object-fit: cover; /* Maintient le ratio sans déformation */
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
}

.book-cover img:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

/* Placeholder pour couverture manquante - Format A4 */
.book-cover-placeholder {
    width: 120px;
    height: 170px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-align: center;
    margin: 0 auto;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    padding: 10px;
    font-size: 0.85rem;
    line-height: 1.2;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.book-cover-placeholder:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

/* Grid responsive pour les livres */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.book-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.book-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0 1rem 0;
    color: #333;
    text-align: center;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Stats mini pour les livres */
.book-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

.book-stat {
    text-align: center;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.book-stat-value {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
}

.book-stat-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.2rem;
}

/* Boutons pour les livres */
.book-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.book-actions .btn {
    flex: 1;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
}

/* Responsive pour petits écrans */
@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .book-cover img,
    .book-cover-placeholder {
        width: 100px;
        height: 142px;
    }
    
    .book-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.3rem;
    }
    
    .book-stat {
        padding: 0.3rem;
    }
    
    .book-stat-value {
        font-size: 1rem;
    }
    
    .book-stat-label {
        font-size: 0.7rem;
    }
    
    .book-actions {
        flex-direction: column;
        gap: 0.3rem;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .book-cover img,
    .book-cover-placeholder {
        width: 80px;
        height: 113px;
    }
}

/* Utilitaires */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.hidden { display: none; }