/* Admin Console Styles */

/* Question form styles */
.large-modal .modal-content {
    max-width: 1800px;
    max-height: 90vh;
    overflow-y: auto;
    width: 95%;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #f8f9fa;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: #495057;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.answer-item {
    padding: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
}

.answer-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

.answer-header label {
    font-weight: 600;
    margin: 0;
}

.correct-label {
    font-size: 0.9rem;
    color: #28a745;
}

.answer-image {
    margin-top: 0.5rem;
}

.question-type {
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.type-a {
    background: #007bff; /* Blue for Type A */
    color: white;
}

.type-k,
.type-kprim {
    background: #ff8c00; /* Orange for K-Prim */
    color: white;
}

.subject-badge {
    background: #28a745; /* Green for subjects */
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

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

.questions-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

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

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

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

.btn-danger:hover {
    background: #c82333;
}

.admin-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-login {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
    padding: 2rem;
}

.admin-dashboard {
    flex: 1;
    padding: 0;
}

.admin-header {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.admin-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn.active {
    background: #3498db;
    border-color: #3498db;
}

.logout-btn {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
}

.logout-btn:hover {
    background: #c0392b !important;
}

.admin-section {
    padding: 2rem;
}

.admin-section h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

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

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

.stat-card h3 {
    margin: 0 0 1rem 0;
    color: #7f8c8d;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

.stats-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.stat-detail-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-detail-card h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.subject-stats .subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.subject-stats .subject-item:last-child {
    border-bottom: none;
}

.recent-activity .activity-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #ecf0f1;
}

.recent-activity .activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* Users Management Section */
.users-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.users-controls input {
    flex: 1;
    min-width: 250px;
}

.users-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
    table-layout: fixed;
}

/* Column width definitions */
.users-table th:nth-child(1), .users-table td:nth-child(1) { width: 60px; }   /* DB ID */
.users-table th:nth-child(2), .users-table td:nth-child(2) { width: 70px; }   /* User # */
.users-table th:nth-child(3), .users-table td:nth-child(3) { width: 200px; }  /* Email */
.users-table th:nth-child(4), .users-table td:nth-child(4) { width: 110px; }  /* Nom */
.users-table th:nth-child(5), .users-table td:nth-child(5) { width: 110px; }  /* Prénom */
.users-table th:nth-child(6), .users-table td:nth-child(6) { width: 100px; }  /* Email Vérifié */
.users-table th:nth-child(7), .users-table td:nth-child(7) { width: 170px; }  /* Statut de l'abo */
.users-table th:nth-child(8), .users-table td:nth-child(8) { width: 130px; }  /* Compte créé le */
.users-table th:nth-child(9), .users-table td:nth-child(9) { width: 100px; }  /* Actions */

.users-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #2c3e50;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.users-table tr:hover {
    background: #f8f9fa;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-paid {
    background: #d1ecf1;
    color: #0c5460;
}

.status-unpaid {
    background: #fff3cd;
    color: #856404;
}

.status-verified {
    background: #d4edda;
    color: #155724;
}

.status-unverified {
    background: #f8d7da;
    color: #721c24;
}

.action-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    margin-right: 0.25rem;
}

.action-btn:hover {
    background: #2980b9;
}

.action-btn.danger {
    background: #e74c3c;
}

.action-btn.danger:hover {
    background: #c0392b;
}

/* Small table buttons */
.btn.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    margin-right: 0.25rem;
    background: #3498db;
    color: white;
}

.btn.btn-sm:hover {
    background: #2980b9;
}

.btn.btn-sm.btn-danger {
    background: #e74c3c;
}

.btn.btn-sm.btn-danger:hover {
    background: #c0392b;
}

/* Subjects table styling */
.subjects-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.subjects-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
    table-layout: fixed;
}

/* Column width definitions for subjects table */
.subjects-table th:nth-child(1), .subjects-table td:nth-child(1) { width: 80px; }   /* ID */
.subjects-table th:nth-child(2), .subjects-table td:nth-child(2) { width: 100px; }  /* Code */
.subjects-table th:nth-child(3), .subjects-table td:nth-child(3) { width: auto; }   /* Nom (flexible) */
.subjects-table th:nth-child(4), .subjects-table td:nth-child(4) { width: 150px; }  /* Nombre questions */
.subjects-table th:nth-child(5), .subjects-table td:nth-child(5) { width: 150px; }  /* Actions */

.subjects-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #2c3e50;
}

.subjects-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.subjects-table tr:hover {
    background: #f8f9fa;
}

.subjects-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Questions table layout optimization */
.questions-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.questions-table th:nth-child(1), .questions-table td:nth-child(1) { width: 80px; }   /* N° Question */
.questions-table th:nth-child(2), .questions-table td:nth-child(2) { width: 150px; }  /* Sujet */
.questions-table th:nth-child(3), .questions-table td:nth-child(3) { width: 100px; }  /* Type */
.questions-table th:nth-child(4), .questions-table td:nth-child(4) { width: auto; }   /* Énoncé (flexible) */
.questions-table th:nth-child(5), .questions-table td:nth-child(5) { width: 120px; }  /* Actions (reduced) */

.questions-table th,
.questions-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.questions-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* Sortable column headers */
.questions-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

.questions-table th.sortable:hover {
    background-color: #e9ecef;
}

.questions-table th.sortable .sort-indicator {
    position: absolute;
    right: 0.5rem;
    color: #6c757d;
    font-size: 0.8em;
}

.questions-table th.sortable.active .sort-indicator {
    color: #007bff;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

.modal-content h2 {
    margin-top: 0;
    color: #2c3e50;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #aaa;
    float: right;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

.checkbox-group {
    margin: 1rem 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.modal-actions button {
    flex: 1;
    min-width: 100px;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

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

.btn-danger:hover {
    background: #c82333;
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Preview Section - Match Training Frontend */
.preview-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

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

.preview-content {
    min-height: 300px;
}

/* Question Container - Training Frontend Styles */
.question-container.preview-mode {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border-left: 4px solid #3498db;
}

.question-progress {
    flex: 1;
}

.question-number {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: block;
}

.progress-bar {
    width: 200px;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    transition: width 0.3s ease;
}

.question-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.question-subject {
    background: #28a745;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.question-type {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.question-enonce {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.question-enonce p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.question-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.question-instructions {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #e3f2fd;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.question-instructions p {
    margin: 0;
    font-size: 1rem;
    color: #2c3e50;
}

/* Answers Grid */
.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.answer-card {
    background: white;
    border: 3px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
}

.answer-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.answer-card.preview-correct {
    border-color: #27ae60;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
}

.answer-card.correct {
    border-color: #27ae60 !important;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
}

.answer-card.incorrect {
    border-color: #e74c3c !important;
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%) !important;
}

.answer-card.correct-unselected {
    border-color: #27ae60 !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-style: dashed !important;
}

.answer-letter {
    position: absolute;
    top: -10px;
    left: 15px;
    background: #3498db;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.answer-card.correct .answer-letter {
    background: #27ae60;
}

.answer-card.incorrect .answer-letter {
    background: #e74c3c;
}

.answer-card.correct-unselected .answer-letter {
    background: #27ae60;
}

.answer-content {
    flex: 1;
    padding-top: 0.5rem;
}

.answer-content p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #2c3e50;
}

.answer-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 0.5rem 0;
}

.answer-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #3498db;
    font-weight: bold;
}

.answer-card.correct .answer-indicator {
    color: #27ae60;
}

.answer-card.incorrect .answer-indicator {
    color: #e74c3c;
}

.answer-card.correct-unselected .answer-indicator {
    color: #27ae60;
}

/* Correction Zone */
.correction-zone {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border-left: 4px solid #28a745;
}

.correction-zone h3 {
    color: #28a745;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.correction-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.explanation {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
    font-style: italic;
}

.correction-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Answer correction inline */
.answer-correction {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.4;
}

/* Make answer text grey when correction is shown */
.answer-card.correct .answer-content p,
.answer-card.incorrect .answer-content p,
.answer-card.correct-unselected .answer-content p {
    color: #7f8c8d;
}

/* General correction */
.general-correction {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    border-left: 4px solid #28a745;
}

/* Responsive for preview */
@media (max-width: 768px) {
    .answers-grid {
        grid-template-columns: 1fr;
    }
}

/* Import Section Styles */
.import-instructions {
    background: #e3f2fd;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid #2196f3;
}

.import-instructions details {
    margin-top: 1rem;
}

.import-instructions summary {
    cursor: pointer;
    font-weight: 600;
    color: #2196f3;
}

.import-instructions pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 0.5rem;
}

.import-instructions code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

.import-upload-zone {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.upload-card {
    background: white;
    padding: 2rem;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    text-align: center;
}

.upload-card h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.upload-card input[type="file"] {
    margin: 1rem 0;
}

.file-status {
    margin-top: 1rem;
    min-height: 24px;
}

.status-success {
    color: #28a745;
    font-weight: 600;
}

.status-error {
    color: #dc3545;
    font-weight: 600;
}

.upload-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.import-progress {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db 0%, #2ecc71 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.import-preview {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.question-number-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background: #e3f2fd;
    border-radius: 8px;
    display: inline-block;
}

.preview-content-wrapper {
    margin: 2rem 0;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1rem;
    background: #f8f9fa;
}

.image-reference {
    background: #fff3cd;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border-left: 4px solid #ffc107;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.import-validation-errors {
    background: #f8d7da;
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.import-validation-errors h4 {
    color: #721c24;
    margin-top: 0;
}

.import-validation-errors ul {
    margin: 0;
    padding-left: 1.5rem;
}

.import-validation-errors li {
    color: #721c24;
    margin: 0.5rem 0;
}

.import-preview-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.import-summary {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    text-align: center;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.summary-card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid #dee2e6;
}

.summary-card.success {
    background: #d4edda;
    border-color: #28a745;
}

.summary-card.error {
    background: #f8d7da;
    border-color: #dc3545;
}

.summary-number {
    font-size: 3rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.summary-card.success .summary-number {
    color: #28a745;
}

.summary-card.error .summary-number {
    color: #dc3545;
}

.summary-label {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-header {
        padding: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .admin-nav {
        justify-content: center;
    }

    .admin-section {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

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

    .users-controls {
        flex-direction: column;
    }

    .users-controls input {
        min-width: auto;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }
}

/* Inline Question Editor */
.inline-editor {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.editor-header {
    background: #f8f9fa;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-header h2 {
    margin: 0;
    color: #2c3e50;
}

.editor-actions {
    display: flex;
    gap: 1rem;
}

.inline-editor .form-section {
    margin: 0;
    background: transparent;
    border: none;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.inline-editor .form-section:last-of-type {
    border-bottom: none;
}

.form-actions {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Preview Section */
.preview-section {
    background: #ffffff;
    border: 2px solid #3498db;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.preview-header {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h2 {
    margin: 0;
}

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

.preview-nav .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.preview-nav .btn:hover,
.preview-nav .btn.active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.preview-content {
    padding: 2rem;
    min-height: 400px;
}

/* Preview Question Styling */
.preview-question {
    max-width: 800px;
    margin: 0 auto;
}

.preview-question .question-header {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.preview-question .question-enonce {
    margin-bottom: 1.5rem;
}

.preview-question .answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.preview-question .answer-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    position: relative;
    transition: all 0.3s ease;
}

.preview-question .answer-card.correct {
    border-color: #27ae60;
    background: #f8fff9;
}

.preview-question .answer-card.incorrect {
    border-color: #e74c3c;
    background: #fff8f8;
}

.preview-question .answer-letter {
    position: absolute;
    top: -10px;
    left: 15px;
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.preview-question .answer-content {
    padding-top: 0.5rem;
}

.preview-question .answer-correction {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
    color: #2c3e50;
}

.preview-question .general-correction {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 1rem;
}

/* Error and Success Messages */
.alert {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Subscription Management Styles */
.subscription-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.control-group input,
.control-group select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.quick-actions {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.quick-actions h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.action-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.action-group:last-child {
    margin-bottom: 0;
}

.action-group input[type="email"] {
    flex: 1;
    min-width: 250px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.subscriptions-table-container {
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
}

.subscriptions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 800px;
}

.subscriptions-table th,
.subscriptions-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.subscriptions-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.subscription-status {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.status-never {
    background: #e2e3e5;
    color: #6c757d;
}

.status-inactive-recent {
    background: #fff3cd;
    color: #856404;
}

.status-inactive-old {
    background: #f8d7da;
    color: #721c24;
}

.days-remaining {
    font-weight: 600;
}

.days-warning {
    color: #856404;
}

.days-danger {
    color: #721c24;
}