/**
 * Flight Brands Modal Styles
 * Styles for the brand families modal window
 * All selectors are namespaced with .fiw-brands-modal-overlay to prevent conflicts
 */

/* Modal Overlay */
.fiw-brands-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 95000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.fiw-brands-modal-overlay.open {
    opacity: 1;
}

/* Modal Container */
.fiw-brands-modal-overlay .fiw-brands-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.fiw-brands-modal-overlay.open .fiw-brands-modal {
    transform: scale(1);
}

/* Modal Header */
.fiw-brands-modal-overlay .fiw-brands-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
}

.fiw-brands-modal-overlay .fiw-brands-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

.fiw-brands-modal-overlay .fiw-brands-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fiw-brands-modal-overlay .fiw-brands-close:hover,
.fiw-brands-modal-overlay .fiw-brands-refresh:hover {
    color: #ffffff;
    background: grey;
    border-radius: 20px;
}

.fiw-brands-modal-overlay .fiw-brands-close svg {
    width: 24px;
    height: 24px;
}

/* Header Actions Container */
.fiw-brands-modal-overlay .fiw-brands-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.fiw-brands-modal-overlay .fiw-brands-refresh {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.fiw-brands-modal-overlay .fiw-brands-refresh svg {
    width: 20px;
    height: 20px;
}

/* Modal Body */
.fiw-brands-modal-overlay .fiw-brands-body {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

/* Loading State */
.fiw-brands-modal-overlay .fiw-brands-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.fiw-brands-modal-overlay .fiw-brands-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: fiw-brands-spin 1s linear infinite;
}

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

.fiw-brands-modal-overlay .fiw-brands-loading-text {
    margin-top: 16px;
    font-size: 15px;
    color: #6c757d;
}

/* Empty State */
.fiw-brands-modal-overlay .fiw-brands-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

/* Brands Grid */
.fiw-brands-modal-overlay .fiw-brands-grid {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar styling for brands grid */
.fiw-brands-modal-overlay .fiw-brands-grid::-webkit-scrollbar {
    height: 8px;
}

.fiw-brands-modal-overlay .fiw-brands-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.fiw-brands-modal-overlay .fiw-brands-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.fiw-brands-modal-overlay .fiw-brands-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Brand Card */
.fiw-brands-modal-overlay .fiw-brand-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
    display: flex;
    flex-direction: column;
    min-width: 320px;
    max-width: 320px;
    min-height: 520px;
    flex-shrink: 0;
}

.fiw-brands-modal-overlay .fiw-brand-card:hover {
    box-shadow: 2px 1px 20px 2px rgba(0,0,0,0.48);
    transform: translateY(-2px);
}

/* Selected brand highlighting */
.fiw-brands-modal-overlay .fiw-brand-card.fiw-brand-selected {
    border: 2px solid #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.15);
    position: relative;
}

.fiw-brands-modal-overlay .fiw-brand-card.fiw-brand-selected:hover {
    border-color: #198754;
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Selected brand badge */
.fiw-brands-modal-overlay .fiw-brand-selected-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #198754;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Selected brand price styling */
.fiw-brands-modal-overlay .fiw-brand-price.fiw-brand-price-selected .fiw-brand-price-amount {
    color: #198754;
}

.fiw-brands-modal-overlay .fiw-brand-image {
    width: 100%;
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: #f8f9fa;
}

.fiw-brands-modal-overlay .fiw-brand-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.fiw-brands-modal-overlay .fiw-brand-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.fiw-brands-modal-overlay .fiw-brand-name {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #212529;
    flex: 1;
}

.fiw-brands-modal-overlay .fiw-brand-tier {
    background: #e7f3ff;
    color: #0d6efd;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

.fiw-brands-modal-overlay .fiw-brand-price {
    display: flex;
    align-items: baseline;
    margin-bottom: 16px;
}

.fiw-brands-modal-overlay .fiw-brand-price-label {
    font-size: 14px;
    color: #6c757d;
    margin-right: 8px;
}

.fiw-brands-modal-overlay .fiw-brand-price-amount {
    font-size: 26px;
    font-weight: 700;
    color: #212529;
}

.fiw-brands-modal-overlay .fiw-brand-description {
    font-size: 13px;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Brand Services Summary */
.fiw-brands-modal-overlay .fiw-brand-services-summary {
    margin-bottom: 20px;
    flex: 1;
}

.fiw-brands-modal-overlay .fiw-brand-service-item {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    margin-bottom: 10px;
    color: #495057;
}

.fiw-brands-modal-overlay .fiw-service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    margin-right: 10px;
    flex-shrink: 0;
}

.fiw-brands-modal-overlay .fiw-service-icon-img {
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-right: 10px;
    flex-shrink: 0;
    object-fit: contain;
}

.fiw-brands-modal-overlay .fiw-brand-service-item.included .fiw-service-icon {
    background: #d1e7dd;
    color: #0f5132;
}

.fiw-brands-modal-overlay .fiw-brand-service-item.available .fiw-service-icon {
    background: #fff3cd;
    color: #856404;
}

.fiw-brands-modal-overlay .fiw-brand-service-item.not-offered {
    opacity: 0.5;
}

.fiw-brands-modal-overlay .fiw-brand-service-item.not-offered .fiw-service-icon {
    background: #f8d7da;
    color: #842029;
}

.fiw-brands-modal-overlay .fiw-service-text {
    line-height: 1.5;
    padding-top: 2px;
}

/* View Details Button */
.fiw-brands-modal-overlay .fiw-brand-details-btn {
    width: 100%;
    padding: 12px 16px;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 20px;
}

.fiw-brands-modal-overlay .fiw-brand-details-btn:hover {
    background: #0b5ed7;
}

/* Brand Details Modal */
.fiw-brands-modal-overlay .fiw-brand-details-modal {
    max-width: 700px;
    padding: 0 20px 20px;
}

.fiw-brands-modal-overlay .fiw-brand-details-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.fiw-brands-modal-overlay .fiw-brand-detail-section {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 20px;
}

.fiw-brands-modal-overlay .fiw-brand-detail-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.fiw-brands-modal-overlay .fiw-brand-detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #212529;
}

.fiw-brands-modal-overlay .fiw-brand-detail-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.fiw-brands-modal-overlay .fiw-brand-text-marketingconsumer {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
    margin: 0 0 8px 0;
    white-space: pre-line;
}

.fiw-brands-modal-overlay .fiw-brand-text-strapline {
    font-size: 13px;
    line-height: 1.5;
    color: #6c757d;
    font-style: italic;
    margin: 0 0 8px 0;
}

/* Pricing Breakdown */
.fiw-brands-modal-overlay .fiw-pricing-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fiw-brands-modal-overlay .fiw-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #495057;
    padding: 6px 0;
}

.fiw-brands-modal-overlay .fiw-pricing-row.fiw-pricing-total {
    border-top: 2px solid #dee2e6;
    margin-top: 4px;
    padding-top: 12px;
    font-weight: 600;
    font-size: 16px;
    color: #212529;
}

/* Services List */
.fiw-brands-modal-overlay .fiw-services-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fiw-brands-modal-overlay .fiw-service-detail-item {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.fiw-brands-modal-overlay .fiw-service-detail-header {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.fiw-brands-modal-overlay .fiw-service-detail-header .fiw-service-icon {
    margin-right: 10px;
}

.fiw-brands-modal-overlay .fiw-service-title {
    font-weight: 600;
    color: #212529;
    font-size: 14px;
}

.fiw-brands-modal-overlay .fiw-service-description {
    margin: 6px 0;
    font-size: 13px;
    color: #495057;
    line-height: 1.5;
    padding-left: 28px;
}

.fiw-brands-modal-overlay .fiw-service-chargeable {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #6c757d;
    padding-left: 28px;
}

/* Baggage and Rules Info */
.fiw-brands-modal-overlay .fiw-baggage-info,
.fiw-brands-modal-overlay .fiw-rules-info {
    font-size: 14px;
    color: #495057;
    line-height: 1.6;
}

.fiw-brands-modal-overlay .fiw-rule-item {
    padding: 8px 0;
}

.fiw-brands-modal-overlay .fiw-rule-item strong {
    color: #212529;
    margin-right: 8px;
}

/* Error Modal */
.fiw-brands-modal-overlay .fiw-brands-error-modal .fiw-error-message {
    font-size: 15px;
    color: #842029;
    background: #f8d7da;
    padding: 16px;
    border-radius: 6px;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .fiw-brands-modal-overlay .fiw-brands-modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .fiw-brands-modal-overlay .fiw-brand-card {
        min-width: 280px;
        max-width: 280px;
    }

    .fiw-brands-modal-overlay .fiw-brands-header {
        padding: 16px;
    }

    .fiw-brands-modal-overlay .fiw-brands-body {
        padding: 16px;
    }

    .fiw-brands-modal-overlay .fiw-brand-details-modal {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .fiw-brands-modal-overlay {
        padding: 0;
    }

    .fiw-brands-modal-overlay .fiw-brands-header h2 {
        font-size: 18px;
    }

    .fiw-brands-modal-overlay .fiw-brand-name {
        font-size: 15px;
    }

    .fiw-brands-modal-overlay .fiw-brand-price-amount {
        font-size: 20px;
    }
}
