
body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
}

.app-container {
    max-width: 900px;
    margin: 2rem auto;
    background-color: white;
    border-radius: 0.5rem;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    position: relative;
}

.view {
    display: none;
    padding: 1.5rem 2rem;
}

.view.active {
    display: block;
}

#login-view {
    max-width: 450px;
    margin: 4rem auto;
    padding: 2.5rem;
    border: none;
    border-radius: 0.75rem;
    background-color: #fff;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

#login-view label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4b5563;
}

#login-view input[type="text"],
#login-view input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#login-view input[type="text"]:focus,
#login-view input[type="password"]:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

#login-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    text-align: center;
    min-height: 1.25em;
}

#login-form button {
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    font-size: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

#app-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #fff;
}

#user-info span {
    font-weight: 600;
    color: #1f2937;
}

#navigation-view .nav-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 1rem;
}

#side-action-bar {
    position: fixed;
    top: 100px;
    right: 15px;
    width: 52px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-right: none;
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
    box-shadow: -3px 3px 8px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    transition: width 0.25s ease-in-out;
    overflow: hidden;
}

#side-action-bar:hover {
    width: 240px;
}

.side-action-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: #374151;
}

.side-action-item:hover {
    background-color: #f0f9ff;
}

.side-action-item img {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.side-action-item span {
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease-in-out 0.1s;
}

#side-action-bar:hover .side-action-item span {
    opacity: 1;
}

#side-action-bar label.side-action-item {
    display: flex;
}

#nav-filter-bar {
    background-color: #f9fafb;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    border: 1px solid #e5e7eb;
}

#nav-filter-bar input,
#nav-filter-bar select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

#nav-filter-bar input[type="search"] {
    flex-grow: 1;
    min-width: 150px;
}

.nav-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    border: 1px solid transparent;
}

.nav-group-item:hover {
    background-color: #f9fafb;
    border-color: #e5e7eb;
}

.nav-group-item.group-selected {
    background-color: #e0f2fe;
    border-color: #93c5fd;
}

.group-info {
    flex-grow: 1;
}

.group-name {
    font-weight: 600;
    color: #1e40af;
}

.group-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.group-actions button {
    background: none;
    border: none;
    padding: 0.2rem;
    margin-left: 0.3rem;
    border-radius: 0.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, background-color 0.2s;
}

.group-actions button:hover {
    opacity: 1;
    background-color: #d1d5db;
}

.group-actions img {
    width: 0.9rem;
    height: 0.9rem;
}

.question-in-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-bottom: 1px solid #f3f4f6;
}

.question-in-group-item:last-child {
    border-bottom: none;
}

.question-in-group-item:hover {
    background-color: #f9fafb;
}

.question-in-group-text {
    flex-grow: 1;
    font-size: 0.875rem;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.question-in-group-actions button {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

/* Styles pour la liste de questions par catégorie */
.nav-question-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: 1rem;
    border-radius: 0.375rem;
    padding: 0.25rem 0;
}

.nav-question-item:hover {
    background-color: #f3f4f6;
}

.quick-edit-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
}

.question-title-display {
    cursor: pointer;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-edit-input {
    border: 1px solid #9ca3af;
    border-radius: 0.25rem;
    padding: 0.1rem 0.3rem;
    font-size: 0.875rem;
    flex-grow: 1;
    display: none;
}

.quick-edit-actions button {
    background: none;
    border: none;
    padding: 0.1rem;
    margin-left: 0.1rem;
    border-radius: 0.25rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s, background-color 0.2s;
    line-height: 1;
}

.quick-edit-actions button:hover {
    opacity: 1;
    background-color: #d1d5db;
}

.quick-edit-actions img {
    width: 0.8rem;
    height: 0.8rem;
}

.quick-edit-actions {
    display: none;
}

.nav-question-item.editing .question-title-display,
.nav-question-item.editing .quick-edit-trigger {
    display: none;
}

.nav-question-item.editing .quick-edit-input,
.nav-question-item.editing .quick-edit-actions {
    display: inline-flex;
    align-items: center;
}

.question-selected .quick-edit-container {
    background-color: #e0f2fe !important;
    border-left: 4px solid #0ea5e9;
    padding-left: calc(0.75rem - 4px);
}

.question-selected .question-title-display {
    font-weight: 600;
    color: #0369a1;
}

.nav-actions button {
    background: none;
    border: none;
    padding: 0.25rem;
    margin-left: 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

.nav-actions button:hover {
    opacity: 1;
    background-color: #e5e7eb;
}

.nav-actions img {
    width: 1rem;
    height: 1rem;
    display: inline-block;
    vertical-align: middle;
}

.nav-question-item:hover .nav-actions {
    opacity: 1;
}

details>summary {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-weight: 600;
    list-style: none;
    transition: background-color 0.15s ease-in-out;
}

details>summary:hover {
    background-color: #f3f4f6;
}

details>summary::-webkit-details-marker {
    display: none;
}

details>summary::before {
    content: '▶';
    display: inline-block;
    margin-right: 0.5rem;
    font-size: 0.8em;
    transition: transform 0.2s ease-in-out;
}

details[open]>summary::before {
    transform: rotate(90deg);
}

details[open]>summary {
    background-color: #eef2ff;
}

.difficulty-badge {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 0.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.question-view-header,
.question-edit-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.question-view-actions,
.question-edit-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
}

.editable-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.editable-input:focus {
    border-color: #0ea5e9;
    outline: none;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.3);
}

.difficulty-slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 8px;
    background: #d1d5db;
    border-radius: 5px;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #0ea5e9;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #0ea5e9;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.difficulty-slider-value {
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    background-color: #e0f2fe;
    color: #0c4a6e;
}

.message-box {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    z-index: 100;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.message-box.success {
    background-color: #22c55e;
}

.message-box.error {
    background-color: #ef4444;
}

.message-box.warning {
    background-color: #f59e0b;
    color: #78350f;
}

.message-box.show {
    display: block;
    opacity: 1;
}

.gemini-btn {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    background-color: #fbbf24;
    color: #78350f;
    border: 1px solid #f59e0b;
    cursor: pointer;
    opacity: 0.7;
    margin-left: 0.25rem;
}

.gemini-btn:hover {
    opacity: 1;
}

.gemini-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gemini-btn img {
    vertical-align: middle;
}

#upload-json-input {
    display: none;
}

.explanation-toggle {
    cursor: pointer;
    font-size: 0.75rem;
    color: #0ea5e9;
    margin-left: 0.5rem;
    user-select: none;
}

.explanation-content {
    display: none;
    margin-top: 0.5rem;
    padding-left: 1rem;
    font-size: 0.875rem;
    color: #374151;
    background-color: #f9fafb;
    border-left: 3px solid #d1d5db;
    padding: 0.5rem;
    border-radius: 0.25rem;
}

.explanation-content.visible {
    display: block;
}

.points-display {
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.points-correct {
    background-color: #dcfce7;
    color: #166534;
}

.points-incorrect {
    background-color: #fee2e2;
    color: #991b1b;
}

.points-neutral {
    background-color: #f3f4f6;
    color: #4b5563;
}

#cancel-edit-question-options-btn {
    display: none;
}

.btn {
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.btn:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-primary {
    background-color: #0ea5e9;
    color: white;
}

.btn-primary:hover {
    background-color: #0284c7;
}

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

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-success {
    background-color: #16a34a;
    color: white;
}

.btn-success:hover {
    background-color: #15803d;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

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

.btn-danger:hover {
    background-color: #b91c1c;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    display: none;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    width: 90%;
    max-width: 500px;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.modal-content input[type="text"],
.modal-content select,
.modal-content textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.action-btn {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease-in-out;
}

/* Question edit/delete btn */
.edit-btn {
    color: #0f766e;
    background-color: #ccfbf1;
}

.edit-btn:hover {
    background-color: #99f6e4;
}

.delete-btn {
    color: #991b1b;
    background-color: #fee2e2;
    margin-left: 0.25rem;
}

.delete-btn:hover {
    background-color: #fecaca;
}

.bulk-review-actions button {
    flex-grow: 1;
}