/* ============================
   MODAL PROFIL UTILISATEUR
   Style bleu nuit premium
   ============================ */

#profileModal .modal-profile,
.modal-profile {
    max-width: 360px !important;
    width: 360px !important;
    padding: 1.25rem 1.5rem !important;
    background: linear-gradient(145deg,
            rgba(15, 23, 42, 0.98) 0%,
            rgba(20, 30, 50, 0.98) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 10px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.profile-modal-content {
    text-align: center;
}

#profileModal .profile-avatar,
.profile-avatar {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem !important;
    font-size: 32px !important;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

#profileModal .profile-avatar svg,
.profile-avatar svg {
    width: 40px !important;
    height: 40px !important;
    color: white;
}

#profileModal .profile-modal-content h2,
.profile-modal-content h2 {
    font-size: 20px !important;
    font-weight: 600;
    margin: 0 0 5px !important;
    color: #ffffff !important;
    text-align: center !important;
}

/* Règles spécifiques pour modal profil */
#profileModal .profile-modal-content h2,
#profileModal .profile-main-section h2 {
    color: #ffffff !important;
}

#profileModal .profile-email,
.profile-email {
    font-size: 13px !important;
    color: #94a3b8 !important;
    margin: 0 0 1.25rem !important;
    text-align: center !important;
    word-break: break-word;
}

#profileModal .profile-email {
    color: #94a3b8 !important;
}

.profile-avatar {
    margin: 0 auto 1rem !important;
    display: block !important;
}

.profile-main-section {
    display: flex;
    flex-direction: column;
    align-items: center !important;
}

#profileModal .profile-divider,
.profile-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1) !important;
    margin: 0 0 1.25rem !important;
}

#profileModal .profile-menu,
.profile-menu {
    display: flex;
    flex-direction: column;
    gap: 10px !important;
    padding: 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 24px;
    background: rgba(30, 41, 59, 0.4) !important;
    border: 2px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: 'Sora', sans-serif;
    position: relative;
    overflow: hidden;
}

/* Carte bleue pour Mon Compte */
.profile-menu-item:has(.profile-menu-icon.blue) {
    background: rgba(59, 130, 246, 0.08) !important;
    border: 2px solid rgba(59, 130, 246, 0.4) !important;
}

.profile-menu-item:has(.profile-menu-icon.blue):hover {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

/* Carte orange pour Dashboard */
.profile-menu-item:has(.profile-menu-icon.orange) {
    background: rgba(249, 115, 22, 0.08) !important;
    border: 2px solid rgba(249, 115, 22, 0.4) !important;
}

.profile-menu-item:has(.profile-menu-icon.orange):hover {
    background: rgba(249, 115, 22, 0.12) !important;
    border-color: rgba(249, 115, 22, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.2);
}

/* Carte rouge pour Déconnexion */
.profile-menu-item:has(.profile-menu-icon.red) {
    background: rgba(239, 68, 68, 0.08) !important;
    border: 2px solid rgba(239, 68, 68, 0.4) !important;
}

.profile-menu-item:has(.profile-menu-icon.red):hover {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.2);
}

/* Carte verte pour Admin (si présent) */
.profile-menu-item:has(.profile-menu-icon.green) {
    background: rgba(16, 185, 129, 0.08) !important;
    border: 2px solid rgba(16, 185, 129, 0.4) !important;
}

.profile-menu-item:has(.profile-menu-icon.green):hover {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

/* Carte violette pour Admin avec style inline */
.profile-menu-item:has(.profile-menu-icon[style*="7c3aed"]) {
    background: rgba(124, 58, 237, 0.08) !important;
    border: 2px solid rgba(124, 58, 237, 0.4) !important;
}

.profile-menu-item:has(.profile-menu-icon[style*="7c3aed"]):hover {
    background: rgba(124, 58, 237, 0.12) !important;
    border-color: rgba(124, 58, 237, 0.5) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.2);
}

.profile-menu-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

.profile-menu-icon svg {
    width: 24px;
    height: 24px;
    color: white;
    position: relative;
    z-index: 1;
}

.profile-menu-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    box-shadow:
        0 4px 16px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.profile-menu-item:hover .profile-menu-icon.blue {
    box-shadow:
        0 6px 20px rgba(59, 130, 246, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.profile-menu-icon.orange {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    box-shadow:
        0 4px 16px rgba(249, 115, 22, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.profile-menu-item:hover .profile-menu-icon.orange {
    box-shadow:
        0 6px 20px rgba(249, 115, 22, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.profile-menu-icon.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    box-shadow:
        0 4px 16px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.profile-menu-item:hover .profile-menu-icon.red {
    box-shadow:
        0 6px 20px rgba(239, 68, 68, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.profile-menu-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    box-shadow:
        0 4px 16px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.profile-menu-item:hover .profile-menu-icon.green {
    box-shadow:
        0 6px 20px rgba(16, 185, 129, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.profile-menu-text {
    flex: 1;
}

.profile-menu-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff !important;
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}

#profileModal .profile-menu-title {
    color: #ffffff !important;
}

.profile-menu-subtitle {
    font-size: 12px;
    color: #94a3b8 !important;
    margin: 0;
    line-height: 1.4;
}

/* Sous-modal modifier compte */
.profile-edit-section {
    display: none;
}

.profile-edit-section.active {
    display: block;
}

.profile-main-section.hidden {
    display: none;
}

.profile-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #3b82f6 !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1.5rem;
}

.profile-back-btn:hover {
    opacity: 0.7;
}

.profile-back-btn svg {
    width: 18px;
    height: 18px;
    color: #3b82f6 !important;
}

.profile-form {
    display: grid;
    gap: 14px;
    text-align: left;
}

.profile-form label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-family: 'Sora', sans-serif !important;
    font-weight: 500;
    color: #e2e8f0 !important;
}

.profile-form input {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 15px;
    font-family: 'Sora', sans-serif !important;
    transition: all 0.2s ease;
    color: #f1f5f9 !important;
}

.profile-form input::placeholder {
    color: #64748b !important;
}

.profile-form input:hover {
    border-color: rgba(255, 255, 255, 0.15) !important;
    background: rgba(30, 41, 59, 0.8) !important;
}

.profile-form input:focus {
    outline: none;
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.1) !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

.profile-form .btn-primary {
    margin-top: 8px;
    padding: 14px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: white !important;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.profile-form .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

/* Close button pour modal profil */
#profileModal .modal-close {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

#profileModal .modal-close:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #f1f5f9 !important;
}

/* Override pour modal profil - BLEU NUIT */
#profileModal .modal-content {
    background: linear-gradient(145deg,
            rgba(15, 23, 42, 0.98) 0%,
            rgba(20, 30, 50, 0.98) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0) !important;
}

/* Override shadow pour modal profil */
#profileModal.active .modal-content {
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 10px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

/* ============================
   RESPONSIVE MOBILE
   ============================ */

@media (max-width: 768px) {
    .modal-profile {
        max-width: 70vw;
        width: 70vw;
        padding: 0.75rem 0.75rem;
        max-height: 50vh;
        overflow-y: auto;
    }

    .profile-avatar {
        width: 55px;
        height: 55px;
        font-size: 22px;
        margin: 0 auto 0.4rem !important;
    }

    .profile-modal-content h2,
    #profileModal .profile-modal-content h2 {
        font-size: 16px !important;
        margin: 0 0 2px !important;
    }

    .profile-email,
    #profileModal .profile-email {
        font-size: 11px !important;
        margin: 0 0 0.5rem !important;
    }

    .profile-divider {
        margin: 0 0 0.5rem !important;
    }

    .profile-menu {
        gap: 6px;
        padding: 0;
    }

    .profile-menu-item {
        padding: 9px 18px;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .profile-menu-icon {
        width: 35px;
        height: 35px;
    }

    .profile-menu-icon svg {
        width: 17px;
        height: 17px;
    }

    .profile-menu-title,
    #profileModal .profile-menu-title {
        font-size: 13px !important;
        color: #ffffff !important;
    }

    .profile-menu-subtitle {
        font-size: 10px !important;
    }

    .profile-form {
        gap: 12px;
    }

    .profile-form input {
        padding: 12px 14px;
        font-size: 14px !important;
    }

    .profile-form .btn-primary {
        padding: 12px 18px;
    }
}

@media (max-width: 480px) {
    .modal-profile {
        max-width: 75vw;
        width: 75vw;
        padding: 0.625rem 0.625rem;
        max-height: 48vh;
    }

    .profile-avatar {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin: 0 auto 0.3rem !important;
    }

    .profile-modal-content h2,
    #profileModal .profile-modal-content h2 {
        font-size: 15px !important;
    }

    .profile-email,
    #profileModal .profile-email {
        font-size: 11px !important;
        margin: 0 0 0.6rem !important;
    }

    .profile-divider {
        margin: 0 0 0.6rem !important;
    }

    .profile-menu {
        gap: 5px;
        padding: 0;
    }

    .profile-menu-item {
        padding: 8px 16px;
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }

    .profile-menu-icon {
        width: 33px;
        height: 33px;
    }

    .profile-menu-icon svg {
        width: 16px;
        height: 16px;
    }

    .profile-menu-title,
    #profileModal .profile-menu-title {
        font-size: 13px !important;
        color: #ffffff !important;
    }

    .profile-menu-subtitle {
        font-size: 9px !important;
    }
}


/* ============================
   OVERRIDE FINAL - DIMENSIONS MODAL
   ============================ */

/* Force les dimensions sur desktop */
@media (min-width: 769px) {
    #profileModal .modal-content.modal-profile,
    .modal#profileModal .modal-profile,
    #profileModal .modal-profile {
        max-width: 360px !important;
        width: 360px !important;
        padding: 1.25rem 1.5rem !important;
    }

    #profileModal .profile-avatar {
        width: 80px !important;
        height: 80px !important;
        margin: 0 auto 1rem !important;
        font-size: 32px !important;
    }

    #profileModal .profile-modal-content h2 {
        font-size: 20px !important;
        margin: 0 0 5px !important;
    }

    #profileModal .profile-email {
        font-size: 13px !important;
        margin: 0 0 1.25rem !important;
    }

    #profileModal .profile-divider {
        margin: 0 0 1.25rem !important;
    }

    #profileModal .profile-menu {
        gap: 10px !important;
    }

    #profileModal .profile-menu-item {
        padding: 12px 24px !important;
    }
}
