/**
 * Price Proposal Manager - Styles CSS
 * Styles pour la modal de proposition de prix des freelances
 */

/* ===== MODAL OVERLAY ===== */
.price-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== MODAL CONTAINER ===== */
.price-modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== MODAL HEADER ===== */
.price-modal-header {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
    padding: 20px 25px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.price-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.price-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== MODAL BODY ===== */
.price-modal-body {
    padding: 25px;
}

/* ===== INFORMATIONS ACTUELLES ===== */
.current-price-info {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.current-price-info h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-weight: 600;
    font-size: 16px;
}

.price-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.price-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.price-info-item label {
    font-weight: 500;
    color: #6b7280;
    margin: 0;
}

.current-price {
    font-weight: 700;
    color: #059669;
    font-size: 16px;
}

.last-proposal {
    font-weight: 600;
    color: #7c3aed;
    font-size: 16px;
}

/* ===== SECTION PROPOSITION ===== */
.price-proposal-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 25px;
}

.price-proposal-section h4 {
    margin: 0 0 20px 0;
    color: #374151;
    font-weight: 600;
    font-size: 16px;
}

/* ===== FORM GROUPS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1);
}

/* ===== PRICE INPUT GROUP ===== */
.price-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.price-input-group input {
    padding-right: 40px;
    font-size: 16px;
    font-weight: 600;
}

.currency-symbol {
    position: absolute;
    right: 12px;
    color: #6b7280;
    font-weight: 500;
    pointer-events: none;
}

/* ===== PRICE BREAKDOWN ===== */
.price-breakdown {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: #6b7280;
}

.breakdown-item:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.breakdown-item.total {
    font-weight: 700;
    color: #059669;
    font-size: 16px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 2px solid #059669;
}

/* ===== PROGRESS ===== */
.price-progress {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #059669, #10b981);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    margin-top: 8px;
    color: #6b7280;
    font-size: 14px;
}

/* ===== MODAL FOOTER ===== */
.price-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.btn-cancel {
    background: #6b7280;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-cancel:hover {
    background: #4b5563;
}

.btn-submit-proposal {
    background: #059669;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-submit-proposal:hover:not(:disabled) {
    background: #047857;
}

.btn-submit-proposal:disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

/* ===== LOADER ===== */
.price-modal-loader {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #059669;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: #6b7280;
    font-weight: 500;
}

/* ===== NOTIFICATIONS ===== */
.price-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 16px 20px;
    z-index: 1000000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 4px solid #6b7280;
}

.price-notification--show {
    transform: translateX(0);
}

.price-notification--success {
    border-left-color: #059669;
}

.price-notification--error {
    border-left-color: #ef4444;
}

.price-notification__content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-notification__icon {
    font-size: 18px;
}

.price-notification__message {
    color: #374151;
    font-weight: 500;
}

/* ===== ANIMATIONS SPÉCIALES ===== */
.price-modal-overlay.closing {
    animation: fadeOut 0.3s ease forwards;
}

.price-modal-overlay.closing .price-modal-container {
    animation: slideDown 0.3s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideDown {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .price-modal-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .price-modal-header,
    .price-modal-body,
    .price-modal-footer {
        padding: 15px 20px;
    }
    
    .price-info-grid {
        grid-template-columns: 1fr;
    }
    
    .price-info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .price-modal-footer {
        flex-direction: column;
    }
    
    .btn-cancel,
    .btn-submit-proposal {
        width: 100%;
        justify-content: center;
    }
    
    .price-notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .price-notification--show {
        transform: translateY(0);
    }
}

/* ===== INTÉGRATION AVEC LE THEME EXISTANT ===== */
.price-modal-container * {
    box-sizing: border-box;
}

.price-modal-container button:focus,
.price-modal-container input:focus,
.price-modal-container textarea:focus {
    outline: 2px solid #059669;
    outline-offset: 2px;
}

/* ===== BODY MODAL OPEN ===== */
body.modal-open {
    overflow: hidden;
}
