/**
 * CPFA Elementor Widgets Styles
 * 
 * @package CpfaCore
 */

/* ========================================
   Variables CSS
   ======================================== */
:root {
    --cpfa-primary: #2c5aa0;
    --cpfa-secondary: #f8f9fa;
    --cpfa-accent: #28a745;
    --cpfa-danger: #dc3545;
    --cpfa-warning: #ffc107;
    --cpfa-border-radius: 8px;
    --cpfa-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --cpfa-transition: all 0.3s ease;
}

/* ========================================
   Widget Catalogue
   ======================================== */
.cpfa-catalogue-widget {
    margin-bottom: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cpfa-catalogue-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.cpfa-catalogue-filters select,
.cpfa-catalogue-filters input {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--cpfa-border-radius);
    font-size: 1rem;
    transition: var(--cpfa-transition);
    flex: 1;
    min-width: 200px;
}

.cpfa-catalogue-filters select:focus,
.cpfa-catalogue-filters input:focus {
    outline: none;
    border-color: var(--cpfa-primary);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.cpfa-catalogue-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.cpfa-catalogue-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cpfa-catalogue-item {
    background: white;
    border-radius: var(--cpfa-border-radius);
    overflow: hidden;
    box-shadow: var(--cpfa-box-shadow);
    transition: var(--cpfa-transition);
    display: flex;
    flex-direction: column;
}

.cpfa-catalogue-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.cpfa-layout-list .cpfa-catalogue-item {
    flex-direction: row;
}

.cpfa-item-image {
    position: relative;
    overflow: hidden;
}

.cpfa-item-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--cpfa-transition);
}

.cpfa-layout-list .cpfa-item-image img {
    width: 250px;
    height: auto;
}

.cpfa-catalogue-item:hover .cpfa-item-image img {
    transform: scale(1.05);
}

.cpfa-item-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.75rem;
}

.cpfa-item-title {
    color: var(--cpfa-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.cpfa-item-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--cpfa-transition);
}

.cpfa-item-title a:hover {
    color: var(--cpfa-accent);
}

.cpfa-item-excerpt {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.cpfa-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #666;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.cpfa-price {
    font-weight: 600;
    color: var(--cpfa-accent);
    font-size: 1.1rem;
}

.cpfa-duration,
.cpfa-type {
    background: var(--cpfa-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.cpfa-item-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1rem;
}

.cpfa-item-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--cpfa-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: var(--cpfa-border-radius);
    transition: var(--cpfa-transition);
    font-weight: 500;
    text-align: center;
    width: 100%;
    gap: 0.5rem;
}

.cpfa-item-link:hover {
    background: var(--cpfa-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cpfa-pagination {
    text-align: center;
    margin-top: 2rem;
}

.cpfa-load-more {
    background: var(--cpfa-primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--cpfa-border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--cpfa-transition);
}

.cpfa-load-more:hover {
    background: var(--cpfa-accent);
    transform: translateY(-2px);
}

.cpfa-load-more.loading {
    opacity: 0.6;
    cursor: wait;
}

.cpfa-load-more.loading::after {
    content: '...';
    animation: cpfa-dots 1.5s steps(4, end) infinite;
}

/* ========================================
   Widget Recherche
   ======================================== */
.cpfa-search-widget {
    margin-bottom: 2rem;
}

.cpfa-search-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #ddd;
    border-radius: var(--cpfa-border-radius);
    font-size: 1.1rem;
    transition: var(--cpfa-transition);
}

.cpfa-search-input:focus {
    outline: none;
    border-color: var(--cpfa-primary);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1);
}

.cpfa-search-results {
    margin-top: 1.5rem;
}

.cpfa-search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: var(--cpfa-transition);
}

.cpfa-search-result-item:hover {
    background: var(--cpfa-secondary);
}

.cpfa-search-result-title {
    font-weight: 600;
    color: var(--cpfa-primary);
    margin-bottom: 0.5rem;
}

.cpfa-search-no-results {
    text-align: center;
    padding: 2rem;
    color: #999;
}

/* ========================================
   Widget Statistiques
   ======================================== */
.cpfa-stats-widget {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.cpfa-stat-item {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: var(--cpfa-border-radius);
    box-shadow: var(--cpfa-box-shadow);
    transition: var(--cpfa-transition);
}

.cpfa-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.cpfa-counter {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: var(--cpfa-primary);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.cpfa-stat-label {
    font-size: 1.1rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.cpfa-stat-icon {
    font-size: 2.5rem;
    color: var(--cpfa-accent);
    margin-bottom: 1rem;
}

/* ========================================
   Widget Événements à venir
   ======================================== */
.cpfa-upcoming-events-widget {
    background: white;
    border-radius: var(--cpfa-border-radius);
    box-shadow: var(--cpfa-box-shadow);
    padding: 1.5rem;
}

.cpfa-event-item {
    padding: 1.5rem;
    border-left: 4px solid var(--cpfa-primary);
    background: var(--cpfa-secondary);
    margin-bottom: 1rem;
    border-radius: 0 var(--cpfa-border-radius) var(--cpfa-border-radius) 0;
    transition: var(--cpfa-transition);
}

.cpfa-event-item:hover {
    border-left-color: var(--cpfa-accent);
    transform: translateX(5px);
}

.cpfa-event-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--cpfa-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cpfa-event-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.cpfa-event-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

.cpfa-countdown {
    background: var(--cpfa-warning);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--cpfa-border-radius);
    font-weight: 600;
    display: inline-block;
    margin-top: 0.5rem;
}

/* ========================================
   Animations
   ======================================== */
@keyframes cpfa-dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

@keyframes cpfa-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.cpfa-loading {
    animation: cpfa-pulse 1.5s infinite;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .cpfa-catalogue-filters {
        flex-direction: column;
    }
    
    .cpfa-catalogue-grid {
        grid-template-columns: 1fr;
    }
    
    .cpfa-stats-widget {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cpfa-item-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cpfa-layout-list .cpfa-catalogue-item {
        flex-direction: column;
    }
    
    .cpfa-layout-list .cpfa-item-image img {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .cpfa-stats-widget {
        grid-template-columns: 1fr;
    }
    
    .cpfa-counter {
        font-size: 2.5rem;
    }
    
    .cpfa-catalogue-item {
        margin-bottom: 1rem;
    }
}

/* ========================================
   Mode sombre (Dark Mode)
   ======================================== */
@media (prefers-color-scheme: dark) {
    :root {
        --cpfa-secondary: #2d3748;
        --cpfa-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    
    .cpfa-catalogue-item,
    .cpfa-stat-item,
    .cpfa-upcoming-events-widget {
        background: var(--cpfa-secondary);
        color: white;
    }
    
    .cpfa-catalogue-filters select,
    .cpfa-catalogue-filters input,
    .cpfa-search-input {
        background: var(--cpfa-secondary);
        color: white;
        border-color: #4a5568;
    }
    
    .cpfa-item-excerpt,
    .cpfa-stat-label,
    .cpfa-event-meta {
        color: #cbd5e0;
    }
    
    .cpfa-event-item {
        background: #374151;
    }
}

/* ========================================
   Accessibilité
   ======================================== */
.cpfa-catalogue-widget *:focus,
.cpfa-search-widget *:focus,
.cpfa-stats-widget *:focus,
.cpfa-upcoming-events-widget *:focus {
    outline: 2px solid var(--cpfa-primary);
    outline-offset: 2px;
}

.cpfa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Mode Éditeur Elementor
   ======================================== */
.elementor-editor-active .cpfa-catalogue-widget,
.elementor-editor-active .cpfa-search-widget,
.elementor-editor-active .cpfa-stats-widget,
.elementor-editor-active .cpfa-upcoming-events-widget {
    pointer-events: auto;
}

.elementor-editor-active .cpfa-item-link,
.elementor-editor-active .cpfa-load-more {
    pointer-events: none;
}

/* ========================================
   Library Widget
   ======================================== */
.cpfa-library-widget {
    margin-bottom: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cpfa-library-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #23282d;
}

.library-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.library-search {
    flex: 1;
    min-width: 300px;
}

.library-search-form {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.library-search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 14px;
}

.library-search-input:focus {
    outline: none;
}

.library-search-button {
    padding: 0 20px;
    background: var(--cpfa-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: var(--cpfa-transition);
}

.library-search-button:hover {
    background: #1e4a8a;
}

.library-search-button .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.library-filters {
    min-width: 200px;
}

.library-filter-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.library-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.library-grid.columns-2 {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.library-grid.columns-3 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.library-grid.columns-4 {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.library-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: var(--cpfa-border-radius);
    padding: 1.5rem;
    transition: var(--cpfa-transition);
    position: relative;
}

.library-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--cpfa-box-shadow);
}

.library-item.unavailable {
    opacity: 0.7;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.item-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: #1e40af;
    flex: 1;
}

.item-cote {
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.item-authors,
.item-year {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.item-authors .dashicons,
.item-year .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.item-availability {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.availability-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.availability-badge.available {
    background: #d1fae5;
    color: #065f46;
}

.availability-badge.unavailable {
    background: #fee2e2;
    color: #991b1b;
}

.availability-badge.excluded {
    background: #fef3c7;
    color: #92400e;
}

.availability-badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.item-excerpt {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

.library-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.library-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 16px;
    margin: 0 4px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    color: #374151;
    text-decoration: none;
    transition: var(--cpfa-transition);
}

.library-pagination .page-numbers:hover {
    background: #f9fafb;
    border-color: var(--cpfa-primary);
}

.library-pagination .page-numbers.current {
    background: var(--cpfa-primary);
    color: #fff;
    border-color: var(--cpfa-primary);
}

.library-pagination .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.library-no-results {
    text-align: center;
    padding: 3rem 1rem;
    background: #f9fafb;
    border-radius: var(--cpfa-border-radius);
}

.library-no-results p {
    font-size: 1.125rem;
    color: #6b7280;
    margin: 0;
}

/* List Layout */
.cpfa-library-widget.layout-list .library-grid {
    display: block;
}

.cpfa-library-widget.layout-list .library-item {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: flex-start;
}

.cpfa-library-widget.layout-list .item-content {
    flex: 1;
}

.cpfa-library-widget.layout-list .item-header {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .library-controls {
        flex-direction: column;
    }

    .library-search {
        min-width: 100%;
    }

    .library-grid.columns-2,
    .library-grid.columns-3,
    .library-grid.columns-4 {
        grid-template-columns: 1fr;
    }

    .cpfa-library-widget.layout-list .library-item {
        flex-direction: column;
    }
}

/* ========================================
   Bouton de Réservation
   ======================================== */
.cpfa-reserve-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--cpfa-border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--cpfa-transition);
    text-decoration: none;
    font-family: inherit;
    width: 100%;
}

.cpfa-reserve-button.cpfa-reserve-available {
    background: var(--cpfa-accent);
    color: white;
    border: 2px solid var(--cpfa-accent);
}

.cpfa-reserve-button.cpfa-reserve-available:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.cpfa-reserve-button.cpfa-reserve-available:active {
    transform: translateY(0);
}

.cpfa-reserve-button.cpfa-reserve-unavailable {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    border: 2px solid #e0e0e0;
}

.cpfa-reserve-button .cpfa-reserve-icon {
    font-size: 1.2em;
    line-height: 1;
}

.cpfa-reserve-excluded {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
    border-radius: var(--cpfa-border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
    text-align: center;
}

/* Animation du bouton lors du clic */
.cpfa-reserve-button.processing {
    opacity: 0.7;
    cursor: wait;
}

.cpfa-reserve-button.processing .cpfa-reserve-icon {
    animation: cpfa-pulse 1s infinite;
}

/* État de succès */
.cpfa-reserve-button.success {
    background: var(--cpfa-accent);
    animation: cpfa-success-flash 0.5s;
}

@keyframes cpfa-success-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Variantes de style des boutons */
.cpfa-button-style-outline .cpfa-item-link {
    background: transparent;
    color: var(--cpfa-primary);
    border: 2px solid var(--cpfa-primary);
}

.cpfa-button-style-outline .cpfa-item-link:hover {
    background: var(--cpfa-primary);
    color: white;
}

.cpfa-button-style-outline .cpfa-reserve-button.cpfa-reserve-available {
    background: transparent;
    color: var(--cpfa-accent);
    border: 2px solid var(--cpfa-accent);
}

.cpfa-button-style-outline .cpfa-reserve-button.cpfa-reserve-available:hover {
    background: var(--cpfa-accent);
    color: white;
}

.cpfa-button-style-rounded .cpfa-item-link,
.cpfa-button-style-rounded .cpfa-reserve-button {
    border-radius: 50px;
}

.cpfa-button-style-square .cpfa-item-link,
.cpfa-button-style-square .cpfa-reserve-button {
    border-radius: 4px;
}

/* Alignement des boutons */
.cpfa-button-align-left .cpfa-item-actions {
    align-items: flex-start;
}

.cpfa-button-align-center .cpfa-item-actions {
    align-items: center;
}

.cpfa-button-align-right .cpfa-item-actions {
    align-items: flex-end;
}

.cpfa-button-align-stretch .cpfa-item-link,
.cpfa-button-align-stretch .cpfa-reserve-button {
    width: 100%;
}

/* Responsive */
@media (max-width: 480px) {
    .cpfa-reserve-button,
    .cpfa-item-link {
        width: 100%;
        justify-content: center;
    }

    .cpfa-item-actions {
        align-items: stretch;
    }
}

/* ========================================
   Modal Dialog
   ======================================== */
.cpfa-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cpfa-modal-overlay.cpfa-modal-show {
    opacity: 1;
}

.cpfa-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.3s ease;
}

.cpfa-modal-show .cpfa-modal {
    transform: scale(1) translateY(0);
}

.cpfa-modal-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.cpfa-modal-icon {
    font-size: 24px;
    line-height: 1;
}

.cpfa-modal-title {
    flex: 1;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.cpfa-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.cpfa-modal-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.cpfa-modal-body {
    padding: 24px;
    color: #4b5563;
    font-size: 16px;
    line-height: 1.6;
}

.cpfa-modal-body p {
    margin: 0;
}

.cpfa-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #f9fafb;
}

.cpfa-modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
}

.cpfa-modal-btn-primary {
    background: var(--cpfa-primary);
    color: white;
}

.cpfa-modal-btn-primary:hover {
    background: #1e4a8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.cpfa-modal-btn-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

.cpfa-modal-btn-secondary:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Modal types */
.cpfa-modal-success .cpfa-modal-header {
    border-bottom-color: #d1fae5;
    background: linear-gradient(to bottom, #ecfdf5 0%, white 100%);
}

.cpfa-modal-success .cpfa-modal-icon {
    color: #10b981;
}

.cpfa-modal-success .cpfa-modal-btn-primary {
    background: #10b981;
}

.cpfa-modal-success .cpfa-modal-btn-primary:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.cpfa-modal-error .cpfa-modal-header {
    border-bottom-color: #fee2e2;
    background: linear-gradient(to bottom, #fef2f2 0%, white 100%);
}

.cpfa-modal-error .cpfa-modal-icon {
    color: #ef4444;
}

.cpfa-modal-error .cpfa-modal-btn-primary {
    background: #ef4444;
}

.cpfa-modal-error .cpfa-modal-btn-primary:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.cpfa-modal-warning .cpfa-modal-header {
    border-bottom-color: #fef3c7;
    background: linear-gradient(to bottom, #fffbeb 0%, white 100%);
}

.cpfa-modal-warning .cpfa-modal-icon {
    color: #f59e0b;
}

.cpfa-modal-info .cpfa-modal-header {
    border-bottom-color: #dbeafe;
    background: linear-gradient(to bottom, #eff6ff 0%, white 100%);
}

.cpfa-modal-info .cpfa-modal-icon {
    color: #3b82f6;
}

/* Animation de chargement dans la modal */
.cpfa-modal-loading {
    padding: 40px;
    text-align: center;
}

.cpfa-modal-loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--cpfa-primary);
    border-radius: 50%;
    animation: cpfa-spin 0.8s linear infinite;
}

@keyframes cpfa-spin {
    to { transform: rotate(360deg); }
}

/* Responsive modal */
@media (max-width: 640px) {
    .cpfa-modal {
        width: 95%;
        max-width: none;
        margin: 20px;
    }

    .cpfa-modal-header {
        padding: 20px 16px;
    }

    .cpfa-modal-body {
        padding: 20px 16px;
    }

    .cpfa-modal-footer {
        flex-direction: column-reverse;
        padding: 16px;
    }

    .cpfa-modal-btn {
        width: 100%;
    }

    .cpfa-modal-title {
        font-size: 18px;
    }
}
