/**
 * Flight Pricer - Stylesheet
 * Responsive design for flight search functionality
 */

/* ========================================
   Container & Layout
   ======================================== */

.flight-pricer-wrapper {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.flight-pricer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.flight-pricer-section {
    margin-bottom: 40px;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Header
   ======================================== */

.flight-pricer-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.flight-pricer-title {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.flight-pricer-subtitle {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
}

/* ========================================
   Section Headers
   ======================================== */

.section-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.section-header h2 {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    color: #333;
}

.section-header p {
    margin: 0;
    color: #666;
    font-size: 1rem;
}

.route-info {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 600;
}

/* ========================================
   Forms
   ======================================== */

.flight-pricer-form {
    max-width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.required {
    color: #e74c3c;
    margin-left: 4px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"] {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: white;
    cursor: pointer;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

.form-group input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 30px;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-icon {
    font-size: 1.2em;
}

/* ========================================
   Flight Results Grid
   ======================================== */

.flight-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.flight-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.flight-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.flight-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.flight-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flight-details {
    padding: 20px;
}

.flight-aircraft {
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    color: #333;
    font-weight: 600;
}

.flight-description {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.flight-pricing {
    padding: 20px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

.price-breakdown {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: #666;
}

.total-price {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

.btn-select-flight {
    width: 100%;
}

/* ========================================
   Loading Spinner
   ======================================== */

.loading-spinner {
    text-align: center;
    padding: 30px;
}

.spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.loading-spinner p {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

/* ========================================
   Error Messages
   ======================================== */

.error-message {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 20px 0;
    color: #856404;
}

.error-message p {
    margin: 0;
    font-size: 0.95rem;
}

/* ========================================
   Success Section
   ======================================== */

.success-section {
    text-align: center;
}

.success-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #28a745;
    color: white;
    font-size: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.success-section h2 {
    color: #28a745;
    font-size: 2rem;
    margin: 0 0 15px 0;
}

.success-section p {
    color: #666;
    font-size: 1.1rem;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .flight-pricer-header {
        padding: 30px 15px;
    }

    .flight-pricer-title {
        font-size: 2rem;
    }

    .flight-pricer-section {
        padding: 20px 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .flight-results-grid {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: 1.5rem;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .flight-pricer-title {
        font-size: 1.6rem;
    }

    .flight-pricer-subtitle {
        font-size: 1rem;
    }

    .total-price {
        font-size: 1.1rem;
    }
}

/* ========================================
   Selected Flight Display
   ======================================== */

.selected-flight-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.selected-flight-display h3 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
}

.selected-flight-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px;
}

.selected-flight-image {
    width: 200px;
    height: 130px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.selected-flight-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.selected-flight-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.selected-flight-info h4 {
    margin: 0 0 10px 0;
    font-size: 1.4rem;
    color: white;
}

.selected-flight-info p {
    margin: 0;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
}

.selected-flight-info strong {
    color: rgba(255, 255, 255, 1);
    font-weight: 600;
}

.selected-flight-price {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.selected-flight-price .price-label {
    font-size: 1rem;
    font-weight: 600;
}

.selected-flight-price .price-value {
    font-size: 1.8rem;
    font-weight: 700;
}

@media (max-width: 768px) {
    .selected-flight-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .selected-flight-image {
        width: 100%;
        height: 180px;
    }

    .selected-flight-price {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .selected-flight-price .price-value {
        font-size: 1.5rem;
    }
}

/* ========================================
   Debug Panel
   ======================================== */

.debug-panel {
    margin-top: 40px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}

.debug-header {
    background: #343a40;
    color: white;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
}

.debug-header:hover {
    background: #23272b;
}

.debug-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.debug-content {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.debug-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
}

.debug-section:last-child {
    border-bottom: none;
}

.debug-section h4 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #495057;
    font-weight: 600;
}

.debug-section pre {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #212529;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ========================================
   Error Modal
   ======================================== */

.flight-pricer-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-in;
}

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

.flight-pricer-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

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

.flight-pricer-modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flight-pricer-modal-icon svg {
    color: #ffffff;
    width: 48px;
    height: 48px;
}

.flight-pricer-modal h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.flight-pricer-modal p {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 32px 0;
}

.flight-pricer-modal-close {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.flight-pricer-modal-close:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.flight-pricer-modal-close:active {
    transform: translateY(0);
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .flight-pricer-header,
    .btn,
    .loading-spinner,
    .error-message,
    .debug-panel,
    .flight-pricer-modal-overlay {
        display: none;
    }

    .flight-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ========================================
   reCAPTCHA Container
   ======================================== */

.recaptcha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.recaptcha-container .g-recaptcha {
    display: inline-block;
}

@media (max-width: 768px) {
    .recaptcha-container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .recaptcha-container {
        padding: 10px;
        overflow: auto;
    }

    .recaptcha-container .g-recaptcha {
        transform: scale(0.85);
        transform-origin: 0 0;
    }
}

/* ========================================
   Inquiry Form (for generated route pages)
   ======================================== */

.flight-inquiry-form-wrapper {
    max-width: 800px;
    margin: 0 auto;
}

.inquiry-form {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

.inquiry-form .form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
}

.inquiry-form .form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Success message styling */
.success-message {
    background: #d4edda;
    border: 2px solid #28a745;
    border-radius: 6px;
    padding: 15px 20px;
    margin: 20px 0;
    color: #155724;
}

.success-message p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .inquiry-form {
        padding: 20px 15px;
    }

    .flight-inquiry-form-wrapper {
        padding: 0 10px;
    }
}
