/* ================================================================ */
/* === CSS SPÉCIFIQUE POUR CONSULTATION APPELS D'OFFRES ========== */
/* ================================================================ */

/* === MAIN CONTAINER ============================================= */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

/* === SECTION FILTRES =========================================== */
.filters-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    animation: fadeInDown 0.4s ease;
}

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

.filters-grid {
    display: grid;
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background: white;
    transition: all 0.2s ease;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--accent-wine);
    box-shadow: 0 0 0 3px rgba(124, 10, 41, 0.1);
}

.filter-select:hover,
.filter-input:hover {
    border-color: var(--accent-wine);
}

.filters-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

/* === AO GRID & CARDS =========================================== */
.ao-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

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

.ao-card {
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.ao-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-wine), var(--accent-copper));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.ao-card:hover::before {
    transform: scaleX(1);
}

.ao-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: rgba(124, 10, 41, 0.2);
}

/* Card Header */
.ao-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem 1rem;
}

.ao-reference {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-wine);
    background: rgba(124, 10, 41, 0.08);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.ao-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--border-light);
    color: var(--text-secondary);
}

.ao-status.active {
    background: rgba(72, 187, 120, 0.15);
    color: var(--success);
}

.ao-status i {
    font-size: 0.5rem;
}

/* Card Body */
.ao-card-body {
    padding: 0 1.5rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ao-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ao-location-highlight {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(124, 10, 41, 0.04), rgba(160, 82, 45, 0.04));
    border-radius: 10px;
    border-left: 3px solid var(--accent-wine);
}

.ao-location-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ao-location-item i {
    color: var(--accent-wine);
    font-size: 0.85rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.ao-location-item span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.ao-location-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.5;
}

.ao-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.ao-detail-item {
    background: rgba(250, 247, 245, 0.8);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.ao-detail-item:hover {
    background: white;
    border-color: var(--accent-wine);
    box-shadow: var(--shadow-sm);
}

.ao-detail-item.highlight {
    background: linear-gradient(135deg, rgba(124, 10, 41, 0.05), rgba(160, 82, 45, 0.05));
    border: 1px solid rgba(124, 10, 41, 0.15);
}

.ao-detail-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}

.ao-detail-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Card Footer */
.ao-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    background: rgba(250, 247, 245, 0.5);
}

.ao-buyer {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.ao-buyer-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ao-buyer-company {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ao-buyer-company i {
    color: var(--accent-wine);
}

.ao-buyer-location {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ao-buyer-location i {
    color: var(--accent-copper);
    font-size: 0.75rem;
}

.btn-view-detail {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--accent-wine), var(--accent-copper));
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-view-detail:hover {
    transform: translateX(3px);
    box-shadow: var(--shadow-md);
}

/* === EMPTY STATE =============================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: 16px;
    border: 2px dashed var(--border-medium);
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

/* === MODAL OVERLAY ============================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 2rem;
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, rgba(124, 10, 41, 0.03), rgba(160, 82, 45, 0.03));
}

.modal-title-section {
    flex: 1;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-left: 1rem;
}

.btn-close:hover {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

.detail-section-title i {
    color: var(--accent-wine);
    font-size: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-item {
    background: rgba(250, 247, 245, 0.5);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.detail-item:hover {
    background: white;
    border-color: var(--accent-wine);
    box-shadow: var(--shadow-sm);
}

.detail-item-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.detail-item-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(124, 10, 41, 0.08), rgba(160, 82, 45, 0.08));
    color: var(--accent-wine);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(124, 10, 41, 0.15);
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--accent-wine);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-light);
    background: rgba(250, 247, 245, 0.5);
}

.btn-respond {
    padding: 0.9rem 1.8rem;
    background: linear-gradient(135deg, var(--accent-wine), var(--accent-copper));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-respond:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* === RESPONSIVE ================================================ */
@media (max-width: 1024px) {
    .main-container {
        padding: 1.5rem 2rem;
    }

    .ao-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 1rem 1.5rem;
    }

    .filters-section {
        padding: 1.5rem;
    }

    .filters-grid {
        grid-template-columns: 1fr !important;
    }

    .ao-grid {
        grid-template-columns: 1fr;
    }

    .ao-details {
        grid-template-columns: 1fr;
    }

    .modal-overlay {
        padding: 1rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.2rem;
    }

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

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

@media (max-width: 480px) {
    .filters-actions {
        flex-direction: column;
    }

    .filters-actions .btn {
        width: 100%;
    }

    .ao-card-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .btn-view-detail {
        width: 100%;
        justify-content: center;
    }
}
