/**
 * Brief Details Modal - Styles CSS avec charte Koldkaze
 * Compatible avec les variables CSS unifiées
 * Style cohérent avec price-proposal-modal et tjm-modals-unified
 */

/* ===== MODAL OVERLAY ===== */
.brief-details-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 ===== */
.brief-details-modal-container {
    background: var(--koldkaze-white, #ffffff);
    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 ===== */
.brief-details-modal-header {
    background: linear-gradient(135deg, var(--koldkaze-primary, #6300ff), var(--koldkaze-primary-light, #8a4fff));
    color: var(--koldkaze-white, #ffffff);
    padding: var(--koldkaze-spacing-xl, 20px) var(--koldkaze-spacing-xxl, 25px);
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brief-details-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--koldkaze-white, #ffffff);
}

.brief-details-modal-close {
    background: none;
    border: none;
    color: var(--koldkaze-white, #ffffff);
    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;
}

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

/* ===== MODAL BODY ===== */
.brief-details-modal-body {
    padding: var(--koldkaze-spacing-xxl, 25px);
}

/* ===== SECTIONS ===== */
.brief-summary-section,
.order-summary-section {
    margin-bottom: var(--koldkaze-spacing-xxl, 25px);
}

.brief-summary-section h4,
.order-summary-section h4 {
    margin: 0 0 var(--koldkaze-spacing-lg, 16px) 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--koldkaze-gray-800, #343a40);
    padding-bottom: var(--koldkaze-spacing-sm, 8px);
}

/* ===== GRILLE D'INFORMATIONS ===== */
.brief-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--koldkaze-spacing-lg, 16px);
    margin-bottom: var(--koldkaze-spacing-lg, 16px);
}

.brief-info-item {
    border: 1px solid var(--koldkaze-gray-200, #e9ecef);
    border-radius: 8px;
    padding: var(--koldkaze-spacing-md, 12px);
}

.brief-info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--koldkaze-gray-600, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--koldkaze-spacing-xs, 4px);
}

.brief-info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--koldkaze-gray-800, #343a40);
    word-break: break-word;
}

/* ===== DESCRIPTION DU BRIEF ===== */
.brief-description {
    border: 1px solid var(--koldkaze-gray-200, #e9ecef);
    border-radius: 8px;
    padding: var(--koldkaze-spacing-lg, 16px);
    margin-top: var(--koldkaze-spacing-lg, 16px);
}

.brief-description-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--koldkaze-gray-600, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--koldkaze-spacing-sm, 8px);
}

.brief-description-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--koldkaze-gray-800, #343a40);
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== PRIX TOTAL ===== */
.total-price-section {
    background: linear-gradient(135deg, var(--koldkaze-success, #00d084), var(--koldkaze-success-hover, #00b574));
    color: var(--koldkaze-white, #ffffff);
    padding: var(--koldkaze-spacing-lg, 16px);
    border-radius: 8px;
    text-align: center;
    margin: var(--koldkaze-spacing-lg, 16px) 0;
}

.total-price-section h4 {
    margin: 0 0 var(--koldkaze-spacing-xs, 4px) 0;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    border: none;
    padding: 0;
}

.total-price-value {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

/* ===== ACTIONS ===== */
.proposal-actions {
    display: flex;
    gap: var(--koldkaze-spacing-md, 12px);
    margin: var(--koldkaze-spacing-xl, 20px) 0;
}

.proposal-button {
    flex: 1;
    padding: var(--koldkaze-spacing-md, 12px) var(--koldkaze-spacing-lg, 16px);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.proposal-accept-btn {
    background: linear-gradient(135deg, var(--koldkaze-success, #00d084), var(--koldkaze-success-hover, #00b574));
    color: var(--koldkaze-white, #ffffff);
}

.proposal-accept-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 208, 132, 0.3);
}

.proposal-counter-btn {
    background: linear-gradient(135deg, var(--koldkaze-warning, #ffc107), #ffb000);
    color: var(--koldkaze-white, #ffffff);
}

.proposal-counter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 193, 7, 0.3);
}

/* ===== FORMULAIRE CONTRE-PROPOSITION ===== */
.counter-proposal-form {
    border: 1px solid var(--koldkaze-gray-200, #e9ecef);
    border-radius: 8px;
    padding: var(--koldkaze-spacing-lg, 16px);
    margin-top: var(--koldkaze-spacing-lg, 16px);
    display: none;
}

.counter-proposal-form.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-input-group {
    margin-bottom: var(--koldkaze-spacing-lg, 16px);
}

.price-input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--koldkaze-gray-700, #495057);
    margin-bottom: var(--koldkaze-spacing-sm, 8px);
}

.price-input {
    width: 100%;
    padding: var(--koldkaze-spacing-md, 12px);
    border: 2px solid var(--koldkaze-gray-300, #dee2e6);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: var(--koldkaze-gray-800, #343a40);
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.price-input:focus {
    outline: none;
    border-color: var(--koldkaze-primary, #6300ff);
    box-shadow: 0 0 0 3px rgba(99, 0, 255, 0.1);
}

.counter-submit-btn {
    width: 100%;
    padding: var(--koldkaze-spacing-md, 12px);
    background: linear-gradient(135deg, var(--koldkaze-primary, #6300ff), var(--koldkaze-primary-hover, #5200cc));
    color: var(--koldkaze-white, #ffffff);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.counter-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 0, 255, 0.3);
}

/* ===== ÉTATS DE CHARGEMENT ===== */
.proposal-button.loading,
.counter-submit-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid var(--koldkaze-white, #ffffff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .brief-details-modal-container {
        width: 95%;
        margin: var(--koldkaze-spacing-lg, 16px);
    }
    
    .brief-info-grid {
        grid-template-columns: 1fr;
        gap: var(--koldkaze-spacing-md, 12px);
    }
    
    .proposal-actions {
        flex-direction: column;
    }
    
    .brief-details-modal-body {
        padding: var(--koldkaze-spacing-lg, 16px);
    }
}

@media (max-width: 480px) {
    .brief-details-modal-header {
        padding: var(--koldkaze-spacing-lg, 16px);
    }
    
    .brief-details-modal-header h3 {
        font-size: 16px;
    }
    
    .total-price-value {
        font-size: 20px;
    }
}

/* ===== BRIEF SUMMARY ===== */
.brief-summary-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.brief-summary-section h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.brief-info-item {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.brief-info-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 500;
}

.brief-info-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.brief-description {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    margin-top: 15px;
}

.brief-description-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

.brief-description-text {
    color: #374151;
    line-height: 1.6;
    font-size: 14px;
}

/* ===== ORDER SUMMARY ===== */
.order-summary-section {
    border: 1px solid var(--koldkaze-gray-200, #e9ecef);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.order-summary-section h4 {
    margin: 0 0 15px 0;
    color: var(--koldkaze-gray-800, #343a40);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.order-total-display {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid #0ea5e9;
    text-align: center;
}

.order-total-label {
    font-size: 14px;
    color: #0c4a6e;
    margin-bottom: 5px;
    font-weight: 500;
}

.order-total-amount {
    font-size: 24px;
    color: #0c4a6e;
    font-weight: bold;
}

/* NOUVEAUX STYLES: TTC en gros, HT en petit (comme dans le tableau) */
.order-total-amount-main {
    font-size: 28px;
    color: #000000;
    font-weight: bold;
    margin-bottom: 3px;
}

.order-total-amount-ht {
    font-size: 11px;
    color: #aaa;
    font-style: italic;
    font-weight: 200;
    margin-top: 2px;
}

/* ===== AFFICHAGE GRANULAIRE ITEMS ===== */
.order-items-breakdown {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 2px solid #0ea5e9;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
}

.order-item-row:last-of-type {
    border-bottom: none;
    margin-bottom: 10px;
}

.order-item-row.main-product .item-name {
    font-weight: 600;
    color: #0c4a6e;
}

.order-item-row.addon-item .item-name {
    color: #64748b;
    font-size: 14px;
}

.item-price {
    font-weight: 500;
    color: #0c4a6e;
}

.item-price-input {
    display: flex;
    align-items: center;
    gap: 5px;
}

.price-input {
    width: 80px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    color: #0c4a6e;
    text-align: right;
    background: white;
    transition: border-color 0.2s ease;
}

.price-input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
}

.currency-label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.order-items-total {
    border-top: 2px solid #0ea5e9;
    padding-top: 10px;
    margin-top: 5px;
}

.total-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.total-line:last-child {
    margin-bottom: 0;
}

.total-label {
    font-size: 14px;
    color: #0c4a6e;
    font-weight: 500;
}

.total-amount {
    font-size: 18px;
    color: #000000;
    font-weight: bold;
}

.total-amount-ttc {
    font-size: 20px;
    color: #0c4a6e;
    font-weight: bold;
}

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

.proposal-section h4 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
}

.proposal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.proposal-button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
}

.proposal-accept-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.proposal-accept-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.proposal-counter-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.proposal-counter-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ===== COUNTER PROPOSAL FORM ===== */
.counter-proposal-form {
    display: none;
    margin-top: 20px;
    padding: 20px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
}

.counter-proposal-form.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-input-group {
    margin-bottom: 15px;
}

.price-input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #92400e;
}

.price-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #fed7aa;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.price-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.counter-submit-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.counter-submit-btn:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    transform: translateY(-1px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .brief-details-modal-container {
        width: 95%;
        margin: 10px;
    }
    
    .brief-info-grid {
        grid-template-columns: 1fr;
    }
    
    .proposal-actions {
        grid-template-columns: 1fr;
    }
}

/* ===== LOADING STATE ===== */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 2px solid white;
    animation: spin 1s linear infinite;
}

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

.proposal-button.loading {
    pointer-events: none;
    opacity: 0.7;
}
