/* ==========================================
   PASC - Système de gestion des factures
   Styles avec préfixe pasc- pour éviter conflits
   ========================================== */

/* Barre de progression PASC */
.pasc-progress-container {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pasc-progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.pasc-progress-bar-wrapper {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.pasc-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 13px;
    min-width: 50px;
}

.pasc-progress-bar.pasc-full {
    background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
}

/* Modal Popup */
.pasc-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    animation: pasc-fadeIn 0.3s ease;
}

.pasc-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 9999;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: pasc-slideIn 0.3s ease;
}

.pasc-modal-header {
    padding: 20px 25px;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.pasc-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.pasc-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.pasc-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.pasc-modal-body {
    padding: 25px;
}

.pasc-modal-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
    font-size: 14px;
    line-height: 1.6;
}

.pasc-modal-info strong {
    color: #1976D2;
}

/* Formulaire dans le modal */
.pasc-form-group {
    margin-bottom: 20px;
}

.pasc-form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.pasc-form-label .pasc-required {
    color: #dc3545;
    margin-left: 3px;
}

.pasc-form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.pasc-form-input:focus {
    outline: none;
    border-color: #108fd1;
    box-shadow: 0 0 0 3px rgba(16, 143, 209, 0.1);
}

.pasc-form-input.pasc-error {
    border-color: #dc3545;
}

/* Upload de fichier stylisé */
.pasc-file-upload-wrapper {
    position: relative;
}

.pasc-file-upload-input {
    display: none;
}

.pasc-file-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #108fd1;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 14px;
}

.pasc-file-upload-label:hover {
    background: #0d7ab8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 143, 209, 0.3);
}

.pasc-file-selected {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 15px;
    background: #e8f5e9;
    border-radius: 6px;
    font-size: 14px;
    color: #2e7d32;
}

.pasc-file-icon {
    font-size: 24px;
    line-height: 1;
}

.pasc-remove-file {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    padding: 0 5px;
    font-size: 18px;
    line-height: 1;
}

.pasc-remove-file:hover {
    color: #b71c1c;
}

/* Boutons du modal */
.pasc-modal-footer {
    padding: 20px 25px;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.pasc-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pasc-btn-primary {
    background: #108fd1;
    color: white;
}

.pasc-btn-primary:hover {
    background: #0d7ab8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 143, 209, 0.3);
}

.pasc-btn-secondary {
    background: #6c757d;
    color: white;
}

.pasc-btn-secondary:hover {
    background: #5a6268;
}

.pasc-btn-success {
    background: #28a745;
    color: white;
    font-size: 16px;
    padding: 14px 28px;
}

.pasc-btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.pasc-btn-validate {
    background: #ff9800;
    color: white;
    font-size: 16px;
    padding: 14px 28px;
}

.pasc-btn-validate:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.pasc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Liste des factures en attente */
.pasc-pending-invoices {
    margin: 30px 0;
}

.pasc-pending-invoices h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.pasc-pending-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pasc-pending-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s;
}

.pasc-pending-item:last-child {
    border-bottom: none;
}

.pasc-pending-item:hover {
    background: #f8f9fa;
}

.pasc-pending-icon {
    font-size: 32px;
    margin-right: 15px;
    flex-shrink: 0;
    line-height: 1;
}

.pasc-pending-details {
    flex: 1;
    min-width: 0;
}

.pasc-pending-shop {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-size: 15px;
}

.pasc-pending-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
}

.pasc-pending-amount {
    font-weight: 700;
    color: #28a745;
    font-size: 16px;
    margin: 0 15px;
}

.pasc-pending-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pasc-pending-remove:hover {
    background: #fee;
    transform: scale(1.1);
}

.pasc-no-pending {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Total et actions */
.pasc-total-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.pasc-total-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.pasc-total-amount {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
}

/* Toast notifications */
.pasc-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pasc-toast {
    min-width: 300px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: pasc-slideInRight 0.3s ease;
    border-left: 4px solid;
}

.pasc-toast.pasc-toast-success {
    border-left-color: #28a745;
}

.pasc-toast.pasc-toast-error {
    border-left-color: #dc3545;
}

.pasc-toast.pasc-toast-warning {
    border-left-color: #ffc107;
}

.pasc-toast.pasc-toast-info {
    border-left-color: #17a2b8;
}

.pasc-toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.pasc-toast-success .pasc-toast-icon { color: #28a745; }
.pasc-toast-error .pasc-toast-icon { color: #dc3545; }
.pasc-toast-warning .pasc-toast-icon { color: #ffc107; }
.pasc-toast-info .pasc-toast-icon { color: #17a2b8; }

.pasc-toast-content {
    flex: 1;
}

.pasc-toast-title {
    font-weight: 600;
    margin-bottom: 3px;
    font-size: 14px;
}

.pasc-toast-message {
    font-size: 13px;
    color: #666;
}

.pasc-toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    padding: 0;
    line-height: 1;
}

.pasc-toast-close:hover {
    color: #333;
}

/* Animations */
@keyframes pasc-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pasc-slideIn {
    from {
        transform: translate(-50%, -60%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes pasc-slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .pasc-modal {
        width: 95%;
        max-height: 90vh;
    }
    
    .pasc-modal-header,
    .pasc-modal-body,
    .pasc-modal-footer {
        padding: 15px;
    }
    
    .pasc-pending-item {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .pasc-pending-icon {
        font-size: 28px;
    }
    
    .pasc-pending-amount {
        margin: 0;
        width: 100%;
        text-align: right;
    }
    
    .pasc-total-section {
        flex-direction: column;
        text-align: center;
    }
    
    .pasc-toast-container {
        right: 10px;
        left: 10px;
        top: 10px;
    }
    
    .pasc-toast {
        min-width: auto;
    }
    
    .pasc-progress-label {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pasc-modal-header h3 {
        font-size: 16px;
    }
    
    .pasc-btn {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .pasc-btn-success,
    .pasc-btn-validate {
        font-size: 14px;
        padding: 12px 20px;
        width: 100%;
    }
}