* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6C5CE7;
    --secondary: #00B894;
    --danger: #FF7675;
    --dark: #2D3436;
    --light: #DFE6E9;
    --background: #F5F6FA;
    --card-bg: #FFFFFF;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.3s ease;
    min-width: 300px;
    border-left: 4px solid;
}

.notification.success {
    border-left-color: var(--secondary);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.info {
    border-left-color: var(--primary);
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--dark);
}

.notification-message {
    font-size: 0.9rem;
    color: #6c757d;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover {
    color: var(--dark);
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Les styles de la navbar sont maintenant dans components.css */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    opacity: 0;
    transform: translateY(50px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #5F4DD1;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #00A383;
    transform: translateY(-2px);
}

button[type="submit"] {
    width: 100%;
    margin-top: 1rem;
}

.error-message {
    color: var(--danger);
    margin-top: 1rem;
    text-align: center;
    display: none;
}

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link a {
    color: var(--primary);
    text-decoration: none;
}

.home-container {
    padding: 4rem 2rem;
    text-align: center;
}

.home-title {
    color: white;
    font-size: 3rem;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-selection {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.mode-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    width: 350px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.mode-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.mode-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

.mode-card h2 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.mode-card p {
    color: #666;
    margin-bottom: 2rem;
}

.mode-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.page-header h1 {
    color: var(--primary);
}

.cards-grid {
    display: flex;
    /*grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));*/
    gap: 2rem;
    justify-content: start;
    /*justify-items: center;*/
    width: 100%;
    flex-wrap: wrap;
}

.content-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    width: 320px;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.content-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.category-badge {
    background: var(--secondary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
    margin: 0.5rem 0;
}

.card-date, .card-author {
    color: #999;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.timer-info {
    color: #FFA502;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    font-weight: 600;
}

.btn-play {
    display: block;
    margin-top: 1rem;
    background: var(--primary);
    color: white;
    text-align: center;
}

.empty-message {
    text-align: center;
    color: white;
    font-size: 1.2rem;
    padding: 3rem;
}

.editor-container {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 1200px;
    margin: 0 auto;
}

.editor-header {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    margin-bottom: 2rem;
}

.import-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    border: 2px dashed transparent;
}

.import-section h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.file-upload-zone {
    border: 3px dashed #c5c9d1;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-zone:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f5f3ff 0%, #faf5ff 100%);
    transform: translateY(-2px);
}

.file-upload-zone.drag-over {
    border-color: var(--secondary);
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    transform: scale(1.02);
}

.file-upload-content {
    pointer-events: none;
}

.file-upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.file-upload-text {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.file-upload-hint {
    font-size: 0.9rem;
    color: #6c757d;
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.3s ease;
}

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

.file-info-icon {
    font-size: 1.5rem;
}

.file-info-text {
    flex: 1;
}

.file-info-name {
    font-weight: 600;
    color: #155724;
}

.file-info-size {
    font-size: 0.85rem;
    color: #155724;
    opacity: 0.8;
}

.cards-container, .questions-container {
    margin: 2rem 0;
}

.card-editor, .question-editor {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    position: relative;
    border: 2px solid rgba(108, 92, 231, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.card-editor:hover, .question-editor:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: rgba(108, 92, 231, 0.3);
    transform: translateY(-2px);
}

.card-editor h3, .question-editor h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.remove-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
}

.play-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
}

.play-container h1 {
    color: white;
    margin-bottom: 1rem;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    height: 30px;
    border-radius: 15px;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    background: var(--secondary);
    height: 100%;
    transition: width 0.3s;
    border-radius: 15px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
}

.flashcard-container {
    perspective: 1000px;
    margin: 3rem 0;
}

.flashcard {
    background: white;
    width: 100%;
    height: 400px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

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

.flashcard-front, .flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    font-size: 1.5rem;
    border-radius: 20px;
}

.flashcard-back {
    transform: rotateY(180deg);
    background: var(--primary);
    color: white;
}

.controls {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.nav-controls {
    display: flex;
    gap: 1rem;
}

.rating-section {
    margin: 2rem 0;
}

.btn-rating {
    margin: 0 0.5rem;
}

.btn-hard {
    background: var(--danger);
    color: white;
}

.btn-good {
    background: #FFA502;
    color: white;
}

.btn-easy {
    background: var(--secondary);
    color: white;
}

.question-card {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.options-container {
    margin: 2rem 0;
}

.option {
    background: var(--light);
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.option:hover {
    background: #CED6DC;
}

.option.selected {
    border-color: var(--primary);
    background: #E8E5FF;
}

.option.correct {
    border-color: var(--secondary);
    background: #D4EDDA;
}

.option.incorrect {
    border-color: var(--danger);
    background: #F8D7DA;
}

.results-section {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-top: 1.5rem;
}

.results-section h2 {
    color: var(--primary);
    margin-bottom: 2rem;
}

.score-display {
    margin: 2rem 0;
}

.score-number {
    font-size: 4rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 1rem;
}

.store-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    min-height: 350px;
}

.store-section h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: var(--secondary);
    margin: 1rem 0;
}

.stat-percentage {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
    margin: 1rem 0;
}

.chart-container {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.recent-scores {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.recent-scores h2 {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.scores-table {
    width: 100%;
    border-collapse: collapse;
}

.scores-table th, .scores-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light);
}

.scores-table th {
    background: var(--primary);
    color: white;
}

.question-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.question-type-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--light);
    background: white;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-type-btn:hover {
    border-color: var(--primary);
    background: rgba(108, 92, 231, 0.1);
}

.question-type-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.question-type-icon {
    font-size: 1.2rem;
}

.timer-section {
    background: linear-gradient(135deg, #FFE5E5 0%, #FFD6D6 100%);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    border: 2px solid rgba(255, 118, 117, 0.3);
}

.timer-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--secondary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.timer-input-group {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.timer-input-group input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 1rem;
}

.search-section {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.filter-controls {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--dark);
}

.sort-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--light);
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

.content-type-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    align-self: flex-start;
}

.content-type-badge.flashcard {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    height: fit-content;
}

.content-type-badge.qcm {
    background: linear-gradient(135deg, #F093FB 0%, #F5576C 100%);
    color: white;
    height: fit-content;
}

.search-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--light);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-btn {
    padding: 1rem 2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    background: #5F4DD1;
    transform: translateY(-2px);
}

.filter-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tag {
    padding: 0.5rem 1rem;
    background: var(--light);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.filter-tag:hover, .filter-tag.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.options-editor {
    display: grid;
    gap: 1rem;
}

.option-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    border: 2px solid var(--light);
}

.option-item input[type="text"] {
    flex: 1;
}

.option-item input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.add-option-btn {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.3s;
}

.add-option-btn:hover {
    background: #00A383;
    transform: translateY(-2px);
}

.timer-display {
    position: fixed;
    top: 100px;
    right: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 150px;
    text-align: center;
}

.timer-display.warning {
    background: #FFF3CD;
    border: 2px solid #FFC107;
}

.timer-display.danger {
    background: #F8D7DA;
    border: 2px solid var(--danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.timer-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.timer-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .mode-selection {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        padding: 0 1rem;
    }

    .mode-card {
        width: calc(100% - 2rem);
        max-width: 400px;
    }

    .editor-header {
        grid-template-columns: 1fr;
    }

    .nav-links {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .timer-display {
        top: 80px;
        right: 1rem;
        padding: 1rem;
    }

    .search-bar {
        flex-direction: column;
    }
}

.card-editor input[type="text"],
.question-editor input[type="text"],
.card-editor textarea,
.question-editor textarea {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-bottom: 2px solid var(--light);
    background: transparent;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.card-editor input[type="text"]:focus,
.question-editor input[type="text"]:focus,
.card-editor textarea:focus,
.question-editor textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.2);
}

.short-answer-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--light);
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.short-answer-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Styles pour les actions de carte (store) */
.card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
}

.btn-copy {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-copy:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-copy:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-copy:active:not(:disabled) {
    transform: translateY(0);
}

.btn-edit {
    background: linear-gradient(135deg, #FFA726 0%, #FF7043 100%);
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 167, 38, 0.3);
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-edit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 167, 38, 0.4);
}

.btn-edit:active {
    transform: translateY(0);
}

.btn-delete {
    background: linear-gradient(135deg, #FF5252 0%, #F44336 100%);
    color: white;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 82, 82, 0.4);
}

.btn-delete:active {
    transform: translateY(0);
}

.btn-delete:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablettes et petits écrans (max-width: 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }

    .cards-grid {
        gap: 1.5rem;
        justify-content: center;
    }

    .content-card {
        width: 280px;
    }

    .filter-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .filter-group {
        width: 100%;
    }
}

/* Mobile landscape et tablettes portrait (max-width: 768px) */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    /* Navigation */
    .navbar {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-brand {
        font-size: 1.3rem;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    /* Container */
    .container {
        padding: 1rem;
        margin-top: 2rem;
    }

    /* Headers */
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .page-header .btn {
        width: 100%;
        text-align: center;
    }

    /* Cards */
    .cards-grid {
        gap: 1rem;
    }

    .content-card {
        width: 100%;
        max-width: 100%;
        min-height: auto;
    }

    /* Filtres du store */
    .search-section {
        margin-bottom: 1.5rem;
    }

    .search-input {
        font-size: 14px;
        padding: 0.75rem;
    }

    .filter-tags {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .filter-tag {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .sort-select {
        width: 100%;
        padding: 0.75rem;
    }

    /* Flashcard player */
    .flashcard {
        height: 300px;
    }

    .flashcard-front,
    .flashcard-back {
        font-size: 1.2rem;
        padding: 1.5rem;
    }

    .flashcard-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .flashcard-controls button {
        width: 100%;
    }

    /* QCM player */
    .question-card {
        padding: 1.5rem;
    }

    .options-container {
        margin: 1rem 0;
    }

    .option {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Editeurs */
    .editor-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .editor-form {
        padding: 1rem;
    }

    .card-editor,
    .question-editor {
        padding: 1rem;
    }

    /* Buttons */
    .btn,
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    /* Dashboard / Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }
}

/* Mobile portrait (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 13px;
    }

    /* Navigation */
    .navbar {
        padding: 0.75rem;
    }

    .nav-brand {
        font-size: 1.1rem;
    }

    /* Headers */
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Container */
    .container {
        padding: 0.75rem;
    }

    /* Cards */
    .content-card {
        padding: 1.5rem;
    }

    .category-badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }

    .card-date {
        font-size: 0.75rem;
    }

    /* Filter tags responsive */
    .filter-tags {
        gap: 0.4rem;
    }

    .filter-tag {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Flashcard player */
    .flashcard {
        height: 250px;
    }

    .flashcard-front,
    .flashcard-back {
        font-size: 1rem;
        padding: 1rem;
    }

    .progress-text {
        font-size: 0.9rem;
    }

    /* QCM */
    .question-card {
        padding: 1rem;
    }

    .question-card h2 {
        font-size: 1.2rem;
    }

    /* Editeurs */
    .editor-form {
        padding: 0.75rem;
    }

    .card-editor,
    .question-editor {
        padding: 0.75rem;
        margin-bottom: 0.75rem;
    }

    /* Buttons plus petits */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-play,
    .btn-edit,
    .btn-delete,
    .btn-copy {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    /* Input fields */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 14px;
        padding: 0.75rem;
    }

    /* Timer display */
    .timer-display {
        top: 60px;
        right: 0.5rem;
        padding: 0.75rem;
        font-size: 1rem;
    }

    /* Modal responsive */
    .modal-content {
        width: 95%;
        margin: 1rem;
        padding: 1.5rem;
    }
}

/* Très petits écrans (max-width: 360px) */
@media (max-width: 360px) {
    .nav-brand {
        font-size: 1rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    .content-card {
        padding: 1rem;
    }

    .flashcard {
        height: 200px;
    }

    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* ====================== Fill-in-the-Blank Mode ====================== */
.fill-blank-container {
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 700px;
    margin: 2rem auto;
    text-align: center;
}

.fill-blank-question {
    font-size: 1.5rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    color: var(--dark);
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

.blank-placeholder {
    display: inline-block;
    min-width: 80px;
    border-bottom: 2px solid var(--primary);
    color: var(--primary);
    font-weight: bold;
    padding: 0 0.5rem;
}

.fill-blank-input {
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    border: 2px solid var(--light);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.fill-blank-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.fill-blank-input:disabled {
    background-color: var(--light);
    cursor: not-allowed;
}

.fill-blank-feedback {
    min-height: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
}

.fill-blank-feedback.correct {
    color: var(--secondary);
    background-color: rgba(0, 184, 148, 0.1);
}

.fill-blank-feedback.incorrect {
    color: var(--danger);
    background-color: rgba(255, 118, 117, 0.1);
}

#checkBlankBtn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* ====================== Leaderboard ====================== */
.user-stats-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.25rem;
}

.badges-section {
    margin-bottom: 2rem;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.badge-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.badge-card:hover {
    transform: translateY(-5px);
}

.badge-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.badge-name {
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.badge-desc {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.badge-date {
    font-size: 0.75rem;
    color: #999;
}

.leaderboard-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
}

.leaderboard-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead th {
    background: var(--background);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--light);
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid var(--light);
    transition: background 0.2s;
}

.leaderboard-table tbody tr:hover {
    background: var(--background);
}

.leaderboard-table tbody tr.current-user {
    background: rgba(108, 92, 231, 0.1);
    font-weight: 600;
}

.leaderboard-table td {
    padding: 1rem;
}

.rank-cell {
    font-size: 1.2rem;
    font-weight: bold;
}

.rank-medal {
    font-size: 1.5rem;
}

.rank-number {
    color: var(--primary);
}

.username-cell {
    font-weight: 600;
}

.xp-cell {
    color: var(--primary);
    font-weight: 600;
}

.streak-cell {
    color: var(--danger);
}

.badges-cell {
    color: var(--secondary);
}

/* ====================== Gamification Widget (Home) ====================== */
.gamification-widget {
    background: white;
    border-radius: 20px;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.xp-display, .streak-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.xp-icon, .streak-icon {
    font-size: 2rem;
}

.xp-value, .streak-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary);
}

.view-leaderboard-btn {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.view-leaderboard-btn:hover {
    background: #5849c7;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
}

/* ====================== Sound Toggle Button ====================== */
.sound-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    margin: 0 0.5rem;
}

.sound-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.sound-toggle.disabled {
    opacity: 0.5;
}

.sound-toggle.disabled .sound-icon::after {
    content: '🔇';
    position: absolute;
}

.sound-toggle.disabled .sound-icon {
    position: relative;
    opacity: 0;
}

/* ===== AMÉLIORATION RESPONSIVE GLOBALE ===== */

/* Utilitaires responsive */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

/* Amélioration du container principal */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    /* Meilleur spacing général */
    .container {
        padding: 0.75rem;
        margin: 0.5rem auto;
    }

    /* Page header responsive */
    .page-header {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .page-header h1 {
        font-size: 1.3rem;
        text-align: center;
    }

    /* Store section */
    .store-section {
        padding: 1rem;
        border-radius: 12px;
        min-height: auto;
    }

    .store-section h2 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    /* Progress bar */
    .progress-bar {
        height: 20px;
        margin: 1rem 0;
    }

    .progress-text {
        font-size: 0.8rem;
    }

    /* Empty message */
    .empty-message {
        padding: 2rem 1rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }

    .page-header {
        padding: 0.75rem;
    }

    .page-header h1 {
        font-size: 1.1rem;
    }

    .store-section {
        padding: 0.75rem;
    }

    .store-section h2 {
        font-size: 1rem;
    }

    /* Amélioration des tableaux sur mobile */
    .scores-table {
        font-size: 0.85rem;
    }

    .scores-table th,
    .scores-table td {
        padding: 0.5rem;
    }

    /* Leaderboard responsive */
    .leaderboard-table {
        font-size: 0.85rem;
    }

    .leaderboard-table td,
    .leaderboard-table th {
        padding: 0.5rem;
    }

    .rank-medal {
        font-size: 1.2rem;
    }
}

/* Amélioration navigation mobile */
@media (max-width: 768px) {
    .navbar {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .nav-links {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Amélioration gamification widget mobile */
@media (max-width: 768px) {
    .gamification-widget {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .xp-display,
    .streak-display {
        gap: 0.5rem;
    }

    .xp-icon,
    .streak-icon {
        font-size: 1.5rem;
    }

    .xp-value,
    .streak-value {
        font-size: 1.1rem;
    }

    .view-leaderboard-btn {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }
}

/* Amélioration badges responsive */
@media (max-width: 768px) {
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .badge-card {
        padding: 1rem;
    }

    .badge-icon {
        font-size: 2rem;
    }

    .badge-name {
        font-size: 0.9rem;
    }

    .badge-desc {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .badges-grid {
        grid-template-columns: 1fr 1fr;
    }

    .badge-card {
        padding: 0.75rem;
    }

    .badge-icon {
        font-size: 1.8rem;
    }
}

/* Amélioration leaderboard tabs */
@media (max-width: 768px) {
    .leaderboard-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .tab-btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        flex: 1;
        min-width: 100px;
    }
}

/* User stats card mobile */
@media (max-width: 768px) {
    .user-stats-card {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-item {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .user-stats-card {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }

    .stat-item {
        padding: 0.75rem;
    }

    .stat-icon {
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.2rem;
    }
}

/* Amélioration mode selection (home) */
@media (max-width: 768px) {
    .home-container {
        padding: 2rem 1rem;
    }

    .home-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .mode-card {
        padding: 2rem 1.5rem;
        width: 100%;
        max-width: none;
    }

    .mode-icon {
        font-size: 3.5rem;
    }

    .mode-card h2 {
        font-size: 1.3rem;
    }

    .mode-card p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .home-container {
        padding: 1.5rem 0.75rem;
    }

    .home-title {
        font-size: 1.6rem;
    }

    .mode-card {
        padding: 1.5rem 1rem;
    }

    .mode-icon {
        font-size: 3rem;
    }

    .mode-card h2 {
        font-size: 1.1rem;
    }
}

/* Fix pour les notifications sur mobile */
@media (max-width: 480px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .notification {
        min-width: auto;
        padding: 0.75rem 1rem;
    }

    .notification-icon {
        font-size: 1.2rem;
    }

    .notification-title {
        font-size: 0.9rem;
    }

    .notification-message {
        font-size: 0.8rem;
    }
}

/* Fill-in-blank responsive */
@media (max-width: 768px) {
    .fill-blank-container {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    .fill-blank-question {
        font-size: 1.2rem;
    }

    .fill-blank-input {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .fill-blank-container {
        padding: 1.5rem 1rem;
        border-radius: 15px;
    }

    .fill-blank-question {
        font-size: 1rem;
        line-height: 1.6;
    }

    .fill-blank-input {
        max-width: 100%;
    }
}
