/**
 * Composants UI Graphik Impact
 *
 * @version 1.0.0
 * @date 2025-12-08
 * @description Modals, Alerts, Badges, Empty States, Password Strength
 * @source Graphik Brand System v1.2.0
 */

/* ============================================
   MODALS STANDARDISÉS
   ============================================ */

/* Overlay Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--gi-z-modal, 1200);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
}

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

/* Panel Modal */
.modal-panel {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 32rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
    transition: transform 200ms ease, opacity 200ms ease;
}

.modal-overlay.active .modal-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Header Modal */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gi-border-primary, #E5E7EB);
}

.modal-title {
    font-family: var(--gi-font-primary);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gi-text-primary, #000000);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--gi-text-tertiary, #9CA3AF);
    transition: color 200ms ease, background 200ms ease;
}

.modal-close:hover {
    color: var(--gi-text-primary, #000000);
    background: var(--gi-bg-tertiary, #F3F4F6);
}

/* Body Modal */
.modal-body {
    padding: 1.5rem;
}

/* Footer Modal */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gi-border-primary, #E5E7EB);
    background: var(--gi-bg-secondary, #F9FAFB);
    border-radius: 0 0 1rem 1rem;
}

/* Modal Sizes */
.modal-panel.modal-sm { max-width: 24rem; }
.modal-panel.modal-lg { max-width: 48rem; }
.modal-panel.modal-xl { max-width: 64rem; }
.modal-panel.modal-full { max-width: 95vw; max-height: 95vh; }

/* Modal de Confirmation Danger */
.modal-danger .modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: var(--gi-error, #EF4444);
    margin: 0 auto 1rem;
}

/* Modal Warning */
.modal-warning .modal-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--gi-warning, #F59E0B);
}

/* ============================================
   ALERTS FLASH
   ============================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid;
    margin-bottom: 1rem;
    font-family: var(--gi-font-secondary);
    font-size: 0.875rem;
    line-height: 1.5;
}

.alert-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-family: var(--gi-font-primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-dismiss {
    flex-shrink: 0;
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 200ms ease;
}

.alert-dismiss:hover {
    opacity: 1;
}

/* Alert Success */
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #065F46;
}

.alert-success .alert-icon { color: var(--gi-success, #10B981); }

/* Alert Error */
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #991B1B;
}

.alert-error .alert-icon { color: var(--gi-error, #EF4444); }

/* Alert Warning */
.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #92400E;
}

.alert-warning .alert-icon { color: var(--gi-warning, #F59E0B); }

/* Alert Info */
.alert-info {
    background: rgba(0, 159, 227, 0.1);
    border-color: rgba(0, 159, 227, 0.3);
    color: #1E40AF;
}

.alert-info .alert-icon { color: var(--gi-cyan, #009FE3); }

/* ============================================
   BADGES
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-family: var(--gi-font-primary);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
}

.badge-icon {
    width: 0.75rem;
    height: 0.75rem;
}

/* Badge Variants */
.badge-primary {
    background: rgba(0, 159, 227, 0.15);
    color: #0077B5;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.badge-error {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #D97706;
}

.badge-info {
    background: rgba(78, 120, 188, 0.15);
    color: #3B5998;
}

.badge-neutral {
    background: var(--gi-bg-tertiary, #F3F4F6);
    color: var(--gi-text-secondary, #4B5563);
}

/* Badge Pôles Métiers */
.badge-strategy {
    background: rgba(251, 228, 11, 0.2);
    color: #A16207;
}

.badge-design {
    background: rgba(101, 72, 151, 0.15);
    color: #654897;
}

.badge-web {
    background: rgba(235, 93, 24, 0.15);
    color: #C2410C;
}

.badge-social {
    background: rgba(78, 120, 188, 0.15);
    color: #4E78BC;
}

.badge-photo {
    background: rgba(94, 191, 187, 0.15);
    color: #0D9488;
}

.badge-print {
    background: rgba(226, 14, 126, 0.15);
    color: #BE185D;
}

/* Badge Sizes */
.badge-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
}

.badge-lg {
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
}

/* Badge Counter */
.badge-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    border-radius: 9999px;
    background: var(--gi-cyan, #009FE3);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ============================================
   EMPTY STATES
   ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: var(--gi-bg-tertiary, #F3F4F6);
    color: var(--gi-text-tertiary, #9CA3AF);
    margin-bottom: 1.5rem;
}

.empty-state-icon svg {
    width: 2rem;
    height: 2rem;
}

.empty-state-title {
    font-family: var(--gi-font-primary);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gi-text-primary, #000000);
    margin: 0 0 0.5rem;
}

.empty-state-description {
    font-family: var(--gi-font-secondary);
    font-size: 0.875rem;
    color: var(--gi-text-secondary, #4B5563);
    max-width: 24rem;
    margin: 0 0 1.5rem;
}

.empty-state-action {
    display: flex;
    gap: 0.75rem;
}

/* Empty State Variants */
.empty-state-compact {
    padding: 2rem 1rem;
}

.empty-state-compact .empty-state-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

.empty-state-compact .empty-state-icon svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* ============================================
   PASSWORD STRENGTH INDICATOR
   ============================================ */

.password-strength {
    margin-top: 0.5rem;
}

.password-strength-bars {
    display: flex;
    gap: 0.25rem;
}

.password-strength-bar {
    flex: 1;
    height: 0.25rem;
    border-radius: 9999px;
    background: var(--gi-bg-tertiary, #F3F4F6);
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0;
    border-radius: 9999px;
    transition: width 300ms ease, background-color 300ms ease;
}

/* Strength Levels */
.password-strength[data-strength="0"] .password-strength-bar:nth-child(1) .password-strength-fill {
    width: 100%;
    background: var(--gi-error, #EF4444);
}

.password-strength[data-strength="1"] .password-strength-bar:nth-child(-n+2) .password-strength-fill {
    width: 100%;
    background: #F97316;
}

.password-strength[data-strength="2"] .password-strength-bar:nth-child(-n+3) .password-strength-fill {
    width: 100%;
    background: var(--gi-warning, #F59E0B);
}

.password-strength[data-strength="3"] .password-strength-bar:nth-child(-n+4) .password-strength-fill {
    width: 100%;
    background: #84CC16;
}

.password-strength[data-strength="4"] .password-strength-bar .password-strength-fill {
    width: 100%;
    background: var(--gi-success, #10B981);
}

.password-strength-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.375rem;
    font-family: var(--gi-font-secondary);
    font-size: 0.75rem;
}

.password-strength-text {
    color: var(--gi-text-secondary, #4B5563);
}

.password-strength[data-strength="0"] .password-strength-value { color: var(--gi-error, #EF4444); }
.password-strength[data-strength="1"] .password-strength-value { color: #F97316; }
.password-strength[data-strength="2"] .password-strength-value { color: var(--gi-warning, #F59E0B); }
.password-strength[data-strength="3"] .password-strength-value { color: #84CC16; }
.password-strength[data-strength="4"] .password-strength-value { color: var(--gi-success, #10B981); }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .modal-panel {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer button {
        width: 100%;
    }

    .empty-state {
        padding: 2rem 1rem;
    }
}
