/**
 * Royal Blue Flight Search - Styles
 * Theme: Royal Blue (#2347FF) & White
 * Mobile-First Responsive Design
 */

 :root {
    --royal-blue: #2347FF;
    --royal-blue-dark: #1a37cc;
    --royal-blue-light: #e8ecff;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --green: #10b981;
    --red: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Container */
.rbfs-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Search Box */
.rbfs-search-box {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    padding: 24px;
    margin-bottom: 32px;
}

/* Search Controls (Trip Type, Class, Passengers) */
.rbfs-search-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.rbfs-control-item {
    position: relative;
}

.rbfs-select {
    appearance: none;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234b5563' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.rbfs-select:hover {
    border-color: var(--royal-blue);
    background-color: var(--white);
}

.rbfs-select:focus {
    outline: none;
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 3px var(--royal-blue-light);
}

/* Passenger Button */
.rbfs-passenger-btn,
.rbfs-baggage-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.2s;
}

.rbfs-passenger-btn:hover,
.rbfs-baggage-btn:hover {
    border-color: var(--royal-blue);
    background-color: var(--white);
}

.rbfs-icon {
    width: 18px;
    height: 18px;
    color: var(--gray-600);
}

/* Search Inputs Row */
.rbfs-search-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    align-items: end;
}

.rbfs-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rbfs-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rbfs-input-group input[type="text"],
.rbfs-input-group input[type="date"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--gray-800);
    background: var(--white);
    transition: all 0.2s;
}

.rbfs-input-group input::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}

.rbfs-input-group input:hover {
    border-color: var(--royal-blue);
}

.rbfs-input-group input:focus {
    outline: none;
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 3px var(--royal-blue-light);
}

/* Explore Button */
.rbfs-explore-btn {
    width: 100%;
    padding: 12px 24px;
    background: var(--royal-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow-md);
}

.rbfs-explore-btn:hover {
    background: var(--royal-blue-dark);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.rbfs-explore-btn:active {
    transform: translateY(0);
}

/* Passenger Dropdown */
.rbfs-passenger-trigger {
    position: relative;
}

.rbfs-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    min-width: 320px;
    display: none;
}

.rbfs-dropdown[style*="display: block"] {
    display: block !important;
}

.rbfs-dropdown h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
}

.rbfs-passenger-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

.rbfs-passenger-row:last-child {
    border-bottom: none;
}

.rbfs-passenger-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rbfs-passenger-type {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-800);
}

.rbfs-passenger-age {
    font-size: 12px;
    color: var(--gray-500);
}

.rbfs-passenger-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rbfs-minus,
.rbfs-plus {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    transition: all 0.2s;
}

.rbfs-minus:hover,
.rbfs-plus:hover {
    background: var(--royal-blue);
    border-color: var(--royal-blue);
    color: var(--white);
}

.rbfs-minus:disabled,
.rbfs-plus:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.rbfs-passenger-controls span {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    min-width: 24px;
    text-align: center;
}

/* Loading State */
.rbfs-loading {
    text-align: center;
    padding: 60px 20px;
}

.rbfs-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--royal-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.rbfs-loading p {
    font-size: 16px;
    color: var(--gray-600);
    font-weight: 500;
}

/* Results Section */
.rbfs-results {
    margin-top: 40px;
}

.rbfs-results-header {
    margin-bottom: 24px;
}

.rbfs-results-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0 0 8px 0;
}

.rbfs-results-subtitle {
    font-size: 14px;
    color: var(--gray-500);
    margin: 0;
}

.rbfs-no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: var(--gray-600);
    background: var(--gray-50);
    border-radius: 12px;
}

/* Flight Cards Grid */
.rbfs-results-grid {
    display: grid;
    gap: 20px;
}

.rbfs-flight-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.rbfs-flight-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--royal-blue);
    transform: translateY(-2px);
}

/* Flight Header (Airline & Price) */
.rbfs-flight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.rbfs-airline {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rbfs-airline strong {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
}

.rbfs-airline-code {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 500;
}

.rbfs-price {
    text-align: right;
}

.rbfs-currency {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.rbfs-amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--royal-blue);
    display: block;
    line-height: 1;
}

/* Flight Route (Departure → Duration → Arrival) */
.rbfs-flight-route {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.rbfs-flight-time {
    text-align: center;
}

.rbfs-time {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.rbfs-airport {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.rbfs-flight-duration {
    text-align: center;
}

.rbfs-duration-text {
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 8px;
    font-weight: 500;
}

.rbfs-flight-line {
    position: relative;
    height: 2px;
}

.rbfs-line {
    width: 100%;
    height: 2px;
    background: var(--gray-300);
}

.rbfs-stops {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gray-50);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
    border: 1px solid var(--gray-200);
}

.rbfs-stops.rbfs-direct {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.rbfs-via {
    display: block;
    font-size: 10px;
    color: var(--gray-500);
    margin-top: 2px;
}

.rbfs-next-day {
    display: inline-block;
    font-size: 10px;
    color: var(--orange);
    background: rgba(255, 138, 0, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 700;
}

.rbfs-flight-number {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 2px;
}

/* Flight Info (Baggage & Cabin) */
.rbfs-flight-info {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
    flex-wrap: wrap;
}

.rbfs-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-700);
}

.rbfs-icon {
    font-size: 16px;
}

/* Route Details (Expandable) */
.rbfs-route-details {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.rbfs-route-segments {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rbfs-segment {
    padding: 8px;
    background: var(--white);
    border-radius: 6px;
}

.rbfs-segment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.rbfs-segment-route {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-600);
}

.rbfs-segment-duration {
    color: var(--gray-500);
    font-size: 11px;
}

.rbfs-layover {
    padding: 8px;
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid var(--orange);
    font-size: 12px;
    color: var(--gray-700);
}

/* Flight Footer (Date & Book Button) */
.rbfs-flight-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--gray-100);
}

.rbfs-footer-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rbfs-details-btn {
    padding: 10px 20px;
    background: var(--gray-100);
    color: var(--gray-700);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.rbfs-details-btn:hover {
    background: var(--gray-200);
}

.rbfs-date {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

.rbfs-book-btn {
    padding: 10px 24px;
    background: var(--royal-blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rbfs-book-btn:hover {
    background: var(--royal-blue-dark);
    transform: translateX(2px);
}

/* Responsive Design */

/* Tablets */
@media (max-width: 768px) {
    .rbfs-search-container {
        padding: 16px;
    }
    
    .rbfs-search-box {
        padding: 20px;
    }
    
    .rbfs-search-controls {
        flex-direction: column;
    }
    
    .rbfs-control-item {
        width: 100%;
    }
    
    .rbfs-select,
    .rbfs-passenger-btn,
    .rbfs-baggage-btn {
        width: 100%;
        justify-content: space-between;
    }
    
    .rbfs-search-inputs {
        grid-template-columns: 1fr;
    }
    
    .rbfs-flight-route {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .rbfs-flight-time:first-child {
        text-align: left;
    }
    
    .rbfs-flight-time:last-child {
        text-align: right;
    }
    
    .rbfs-dropdown {
        left: 0;
        right: 0;
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .rbfs-search-box {
        padding: 16px;
        border-radius: 12px;
    }
    
    .rbfs-results-header h2 {
        font-size: 22px;
    }
    
    .rbfs-flight-card {
        padding: 16px;
    }
    
    .rbfs-amount {
        font-size: 24px;
    }
    
    .rbfs-time {
        font-size: 18px;
    }
    
    .rbfs-flight-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .rbfs-book-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    .rbfs-search-box,
    .rbfs-book-btn {
        display: none;
    }
    
    .rbfs-flight-card {
        break-inside: avoid;
    }
}