/* Variables pour le thème sombre */
:root {
    --bg-dark: #1a1a1a;
    --bg-darker: #141414;
    --text-light: #e0e0e0;
    --text-muted: #888;
    --border-color: #333;
    --card-bg: #242424;
    --primary-color: #3b82f6;
    --hover-color: #2563eb;
}

/* Styles généraux */
body {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* Styles spécifiques pour skills.php */
.skill-item {
    color: var(--text-light) !important;
}

.skill-description {
    color: var(--text-light) !important;
}

/* Styles pour la page de login */
.login-container {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.login-container h2 {
    color: var(--text-light);
}

.login-form label {
    color: var(--text-light);
}

/* Correction des textes gris */
.text-muted, 
.text-secondary,
.text-body-secondary {
    color: var(--text-light) !important;
}

/* Style pour les labels et textes des formulaires */
label, 
.form-label,
.form-text {
    color: var(--text-light);
}

/* Navigation */
.navbar {
    background-color: var(--bg-darker) !important;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand, .nav-link {
    color: var(--text-light) !important;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* Cards et conteneurs */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.card-header {
    background-color: var(--bg-darker);
    border-bottom: 1px solid var(--border-color);
}

/* Formulaires */
.form-control, .form-select {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-darker);
    border-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.25);
}

/* Tableaux */
.table {
    color: var(--text-light);
}

.table th {
    background-color: var(--bg-darker);
}

.table td {
    border-color: var(--border-color);
}

/* Boutons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
}

/* Modales */
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

.modal-header, .modal-footer {
    border-color: var(--border-color);
}

/* Pagination */
.page-link {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-light);
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Placeholders */
::placeholder {
    color: var(--text-muted) !important;
    opacity: 1;
}

/* Styles pour les alertes flottantes */
.alert {
    z-index: 1050;
    max-width: 300px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Styles pour les aperçus d'icônes */
.icon-preview {
    font-size: 1.5rem;
    color: #0d6efd;
    min-height: 2rem;
}

/* Animation pour les alertes */
.alert.fade {
    transition: opacity 0.15s linear;
}

.alert.fade.show {
    opacity: 1;
}

/* Styles pour les boutons d'action */
.btn-action {
    padding: 0.25rem 0.5rem;
    margin: 0 0.25rem;
}

/* Styles pour le tableau responsive */
.table-responsive {
    margin-bottom: 1rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

/* Hover effect sur les lignes du tableau */
.table tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

.icon-select option {
    font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands', sans-serif;
}

.form-text i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
    color: #0d6efd;
}

.icon-select {
    margin-bottom: 0.5rem;
}

/* Styles pour TinyMCE */
.tox-tinymce {
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

/* Styles pour Dropzone */
.dropzone {
    border: 2px dashed #dee2e6;
    border-radius: 0.375rem;
    padding: 20px;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.dropzone:hover {
    border-color: #0d6efd;
    background: #f1f8ff;
}

.dropzone .dz-message {
    margin: 2em 0;
    font-size: 1.2em;
    color: #6c757d;
}

.dropzone .dz-preview {
    margin: 10px;
}

/* Styles pour la galerie dans la modal */
.project-gallery {
    margin: 2rem 0;
}

.project-gallery img {
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.project-gallery img:hover {
    transform: scale(1.05);
}

/* Modal d'image en plein écran */
.modal-xl .modal-body {
    padding: 0;
    background: #000;
    border-radius: 0.5rem;
    overflow: hidden;
}

.modal-xl .modal-body img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 90vh;
}

/* Styles pour la description détaillée */
.detailed-description {
    font-size: 1.1rem;
    line-height: 1.8;
}

.detailed-description img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.detailed-description h2,
.detailed-description h3 {
    margin: 1.5rem 0 1rem;
    color: #0d6efd;
}

.detailed-description ul,
.detailed-description ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.detailed-description blockquote {
    border-left: 4px solid #0d6efd;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #6c757d;
}

/* Ajustements pour le mode sombre */
@media (prefers-color-scheme: dark) {
    .dropzone {
        background: #2b3035;
        border-color: #495057;
    }

    .dropzone:hover {
        background: #343a40;
        border-color: #0d6efd;
    }

    .dropzone .dz-message {
        color: #adb5bd;
    }

    .detailed-description {
        color: #e9ecef;
    }

    .detailed-description blockquote {
        color: #adb5bd;
    }
}

/* Styles modernes pour le contraste élevé */
@media (forced-colors: active) {
    /* Styles de base */
    * {
        border-color: currentColor;
    }

    /* Styles spécifiques pour les éléments d'interface */
    .btn,
    .card,
    .modal-content,
    .form-control,
    .alert {
        border: 1px solid currentColor;
    }

    /* Styles pour les images et icônes */
    img {
        -ms-high-contrast-adjust: none;
        background-color: transparent;
    }

    .fas,
    .fa-solid {
        -ms-high-contrast-adjust: none;
        color: currentColor;
    }

    /* Styles pour les éléments interactifs */
    .btn:hover,
    .btn:focus {
        outline: 2px solid currentColor;
    }
}

/* Fallback pour les navigateurs plus anciens */
@media screen and (-ms-high-contrast: active) {
    * {
        border-color: windowText;
    }

    .btn,
    .card,
    .modal-content,
    .form-control,
    .alert {
        border: 1px solid windowText;
    }

    .btn:hover,
    .btn:focus {
        outline: 2px solid windowText;
    }
}

/* Styles spécifiques pour la table des compétences */
.table tbody tr:hover {
    background-color: var(--bg-darker);
}

.table th,
.table td {
    color: var(--text-light) !important;
}

/* Style spécifique pour la page de login */
body.login-page {
    background-color: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-page .card {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

.login-page .card-header {
    background-color: var(--bg-darker);
    border-bottom-color: var(--border-color);
    color: var(--text-light);
} 