/* Future Anki Frontend Styles */

/* Sistema de Notificaciones */
.notifications-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    min-width: 320px;
    max-width: 400px;
    padding: 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateX(100%);
    animation: slideIn 0.3s ease-out forwards;
    cursor: pointer;
    overflow: hidden;
}

.notification:hover {
    transform: translateX(0) scale(1.02);
    transition: transform 0.2s ease;
}

.notification-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.notification-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.2);
}

.notification-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.notification-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.notification-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

.notification.removing {
    animation: slideOut 0.3s ease-in forwards;
}

/* Responsive */
@media (max-width: 768px) {
    .notifications-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .notification {
        min-width: auto;
        max-width: none;
    }
}

/* Sistema de Tooltips */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    max-width: 400px;
    width: 400px;
    white-space: normal;
    text-align: center;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

.tooltip-container:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Responsive tooltips */
@media (max-width: 768px) {
    .tooltip {
        max-width: 200px;
        font-size: 12px;
        padding: 8px 12px;
    }
}

.future-anki-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header */
.anki-header {
    text-align: center;
    margin-bottom: 40px;
}

.anki-header h2 {
    color: #1f2937;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 30px;
}

.header-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Subject Selector */
.subject-selector {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.subject-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px 20px;
    width: 180px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subject-card:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
}

.subject-card.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.subject-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: #f1f5f9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.subject-card.active .subject-icon {
    background: #dbeafe;
}

.subject-card span {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
}

.subject-card.active span {
    color: #2563eb;
}

/* Settings Panel */
.settings-panel {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.setting-group h3 {
    color: #2563eb;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.checkbox-group, .radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-group label, .radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.test-options {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.test-options h3 {
    color: #1f2937;
    font-size: 20px;
    margin-bottom: 20px;
}

/* Buttons */
.btn-primary {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-death {
    background: #dc2626;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-death:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Card Review */
.card-review {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.card-content {
    max-width: 800px;
    margin: 0 auto;
}

.question-section h3 {
    color: #1f2937;
    font-size: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.question-text {
    background: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 25px;
    border-left: 4px solid #2563eb;
}

.answer-section {
    margin-top: 30px;
}

.answer-section h4 {
    color: #059669;
    font-size: 18px;
    margin-bottom: 15px;
}

.answer-text {
    background: #f0fdf4;
    padding: 25px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 30px;
    border-left: 4px solid #059669;
}

/* Evaluation Buttons */
.evaluation-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-fail, .btn-doubt, .btn-easy {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-fail {
    background: #fee2e2;
    color: #dc2626;
    border: 2px solid #fecaca;
}

.btn-fail:hover {
    background: #fecaca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}

.btn-doubt {
    background: #fef3c7;
    color: #d97706;
    border: 2px solid #fed7aa;
}

.btn-doubt:hover {
    background: #fed7aa;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.btn-easy {
    background: #dcfce7;
    color: #059669;
    border: 2px solid #bbf7d0;
}

.btn-easy:hover {
    background: #bbf7d0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

/* Reveal Button */
.reveal-section {
    text-align: center;
    margin-top: 30px;
}

.btn-reveal {
    background: #6366f1;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reveal:hover {
    background: #5b21b6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Review Completed */
.review-completed {
    background: white;
    border-radius: 12px;
    padding: 40px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.review-completed h2 {
    color: #059669;
    font-size: 28px;
    margin-bottom: 30px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 120px;
}

.stat-label {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

/* Responsive Design */
@media (max-width: 768px) {
    .future-anki-container {
        padding: 15px;
    }    
    .subject-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .subject-card {
        width: 100%;
        max-width: 300px;
    }
    
    .settings-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .evaluation-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-fail, .btn-doubt, .btn-easy {
        width: 100%;
        max-width: 250px;
    }
    
    .stats-container {
        max-width: 400px;
        margin: 0 auto;
    }
    
    .stats-summary {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .stat-item {
        width: 100%;
        max-width: 300px;
    }
}

/* Estilos para pantalla de configuración */
.setup-screen {
    animation: fadeIn 0.3s ease-in-out;
}

/* Estilos mejorados para estadísticas */
.stats-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.stats-summary {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-radius: 12px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-item.easy {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.stat-item.doubt {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.stat-item.fail {
    border-color: #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.stat-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.stats-overview {
    text-align: center;
    margin-bottom: 30px;
}

.total-questions {
    margin-bottom: 20px;
}

.total-questions h3 {
    color: #374151;
    font-size: 18px;
    margin: 0;
}

.success-rate h3 {
    color: #374151;
    font-size: 18px;
    margin: 0 0 10px 0;
}

.success-bar {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin: 0 auto;
    max-width: 300px;
}

.success-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    border-radius: 6px;
    transition: width 0.8s ease-in-out;
}

.review-actions {
    text-align: center;
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.review-actions .btn-primary,
.review-actions .btn-secondary {
    min-width: 160px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
}

.review-actions .btn-secondary {
    background: #f8fafc;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.review-actions .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-review {
    animation: fadeIn 0.3s ease-in-out;
}

.review-completed {
    animation: fadeIn 0.5s ease-in-out;
}

/* ========== ESTILOS PARA MAZOS PERSONALIZADOS ========== */

/* Modo Mazos */
.decks-mode .anki-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.decks-mode .anki-header h2 {
    margin-bottom: 0;
}

/* Grid de mazos */
.decks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.deck-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.deck-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.deck-header h3 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.deck-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.category-tag {
    background: #f1f5f9;
    color: #475569;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.deck-description {
    margin-bottom: 15px;
}

.deck-description p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

.deck-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid #f3f4f6;
    gap: 15px;
}

.stat-item {
    text-align: center;
    flex: 1;
    background: #f8fafc;
    padding: 14px 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.stat-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.2;
    margin-top: 4px;
}

.deck-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-my-cards {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.2);
}

.btn-my-cards:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(6, 182, 212, 0.3);
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.btn-help {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-help:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
    background: linear-gradient(135deg, #059669, #047857);
}

.fa-modal-help {
    max-width: 700px;
}

.help-content h4 {
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 10px 0;
}

.help-content h4:first-child {
    margin-top: 0;
}

.help-content p {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

/* Modal para crear mazo */
.fa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000; /* Increased z-index */
}

.fa-modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh; /* Increased max-height */
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    display: block; /* Ensure visibility */
    position: relative; /* Ensure stacking context */
}

.fa-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.fa-modal-header h3 {
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.fa-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fa-modal-close:hover {
    color: #374151;
}

.fa-modal-body {
    padding: 24px;
}

.fa-modal-actions {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.fa-modal-help {
    max-width: 700px;
}

.form-group label {
    display: block;
    color: #374151;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.categories-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #f9fafb;
}

.category-item {
    margin-bottom: 4px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.category-item:hover {
    background-color: #f3f4f6;
}

.category-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.category-item label:hover {
    background-color: #e5e7eb;
}

/* Estilos para categorías padre */
.category-item.parent > label {
    font-weight: 600;
    color: #1f2937;
    background-color: #f1f5f9;
    border-left: 3px solid #3b82f6;
    margin-bottom: 6px;
}

.category-item.parent > label:hover {
    background-color: #e0e7ff;
}

/* Estilos para categorías hijas */
.category-item.child {
    margin-left: 20px;
    position: relative;
}

.category-item.child::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 100%;
    background-color: #cbd5e1;
}

.category-item.child::after {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 2px;
    background-color: #cbd5e1;
}

.category-item.child > label {
    font-size: 14px;
    color: #4b5563;
    background-color: transparent;
    padding-left: 16px;
}

.category-item.child > label:hover {
    background-color: #f9fafb;
}

/* Checkbox personalizado */
.category-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    border-radius: 3px;
}

.category-item.parent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #1d4ed8;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* Selector de mazos para repaso */
.deck-selector {
    margin-bottom: 30px;
}

.decks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deck-option {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.deck-option:hover {
    border-color: #2563eb;
    background: #f8fafc;
}

.deck-info h3 {
    color: #1f2937;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.deck-info p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 8px;
}

.deck-quick-stats {
    text-align: right;
}

.stat {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 4px;
}

.stat.pending {
    color: #f59e0b;
    font-weight: 500;
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #374151;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Medium screens - Tablet landscape and small desktop */
@media (max-width: 1024px) and (min-width: 769px) {
    .decks-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 18px;
    }
    
    .deck-stats {
        gap: 12px;
    }
      .stat-item {
        padding: 12px 6px;
        min-height: 65px;
    }
    
    .stat-label {
        margin-bottom: 6px;
    }
    
    .stat-value {
        font-size: 15px;
        margin-top: 2px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .decks-mode .anki-header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .decks-grid {
        grid-template-columns: 1fr;
    }
    
    .deck-card {
        padding: 15px;
    }
    
    .deck-stats {
        gap: 10px;
    }
      .stat-item {
        padding: 10px 6px;
        min-height: 60px;
    }
    
    .stat-label {
        font-size: 10px;
        margin-bottom: 5px;
    }
    
    .stat-value {
        font-size: 14px;
        margin-top: 2px;
    }
    
    .deck-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .deck-quick-stats {
        text-align: left;
        align-self: stretch;
    }
    
    .modal {
        width: 95%;
        margin: 20px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .decks-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .deck-card {
        padding: 12px;
    }
    
    .header-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-death {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    
    .deck-stats {
        gap: 8px;
        padding-top: 12px;
        flex-direction: column;
    }
    
    .stat-item {
        padding: 10px;
    }
    
    .btn-secondary {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Review actions responsive */
    .review-actions {
        flex-direction: column;
        gap: 15px;
        margin-top: 25px;
    }
    
    .review-actions .btn-primary,
    .review-actions .btn-secondary {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
}

/* ========== WIDGET DE TARJETAS ALEATORIAS ========== */

.future-anki-random-cards {
    max-width: 100%;
    margin: 0;
}

/* Contenedor para una sola tarjeta (estilo repaso) */
.single-card-container {
    margin: 0 auto;
}

.single-card-container .review-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    position: relative;
}

.single-card-container .question-section {
    margin-bottom: 25px;
}

.single-card-container .question-text {
    background: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 0;
    border-left: 4px solid #032e7d;
}

.single-card-container .reveal-section {
    text-align: center;
    margin: 25px 0;
}

.single-card-container .btn-reveal {
    background: #032e7d;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.single-card-container .btn-reveal:hover {
    background: #021c50;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 46, 125, 0.3);
}

.single-card-container .answer-section {
    margin-top: 25px;
}

.single-card-container .answer-section h4 {
    color: #059669;
    font-size: 18px;
    margin-bottom: 15px;
}

.single-card-container .answer-text {
    background: #f0fdf4;
    padding: 25px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 20px;
    border-left: 4px solid #059669;
}

/* Botones de dificultad */
.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.btn-difficulty {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 90px;
}

.btn-difficulty.easy {
    background: #10b981;
    color: white;
}

.btn-difficulty.easy:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-difficulty.medium {
    background: #f59e0b;
    color: white;
}

.btn-difficulty.medium:hover {
    background: #d97706;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-difficulty.hard {
    background: #ef4444;
    color: white;
}

.btn-difficulty.hard:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Barra de progreso dentro de la tarjeta */
.single-card-container .progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #032e7d, #054aa3);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.card-counter {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    background: #f9fafb;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
}

/* Pantalla de estadísticas */
.stats-screen {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.stats-screen h3 {
    color: #374151;
    font-size: 24px;
    margin-bottom: 30px;
}

.stats-summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.stat-value {
    font-size: 17px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.stat-item.easy .stat-value {
    color: #10b981;
}

.stat-item.medium .stat-value {
    color: #f59e0b;
}

.stat-item.hard .stat-value {
    color: #ef4444;
}

.stats-actions {
    margin-top: 30px;
}

.btn-continue {
    display: inline-block;
    background: #032e7d;
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-continue:hover {
    background: #021c50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(3, 46, 125, 0.3);
    text-decoration: none;
    color: white;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f3f4f6;
}

.deck-name,
.category-name {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.deck-name {
    color: #032e7d;
    background: #e6ecff;
    border: 1px solid #b3ccff;
}

.category-name {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
}

/* ========== ESTILOS LEGACY (por compatibilidad) ========== */

.random-cards-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.random-card-wrapper {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.random-card-wrapper .card-content {
    max-width: 100%;
    margin: 0;
}

.random-card-wrapper .question-section {
    margin-bottom: 25px;
}

.random-card-wrapper .question-text {
    background: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 0;
    border-left: 4px solid #032e7d;
}

.random-card-wrapper .reveal-section {
    text-align: center;
    margin: 25px 0;
}

.random-card-wrapper .btn-reveal {
    background: #6366f1;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.random-card-wrapper .btn-reveal:hover {
    background: #5b21b6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.random-card-wrapper .answer-section {
    margin-top: 25px;
}

.random-card-wrapper .answer-section h4 {
    color: #059669;
    font-size: 18px;
    margin-bottom: 15px;
}

.random-card-wrapper .answer-text {
    background: #f0fdf4;
    padding: 25px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 0;
    border-left: 4px solid #059669;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f3f4f6;
}

.deck-name,
.category-name {
    font-size: 12px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.deck-name {
    color: #032e7d;
    background: #e6ecff;
    border: 1px solid #b3ccff;
}

.category-name {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #d1fae5;
}

/* Loading state para widget */
.future-anki-random-cards .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.future-anki-random-cards .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #032e7d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* Empty state para widget */
.future-anki-random-cards .empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.future-anki-random-cards .empty-state p {
    margin: 0;
    font-size: 16px;
}

/* Responsive para widget */
@media (max-width: 768px) {
    .single-card-container .review-card {
        padding: 20px;
        margin: 0 -10px;
    }
    
    .card-counter {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .single-card-container .question-text,
    .single-card-container .answer-text {
        padding: 20px;
        font-size: 16px;
    }
    
    .single-card-container .btn-reveal {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .difficulty-buttons {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .btn-difficulty {
        width: 100%;
        max-width: 200px;
        padding: 12px 20px;
    }
    
    .stats-summary {
        gap: 20px;
    }
    
    .stats-screen {
        padding: 30px 15px;
    }
    
    .stats-screen h3 {
        font-size: 20px;
        margin-bottom: 25px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .btn-continue {
        padding: 12px 25px;
        font-size: 14px;
        width: 100%;
        max-width: 250px;
    }
    
    .card-meta {
        gap: 8px;
        margin-top: 15px;
        padding-top: 12px;
    }
    
    .deck-name,
    .category-name {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    /* Legacy responsive styles */
    .random-card-wrapper {
        padding: 20px;
        margin: 0 -10px;
    }
    
    .random-card-wrapper .question-text,
    .random-card-wrapper .answer-text {
        padding: 20px;
        font-size: 16px;
    }
    
    .random-card-wrapper .btn-reveal {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .random-cards-container {
        gap: 20px;
    }
}

/* My Cards Mode Styles */
.cards-table-container {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #e5e7eb;
}

.cards-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

.cards-table th {
    text-align: left;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    color: #1e293b;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #cbd5e1;
    position: sticky;
    top: 0;
    z-index: 10;
}

.cards-table th:first-child {
    border-top-left-radius: 8px;
}

.cards-table th:last-child {
    border-top-right-radius: 8px;
}

.cards-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.cards-table tbody tr {
    transition: all 0.2s ease;
}

.cards-table tbody tr:hover {
    background: #f8fafc;
    transform: scale(1.01);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.cards-table tbody tr:hover td {
    background: transparent;
}

.card-content div {
    line-height: 1.6;
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.card-content div::-webkit-scrollbar {
    width: 6px;
}

.card-content div::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.card-content div::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.card-content div::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.card-actions-cell {
    white-space: nowrap;
    text-align: right;
}

.btn-small {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.btn-edit {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border: 1px solid #93c5fd;
    margin-right: 8px;
}
.btn-edit:hover { 
    background: linear-gradient(135deg, #bfdbfe, #93c5fd);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.btn-delete {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.btn-delete:hover { 
    background: linear-gradient(135deg, #fecaca, #fca5a5);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.2);
}

.search-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
}
.search-input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
}

.pagination-controls button {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.pagination-controls button:hover:not(:disabled) {
    background-color: #f3f4f6;
    border-color: #9ca3af;
    color: #1f2937;
}
.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f3f4f6;
}

/* Modal Improvements */
.modal {
    max-width: 600px;
    width: 90%;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@media (max-width: 640px) {
    .cards-table th:nth-child(2), 
    .cards-table td:nth-child(2) {
        display: none; /* Hide answer column on mobile */
    }
    
    .card-actions-cell {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-edit { margin-right: 0; }
}

/* Stats Mode Styles */
.stats-mode {
    max-width: 1200px;
    margin: 0 auto;
}

.stats-dashboard {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #ffffff, #f9fafb);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #2563eb;
}

.stat-card h3 {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #2563eb;
    line-height: 1;
}

.decks-stats {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.decks-stats h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px 0;
}

.deck-stats-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deck-stat-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

.deck-stat-item:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.deck-stat-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
}

.mini-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.mini-stats span {
    font-size: 14px;
    color: #6b7280;
    padding: 4px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.stats-header-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .mini-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* My Cards Mode Header Improvements */
.my-cards-mode .anki-header {
    margin-bottom: 30px;
}

.my-cards-mode .header-actions {
    margin-top: 20px;
}

.cards-filters {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.cards-filters input {
    max-width: 400px;
    width: 100%;
}
