/* Base styles */
:root {
    --primary-color: #0ea5e9;
    --primary-dark: #0369a1;
    --primary-light: #bae6fd;
}

/* Global styles */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    color: #1e293b;
}

/* Enhanced Mobile-First Responsive Design */
/* Extra Small Devices (phones, 0px to 576px) */
@media (max-width: 576px) {
    /* Typography scaling */
    h1 { font-size: 1.75rem !important; line-height: 1.2; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.25rem !important; }
    
    /* Container padding */
    .max-w-7xl {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Form improvements */
    input, select, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
        min-height: 48px;
        padding: 12px 16px;
    }
    
    /* Button improvements */
    button, .btn {
        min-height: 48px;
        font-size: 16px;
        padding: 12px 20px;
        border-radius: 8px;
    }
    
    /* Search form mobile optimization */
    .search-form-wrapper {
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .search-form-wrapper form {
        padding: 1.5rem !important;
    }
    
    /* Grid adjustments */
    .grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Card spacing */
    .card-hover {
        margin-bottom: 1.5rem;
    }
    
    /* Flight results mobile */
    .flight-result-card {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }
    
    .flight-details {
        font-size: 0.875rem;
    }
    
    /* Payment form mobile */
    .payment-form {
        padding: 1rem !important;
    }
    
    .payment-method-option {
        width: 100% !important;
        margin-bottom: 1rem;
    }
}

/* Small Devices (tablets, 576px to 768px) */
@media (max-width: 768px) {
    /* Hero section fixes */
    .relative.bg-gradient-to-r {
        margin-bottom: 120px;
    }
    
    .bg-white.rounded-lg.shadow-xl,
    .bg-white.rounded-2xl.shadow-2xl {
        margin-bottom: 40px;
        position: relative;
        z-index: 10;
        border-radius: 16px !important;
    }
    
    .py-12.bg-gradient-to-b {
        position: relative;
        z-index: 5;
        margin-top: 100px;
        padding-top: 2rem !important;
    }
    
    /* Search form specific fixes */
    form#flight-search-form {
        padding: 1.5rem;
    }
    
    form#flight-search-form button[type="submit"] {
        margin-bottom: 10px;
        width: 100%;
        margin-top: 1rem;
    }
    
    .search-form-wrapper {
        position: relative;
        z-index: 30;
        margin: 0 1rem;
    }
    
    /* Navigation improvements */
    .sticky.top-0 {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }
    
    main.pt-8 {
        padding-top: 5rem !important; /* Account for fixed header */
    }
    
    /* Modal improvements */
    .modal-dialog {
        margin: 1rem !important;
        max-width: calc(100vw - 2rem) !important;
    }
    
    /* Table responsiveness */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Spacer visibility */
    .spacer-div {
        display: block;
        width: 100%;
        clear: both;
        height: 2rem;
    }
}

/* Medium Devices (small laptops, 768px to 992px) */
@media (min-width: 768px) and (max-width: 992px) {
    .grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .search-form-wrapper {
        margin: 0 2rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .card-hover:hover {
        transform: none;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    /* Improve tap highlighting */
    a, button {
        -webkit-tap-highlight-color: rgba(14, 165, 233, 0.2);
    }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for select inputs with icons */
    .ios-select,
    select.form-control,
    select.block {
        padding-left: 30px !important;
        text-indent: 0 !important;
    }
    
    /* Fix icon positioning in forms */
    .ios-icon,
    .relative .absolute.inset-y-0.left-0.pl-3 {
        left: 8px;
    }
    
    /* Fix for date inputs */
    input[type="date"] {
        appearance: textfield;
        -webkit-appearance: textfield;
        line-height: normal !important;
        padding: 12px 16px;
    }
    
    /* Fix for select dropdowns */
    select {
        text-indent: 0 !important;
        background-position-x: 95% !important;
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Prevent zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Flight Search Form Enhancements */
.flight-search-container {
    position: relative;
    z-index: 20;
}

@media (max-width: 768px) {
    .flight-search-container {
        margin: 0 1rem;
        padding: 0;
    }
    
    .flight-search-container .bg-white {
        border-radius: 16px;
        padding: 1.5rem;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    }
    
    /* Trip type radio buttons */
    .trip-type-container {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
    }
    
    .trip-type-container label {
        display: flex;
        align-items: center;
        padding: 0.75rem;
        background: #f8fafc;
        border-radius: 8px;
        border: 2px solid transparent;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .trip-type-container input[type="radio"]:checked + label {
        background: #eff6ff;
        border-color: #0ea5e9;
    }
    
    /* Form fields */
    .form-field {
        margin-bottom: 1rem;
    }
    
    .form-field label {
        display: block;
        font-weight: 500;
        margin-bottom: 0.5rem;
        color: #374151;
    }
    
    .form-field input,
    .form-field select {
        width: 100%;
        border: 1px solid #d1d5db;
        border-radius: 8px;
        padding: 12px 16px;
        font-size: 16px;
        transition: border-color 0.3s ease;
    }
    
    .form-field input:focus,
    .form-field select:focus {
        outline: none;
        border-color: #0ea5e9;
        box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    }
}

/* Flight Results Mobile Optimization */
@media (max-width: 768px) {
    .flight-results-container {
        padding: 0 1rem;
    }
    
    .flight-card {
        background: white;
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        border: 1px solid #e5e7eb;
    }
    
    .flight-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .airline-info {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }
    
    .airline-logo {
        width: 32px;
        height: 32px;
        border-radius: 4px;
        object-fit: contain;
    }
    
    .flight-details {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 1rem;
        align-items: center;
        margin-bottom: 1rem;
    }
    
    .flight-time {
        text-align: center;
    }
    
    .flight-duration {
        font-size: 0.875rem;
        color: #6b7280;
        text-align: center;
    }
    
    .flight-price {
        text-align: right;
        font-weight: 700;
        color: #0ea5e9;
        font-size: 1.25rem;
    }
    
    .select-flight-btn {
        width: 100%;
        background: #0ea5e9;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 12px;
        font-weight: 600;
        margin-top: 1rem;
        transition: background-color 0.3s ease;
    }
    
    .select-flight-btn:hover {
        background: #0284c7;
    }
}

/* Payment Form Mobile Optimization */
@media (max-width: 768px) {
    .payment-container {
        padding: 0 1rem;
    }
    
    .payment-form-card {
        background: white;
        border-radius: 16px;
        padding: 1.5rem;
        margin-bottom: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .payment-method-selection {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }
    
    .payment-method-option {
        width: 100%;
    }
    
    .payment-method-option label {
        width: 100%;
        padding: 1rem;
        border: 2px solid #e5e7eb;
        border-radius: 12px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 1rem;
    }
    
    .payment-method-option.selected label {
        border-color: #0ea5e9;
        background: #eff6ff;
    }
    
    .card-form-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .card-form-grid.two-col {
        grid-template-columns: 2fr 1fr;
    }
}

/* Admin Panel Mobile Optimization */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        width: 280px;
        background: white;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
    }
    
    .admin-sidebar.active {
        transform: translateX(0);
    }
    
    .admin-main {
        margin-left: 0 !important;
        padding: 1rem;
    }
    
    .sidebar-toggle {
        display: block !important;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 1001;
        background: #0ea5e9;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 0.75rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .admin-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .data-table {
        font-size: 0.875rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .content-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .actions {
        width: 100%;
    }
    
    .actions .btn {
        width: 100%;
    }
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 1s ease-in-out;
}

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

/* Card hover effects */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.image-zoom {
    transition: transform 0.5s ease;
}

.card-hover:hover .image-zoom {
    transform: scale(1.05);
}

.gradient-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.1) 100%);
    transition: background 0.3s ease;
}

.card-hover:hover .gradient-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 40%, rgba(0, 0, 0, 0.2) 100%);
}

.text-reveal {
    transition: transform 0.3s ease;
}

.card-hover:hover .text-reveal {
    transform: translateY(-5px);
}

/* Button pulse animation */
.button-pulse {
    position: relative;
}

.button-pulse::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 9999px;
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(14, 165, 233, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    }
}

/* Ensure footer is visible */
footer {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure newsletter section is visible */
.bg-primary-900 {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Enhanced Airplane Layout Styles */
.airplane-container {
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.aircraft-front {
    text-align: center;
    font-weight: 600;
    color: #4F46E5;
    margin-bottom: 20px;
    padding: 10px;
    background: linear-gradient(45deg, #EEF2FF, #E0E7FF);
    border-radius: 10px;
    border: 2px solid #C7D2FE;
}

.aircraft-rear {
    text-align: center;
    font-weight: 600;
    color: #4F46E5;
    margin-top: 20px;
    padding: 10px;
    background: linear-gradient(45deg, #EEF2FF, #E0E7FF);
    border-radius: 10px;
    border: 2px solid #C7D2FE;
}

.seat-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    gap: 4px;
}

.row-number {
    width: 30px;
    text-align: center;
    font-weight: 600;
    color: #6B7280;
    font-size: 14px;
}

.seat {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #D1D5DB;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    background: #F9FAFB;
    color: #374151;
}

.seat:hover:not(.occupied) {
    transform: scale(1.1);
    border-color: #4F46E5;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
}

.seat.selected {
    background: #4F46E5 !important;
    border-color: #3730A3 !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4) !important;
    position: relative;
}

.seat.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: white;
    z-index: 1;
}

.seat.occupied {
    background: #9CA3AF;
    border-color: #6B7280;
    color: white;
    cursor: not-allowed;
}

.seat.premium {
    background: #FEF3C7;
    border-color: #F59E0B;
    color: #92400E;
}

.seat.premium.selected {
    background: #F59E0B;
    border-color: #D97706;
    color: white;
}

.seat.extra_legroom {
    background: #D1FAE5;
    border-color: #10B981;
    color: #065F46;
}

.seat.extra_legroom.selected {
    background: #10B981;
    border-color: #059669;
    color: white;
}

.seat.business {
    background: #F3E8FF;
    border-color: #8B5CF6;
    color: #5B21B6;
}

.seat.business.selected {
    background: #8B5CF6;
    border-color: #7C3AED;
    color: white;
}

.aisle {
    width: 24px;
    height: 32px;
    background: linear-gradient(to bottom, #E5E7EB, #F3F4F6);
    border-radius: 4px;
    margin: 0 8px;
    position: relative;
}

.aisle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 20px;
    background: #D1D5DB;
    border-radius: 1px;
}

.emergency-exit {
    text-align: center;
    font-size: 11px;
    color: #DC2626;
    font-weight: 600;
    margin: 8px 0;
    padding: 4px 8px;
    background: #FEF2F2;
    border-radius: 4px;
    border: 1px solid #FECACA;
}

/* Multi-Stop Flight Styles */
.segment-container {
    animation: fadeIn 0.3s ease-in-out;
}

.segment-container.hidden {
    display: none;
}

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

/* Tab Styles for Multi-Stop */
#segment-tabs button {
    transition: all 0.2s ease;
    position: relative;
}

#segment-tabs button:hover {
    background: #F9FAFB;
}

#segment-tabs button.border-primary-500 {
    background: linear-gradient(to bottom, #EEF2FF, #F8FAFC);
}

/* Progress indicator for multi-stop */
.flight-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
    padding: 15px;
    background: #F8FAFC;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}

.flight-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.flight-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #E2E8F0;
    z-index: 1;
}

.flight-progress-step.completed::after {
    background: #10B981;
}

.flight-progress-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    position: relative;
    z-index: 2;
}

.flight-progress-step.completed .flight-progress-icon {
    background: #10B981;
    color: white;
}

.flight-progress-step.active .flight-progress-icon {
    background: #4F46E5;
    color: white;
}

/* Seat Selection Summary */
.seat-selection-summary {
    position: sticky;
    top: 20px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.segment-seat-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #E2E8F0;
}

.segment-seat-count:last-child {
    border-bottom: none;
}

.segment-seat-count .segment-name {
    font-weight: 600;
    color: #374151;
}

.segment-seat-count .seat-count {
    font-size: 14px;
    color: #6B7280;
}

.segment-seat-count .seat-count.complete {
    color: #10B981;
    font-weight: 600;
}

.segment-seat-count .seat-count.incomplete {
    color: #EF4444;
    font-weight: 600;
}

/* Enhanced Continue Button */
#continue-button {
    position: relative;
    overflow: hidden;
}

#continue-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

#continue-button:hover::before {
    left: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .airplane-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .seat {
        width: 28px;
        height: 28px;
        font-size: 9px;
    }
    
    .seat-row {
        gap: 2px;
        margin-bottom: 4px;
    }
    
    .row-number {
        width: 25px;
        font-size: 12px;
    }
    
    .aisle {
        width: 20px;
        height: 28px;
        margin: 0 4px;
    }
    
    #segment-tabs button {
        padding: 12px 8px;
        font-size: 12px;
    }
}
