/* ===========================
   MODAL PROJET
   =========================== */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(69, 67, 67, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem;
}

/* Overlay pour thème clair */
body[data-theme="light"] .project-modal {
    background: rgba(237, 241, 230, 0.92);
}

.project-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #454343;
    border: 2px solid var(--color-border-strong);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-accent), 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Fond plus clair et plus net pour le thème clair */
body[data-theme="light"] .modal-content {
    background: var(--color-surface-solid);
    box-shadow: var(--shadow-accent), 0 20px 60px rgba(65, 75, 59, 0.15);
}

.project-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Barre de défilement personnalisée */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--color-surface);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--color-border-strong);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Header du modal */
.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5rem;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 99, 99, 0.25);
    border-color: rgba(255, 99, 99, 0.5);
    color: #ff6363;
    transform: rotate(90deg);
}

body[data-theme="light"] .modal-close:hover {
    background: rgba(255, 99, 99, 0.15);
}

.modal-title {
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-weight: 400;
    padding-right: 3rem;
}

.modal-language {
    color: var(--accent-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Body du modal */
.modal-body {
    padding: 2rem;
}

.modal-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

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

.modal-section-title {
    color: var(--accent-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-section-title::before {
    content: '///';
    color: var(--accent-secondary);
}

/* Technologies */
.modal-technologies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.modal-tech-badge {
    padding: 0.5rem 1rem;
    background: rgba(140, 168, 124, 0.1);
    border: 1px solid var(--color-border-strong);
    color: var(--accent-primary);
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-tech-badge:hover {
    background: rgba(140, 168, 124, 0.25);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(140, 168, 124, 0.2);
}

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

.modal-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.modal-image:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(140, 168, 124, 0.3);
}

/* Fonctionnalités */
.modal-features {
    list-style: none;
    padding: 0;
}

.modal-feature {
    color: var(--text-secondary);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.modal-feature::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

/* Compétences BUT */
.modal-competences {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.competence-card {
    background: rgba(140, 168, 124, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.competence-card:hover {
    border-color: var(--accent-primary);
    background: rgba(140, 168, 124, 0.1);
}

.competence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.competence-code {
    font-weight: 600;
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.competence-level {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.competence-level.level-1 {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

.competence-level.level-2 {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.competence-level.level-3 {
    background: rgba(140, 168, 124, 0.2);
    color: var(--accent-primary);
}

.competence-level.level-4 {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.competence-indicator {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.competence-proof {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.8;
}

.competence-proof strong {
    color: var(--text-secondary);
    opacity: 1;
}

/* Liens */
.modal-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(140, 168, 124, 0.15);
    border: 1px solid var(--color-border-strong);
    color: var(--accent-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.modal-link:hover {
    background: rgba(140, 168, 124, 0.2);
    border-color: rgba(140, 168, 124, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(140, 168, 124, 0.3);
}

.modal-link svg {
    width: 20px;
    height: 20px;
}

.modal-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ===========================
   MODAL EXPÉRIENCE
   =========================== */
.experience-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(69, 67, 67, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem;
}

/* Overlay pour thème clair */
body[data-theme="light"] .experience-modal {
    background: rgba(237, 241, 230, 0.92);
}

.experience-modal.active {
    opacity: 1;
    visibility: visible;
}

/* Utilisation des mêmes styles que project-modal */
.experience-modal .modal-content {
    background: #454343;
    border: 2px solid var(--color-border-strong);
    border-radius: 16px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-accent), 0 20px 60px rgba(0, 0, 0, 0.3);
}

body[data-theme="light"] .experience-modal .modal-content {
    background: var(--color-surface-solid);
    box-shadow: var(--shadow-accent), 0 20px 60px rgba(65, 75, 59, 0.15);
}

.experience-modal.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Subtitle spécifique pour expérience */
.experience-modal .modal-subtitle {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.experience-modal .modal-company {
    color: var(--accent-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}

.experience-modal .modal-period {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Style spécifique pour les réalisations */
.modal-achievements {
    padding-left: 0;
}

.modal-achievements li {
    padding: 0.6rem 0;
    padding-left: 2rem;
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-achievements li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-size: 1.3rem;
    font-weight: bold;
}

/* Responsive pour modal expérience */
@media (max-width: 768px) {
    .experience-modal {
        padding: 1rem;
    }

    .experience-modal .modal-content {
        max-height: 95vh;
    }

    .experience-modal .modal-subtitle {
        gap: 0.2rem;
    }

    .experience-modal .modal-company {
        font-size: 1rem;
    }

    .experience-modal .modal-period {
        font-size: 0.85rem;
    }
}
