/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--gray-100);
    color: var(--gray-900);
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-admin {
    background: var(--gray-700);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s;
}

.btn-admin:hover {
    background: var(--gray-900);
}

/* Search Box */
.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 0 1rem;
    transition: all 0.2s;
}

.search-box:focus-within {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 0;
    font-size: 0.95rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--gray-500);
}

.search-shortcut {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: inherit;
    border: none;
}

/* Search Results */
.search-view {
    animation: fadeIn 0.2s ease-out;
}

.search-result-item {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
}

.search-result-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.search-result-question {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.search-result-question .highlight {
    background: #fef3c7;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

.search-result-path {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.search-result-path .category-badge {
    background: var(--gray-100);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.search-result-excerpt {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.5;
    max-height: 3em;
    overflow: hidden;
}

.search-result-excerpt .highlight {
    background: #fef3c7;
    padding: 0.1rem 0.2rem;
    border-radius: 2px;
}

.search-stats {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.no-results .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: var(--gray-300);
}

/* Main container */
.main-container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.category-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.category-card .name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.category-card .count {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* Sections Grid */
.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.section-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}

.section-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.section-card .section-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.section-card .section-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.section-card .section-count {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
}

.breadcrumb span {
    color: var(--gray-700);
    font-weight: 600;
}

/* Questions List */
.questions-container {
    margin-top: 1.5rem;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.question-item {
    background: white;
    border-radius: var(--radius-sm);
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid transparent;
}

.question-item:hover {
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.question-item.top-1 {
    border-left: 4px solid #fbbf24;
    background: linear-gradient(90deg, #fffbeb 0%, white 20%);
}

.question-item.top-2 {
    border-left: 4px solid #9ca3af;
    background: linear-gradient(90deg, #f9fafb 0%, white 20%);
}

.question-item.top-3 {
    border-left: 4px solid #d97706;
    background: linear-gradient(90deg, #fef3c7 0%, white 20%);
}

.question-text {
    font-size: 1rem;
    color: var(--gray-900);
    flex: 1;
}

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

.question-rank {
    font-size: 0.8rem;
    color: var(--gray-500);
    background: var(--gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.question-rank.gold {
    background: #fef3c7;
    color: #92400e;
}

.question-rank.silver {
    background: #f3f4f6;
    color: #4b5563;
}

.question-rank.bronze {
    background: #ffedd5;
    color: #9a3412;
}

.question-clicks {
    font-size: 0.85rem;
    color: var(--gray-500);
    min-width: 80px;
    text-align: right;
}

/* Solution View */
.solution-content {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.solution-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

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

.solution-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.solution-section .content {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    line-height: 1.7;
    color: var(--gray-700);
}

.solution-section .content p {
    margin-bottom: 0.5rem;
}

.solution-section .content ul,
.solution-section .content ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.solution-section .content li {
    margin-bottom: 0.25rem;
}

.solution-section .content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 0.75rem 0;
    box-shadow: var(--shadow-sm);
}

.solution-section .content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 1rem 0 0.5rem 0;
}

.solution-section .content pre {
    background: var(--gray-200);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.solution-section .content a {
    color: var(--primary);
    text-decoration: underline;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}

.modal {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-login {
    max-width: 400px;
}

.login-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.login-error.hidden {
    display: none;
}

/* Shake animation for wrong password */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-close:hover {
    color: var(--gray-900);
}

/* Form */
.question-form {
    padding: 1.5rem;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: border-color 0.15s;
    font-family: inherit;
}

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

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.categories-grid .category-card,
.sections-grid .section-card,
.questions-list .question-item {
    animation: fadeIn 0.2s ease-out;
}

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

    .header h1 {
        font-size: 1.25rem;
    }

    .main-container {
        padding: 1rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

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

    .category-card .icon {
        font-size: 2.5rem;
    }

    .sections-grid {
        grid-template-columns: 1fr;
    }

    .question-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .question-meta {
        width: 100%;
        justify-content: space-between;
    }
}

/* Color variants for categories */
.category-card[data-color="blue"] { border-bottom: 4px solid #3b82f6; }
.category-card[data-color="green"] { border-bottom: 4px solid #10b981; }
.category-card[data-color="orange"] { border-bottom: 4px solid #f59e0b; }
.category-card[data-color="red"] { border-bottom: 4px solid #ef4444; }
.category-card[data-color="purple"] { border-bottom: 4px solid #8b5cf6; }
.category-card[data-color="pink"] { border-bottom: 4px solid #ec4899; }
.category-card[data-color="cyan"] { border-bottom: 4px solid #06b6d4; }
.category-card[data-color="yellow"] { border-bottom: 4px solid #eab308; }

/* Section color variants */
.section-card[data-type="logiciel"] { border-left-color: #3b82f6; }
.section-card[data-type="materiel"] { border-left-color: #10b981; }
.section-card[data-type="autre"] { border-left-color: #f59e0b; }

/* Total Questions Badge */
.total-questions-badge {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 1rem;
    box-shadow: var(--shadow-sm);
}

/* Edit Button */
.btn-edit-question {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

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

/* Modal Edit */
.modal-edit {
    max-width: 700px;
    width: 95%;
}

.modal-edit textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    transition: border-color 0.2s;
}

.modal-edit textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-edit .form-group {
    margin-bottom: 1.25rem;
}

.modal-edit label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
}

/* Solution Header with Edit Button */
.solution-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.solution-header-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
}

.solution-header .solution-title {
    flex: 1;
    margin: 0;
}

/* Question Card Edit Button */
.question-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-card .btn-edit-small {
    background: transparent;
    border: none;
    color: var(--gray-400);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.15s;
}

.question-card:hover .btn-edit-small {
    opacity: 1;
}

.question-card .btn-edit-small:hover {
    background: var(--primary);
    color: white;
}

/* ==================== DOCUMENTATION STYLES ==================== */

/* Documentation Section Card */
.section-card[data-type="documentation"] {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.section-card[data-type="documentation"] .section-icon {
    color: #8b5cf6;
}

/* Documentation View */
.documentation-view {
    padding: 1rem;
}

.docs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.docs-header h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin: 0;
}

.btn-add-doc {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-add-doc:hover {
    background: var(--primary-dark);
}

/* Documentation Filters */
.docs-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.doc-filter {
    background: white;
    border: 2px solid var(--gray-200);
    color: var(--gray-600);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.doc-filter:hover {
    border-color: var(--primary);
    color: var(--primary);
}

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

/* Documentation Grid */
.documentation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Document Card */
.doc-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.doc-card-thumbnail {
    height: 140px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.doc-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.doc-card-thumbnail.pdf { background: linear-gradient(135deg, #fef2f2, #fee2e2); }
.doc-card-thumbnail.image { background: linear-gradient(135deg, #f0fdf4, #dcfce7); }
.doc-card-thumbnail.video { background: linear-gradient(135deg, #eff6ff, #dbeafe); }
.doc-card-thumbnail.link { background: linear-gradient(135deg, #fefce8, #fef9c3); }

.doc-type-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
}

.doc-card-content {
    padding: 1rem;
}

.doc-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card-description {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
    font-size: 0.75rem;
    color: var(--gray-400);
}

.doc-card-actions {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.doc-card:hover .doc-card-actions {
    opacity: 1;
}

.btn-doc-action {
    background: rgba(255,255,255,0.9);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
}

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

.btn-doc-action.delete:hover {
    background: var(--danger);
}

/* No Documents Message */
.no-documents {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.no-documents-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Document Preview View */
.doc-preview-view {
    padding: 1rem;
}

.doc-preview-content {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.doc-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.doc-preview-title {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin: 0;
}

.doc-preview-description {
    color: var(--gray-600);
    margin: 1rem 0;
    line-height: 1.6;
}

.doc-preview-embed {
    margin: 1.5rem 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--gray-900);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.doc-preview-embed iframe {
    width: 100%;
    height: calc(100vh - 300px);
    min-height: 600px;
    max-height: 900px;
    border: none;
    display: block;
}

.doc-preview-embed img {
    max-width: 100%;
    max-height: calc(100vh - 300px);
    height: auto;
    display: block;
    margin: 0 auto;
    background: white;
    padding: 1rem;
}

.doc-preview-embed video {
    width: 100%;
    max-height: calc(100vh - 300px);
    background: black;
}

/* PDF toolbar hint */
.doc-preview-hint {
    background: var(--gray-100);
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.doc-preview-hint a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.doc-preview-hint a:hover {
    text-decoration: underline;
}

.doc-preview-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-open-external {
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.2s;
}

.btn-open-external:hover {
    background: var(--primary-dark);
}

/* Form additions for doc modal */
.modal-edit select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

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

.modal-edit input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--gray-50);
    cursor: pointer;
}

.modal-edit input[type="file"]:hover {
    border-color: var(--primary);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Responsive for documentation */
/* Drop Zone for Drag & Drop */
.drop-zone {
    border: 3px dashed var(--gray-300);
    border-radius: var(--radius);
    background: var(--gray-50);
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.01);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-zone-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.drop-zone-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.drop-zone-hint {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.drop-zone.uploading {
    opacity: 0.7;
    pointer-events: none;
}

.drop-zone.uploading .drop-zone-text::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Upload Progress */
.upload-progress {
    margin-top: 1rem;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.upload-progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-text {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
}

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

    .docs-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }

    .doc-preview-embed iframe {
        height: 400px;
    }

    .drop-zone {
        padding: 2rem 1rem;
    }

    .drop-zone-icon {
        font-size: 2.5rem;
    }
}

/* Checkbox Validé Styles */
.form-group-checkbox {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--success);
    border-color: var(--success);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-text {
    font-size: 0.95rem;
    color: var(--gray-700);
}

/* Validated Badge on Questions */
.question-validated-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.question-not-validated-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Quick Upload Modal */
.quick-upload-section {
    padding: 1rem 0;
}

.quick-upload-info {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.quick-upload-file-preview {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quick-upload-file-icon {
    font-size: 2.5rem;
}

.quick-upload-file-info {
    flex: 1;
}

.quick-upload-file-name {
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.quick-upload-file-size {
    font-size: 0.85rem;
    color: var(--gray-500);
}
