/* ================================================
   Schedule Generator - Modern Layout Styles
   ================================================ */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.content-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar Styles */
.navbar {
    background-color: rgb(64, 146, 204);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-logo {
    height: 30px;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.navbar a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Container & Layout */
.form-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 50px 80px;
}

.form-container h2 {
    font-size: 2rem;
    font-weight: 600;
    color: #4092cc;
    text-align: center;
    margin-bottom: 40px;
    letter-spacing: 0.5px;
}

#flight-filter-form {
    background-color: #ffffff;
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e8e8e8;
}

/* Route Type Toggle */
.route-type-container {
    margin-bottom: 35px;
    text-align: center;
}

.route-type-toggle {
    display: inline-flex;
    gap: 0;
    background: #f0f0f0;
    padding: 4px;
    border-radius: 8px;
    min-width: 280px;
}

.route-type-btn {
    flex: 1;
    padding: 10px 32px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.route-type-btn:hover:not(.selected) {
    color: #4092cc;
}

.route-type-btn.selected {
    background: #4092cc;
    color: #fff;
    box-shadow: 0 2px 4px rgba(64, 146, 204, 0.2);
}

/* Airline Selection Section */
.airline-logo-container {
    margin-bottom: 35px;
}

.airline-select-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

#airline-search {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 15px;
    display: block;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s ease;
    text-align: center;
}

#airline-search::placeholder {
    text-align: center;
}

#airline-search:focus {
    outline: none;
    border-color: #4092cc;
}

#airline-logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 25px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    width: 100%;
}

.airline-logo {
    width: 110px;
    height: auto;
    object-fit: contain;
    cursor: pointer;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: white;
}

.airline-logo:hover {
    transform: translateY(-2px);
    border-color: #4092cc;
    box-shadow: 0 2px 8px rgba(64, 146, 204, 0.15);
}

.airline-logo.selected {
    border-color: #4092cc;
    background-color: rgba(64, 146, 204, 0.05);
}

/* Aircraft Grid */
#aircraft-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 25px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    margin-bottom: 30px;
    width: 100%;
}

.aircraft-box {
    padding: 12px 24px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background-color: white;
    color: #666;
}

.aircraft-box:hover:not(.selected) {
    border-color: #4092cc;
    color: #4092cc;
    transform: translateY(-1px);
}

.aircraft-box.selected {
    background-color: #4092cc;
    color: white;
    border-color: #4092cc;
}

.aircraft-box.any-aircraft {
    font-weight: 600;
}

/* Form Rows - Multi-column Layout */
.form-row {
    display: grid;
    gap: 25px;
    margin-bottom: 30px;
}

.form-row.filters-row {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.form-row.airports-row {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* NEW - 4-column airport row */
.form-row.airports-row-four {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 10px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="time"] {
    width: 100%;
    min-height: 45px;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    background: white;
    box-sizing: border-box;
    text-align: center;
}

.form-group input::placeholder {
    text-align: center;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #4092cc;
    box-shadow: 0 0 0 3px rgba(64, 146, 204, 0.1);
}

.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23666' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 36px;
}

/* NEW - Centered buttons below airport fields */
.airport-actions-centered {
    display: flex;
    justify-content: center;
    gap: 12px;  /* Changed from 15px */
    margin-bottom: 25px;
    margin-top: 10px;
}

.airport-actions-centered button {
    padding: 6px 16px;  /* Changed from 8px 20px */
    background-color: #4092cc;
    color: white;
    border: none;
    border-radius: 5px;  /* Changed from 6px */
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;  /* Changed from 13px */
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.airport-actions-centered button:hover {
    background-color: #357ab8;
}

.airport-actions-centered button#clear-airports-btn {
    background-color: #dc3545;
}

.airport-actions-centered button#clear-airports-btn:hover {
    background-color: #c82333;
}

/* Slider Styles */
.sliders-wrapper {
    margin-bottom: 30px;
}

.slider-group {
    margin-bottom: 30px;
}

.slider-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

.slider-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* noUiSlider overrides */
.noUi-target {
    background: #f1f1f1 !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
    height: 8px !important;
}

.noUi-connects {
    border-radius: 8px !important;
}

.noUi-connect {
    background: #4092cc !important;
}

.noUi-horizontal {
    height: 8px !important;
}

.noUi-horizontal .noUi-handle {
    width: 24px !important;
    height: 24px !important;
    right: -12px !important;
    top: -8px !important;
}

.noUi-handle {
    border: none !important;
    background: #4092cc !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
    border-radius: 50% !important;
}

.noUi-handle:hover {
    background: #357ab7 !important;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none !important;
}

.noUi-state-drag * {
    cursor: grabbing !important;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 11px;
    color: #999;
    padding: 0 5px;
}

.slider-value {
    margin-top: 12px;
    text-align: center;
    font-weight: 600;
    color: #4092cc;
    font-size: 14px;
}

/* Submit Button */
.button-container {
    display: flex;
    justify-content: center;
    margin-top: 35px;
}

.button-container button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 48px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.2);
}

.button-container button:hover {
    background-color: #218838;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

/* Results Section */
.results {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 40px;
    box-sizing: border-box;
}

/* Flight Cards - Constrain width but let them be responsive */
.results .flight-card {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

/* Map Section - Use full width of results container */
#flight-map {
    max-width: 100% !important;
    width: 100% !important;
    height: 500px !important;
    margin: 40px 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

@media (max-width: 768px) {
    .results {
        padding: 0 20px;
    }
    
    .results .flight-card {
        max-width: 100%;
    }
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4092cc;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 40px auto;
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message Container */
.message-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    padding: 20px;
    text-align: center;
}

.message-text {
    font-size: 15px;
    color: #666;
    max-width: 600px;
    line-height: 1.6;
}

.message-text.error {
    color: #dc3545;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .form-container {
        padding: 40px 50px;
    }
    
    .form-row.airports-row-four {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .form-container {
        padding: 30px 40px;
    }

    .form-row.filters-row {
        grid-template-columns: 1fr;
        max-width: 600px;
    }

    .form-row.airports-row-four {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
}

@media (max-width: 768px) {
    .form-container {
        padding: 20px;
    }

    #flight-filter-form {
        padding: 25px 20px;
    }

    .form-row,
    .form-row.filters-row,
    .form-row.airports-row,
    .form-row.airports-row-four {
        grid-template-columns: 1fr;
    }

    .route-type-toggle {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .route-type-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    #airline-logo-grid,
    #aircraft-grid {
        gap: 8px;
        padding: 15px;
    }

    .airline-logo {
        width: 80px;
    }

    .slider-container {
        padding: 0 10px;
    }

    .button-container button {
        width: 100%;
        max-width: 300px;
    }
    
    /* Mobile Flight Card Fixes */
    .results {
        padding: 0 15px;
    }
    
    .flight-card-home {
        max-width: 100%;
        width: 100%;
    }

    .flight-card-home__grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
    
    .flight-card-home__airline {
        order: 1;
        width: 100%;
    }
    
    .flight-card-home__logo-container {
        margin: 0 auto;
    }

    .flight-card-home__route {
        order: 3 !important;
        background: #f8fafc !important;
        padding: 16px !important;
        border-radius: 8px !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    .flight-card-home__flight-path {
        margin: 0 auto;
    }
    
    .flight-card-home__airport {
        min-width: 80px;
    }
    
    .flight-card-home__airport-code {
        font-size: 1.5em !important;
        word-break: keep-all;
        white-space: nowrap;
    }

    .flight-card-home__details {
        order: 2 !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        gap: 20px !important;
        width: 100%;
    }
    
    .flight-card-home__detail-item {
        flex: 1;
        min-width: 0;
    }
    
    .flight-card-home__detail-value,
    .flight-card-home__detail-label {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    .flight-card-home__content {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .form-container h2 {
        font-size: 1.5rem;
    }

    .route-type-btn {
        padding: 8px 20px;
        font-size: 13px;
    }

    .aircraft-box {
        min-width: 45%;
        font-size: 12px;
    }
}

/* Footer Styles */
.footer {
    margin-top: auto;
    padding: 1.5rem 0;
    background-color: #ffffff;
    border-top: 1px solid #e8e8e8;
    width: 100%;
    font-family: 'Poppins', Arial, sans-serif;
}

.discord-link-container {
    text-align: center;
    padding: 0.75rem 0;
}

.discord-link {
    color: #5865F2;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border: 2px solid #5865F2;
    border-radius: 8px;
    display: inline-block;
    transition: all 0.2s ease;
}

.discord-link:hover {
    background-color: #5865F2;
    color: white;
}

.version-number {
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: #999;
}

/* Flight Cards */
.flight-card {
    cursor: pointer;
    margin: 2rem auto;
    user-select: none;
    transition: transform 0.2s ease;
}

.flight-card.selected .flight-card-home {
    box-shadow: 0 0 0 3px #28a745, 0 4px 12px rgba(40, 167, 69, 0.2);
    transform: translateY(-2px);
}

.flight-card:hover {
    transform: translateY(-2px);
}

.flight-card-home {
    position: relative;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1em;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.flight-card-home__accent {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 6px;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.flight-card-home__content {
    position: relative;
    z-index: 2;
    padding: 24px;
}

.flight-card-home__grid {
    display: grid;
    grid-template-columns: 140px 1fr 140px;
    gap: 24px;
    align-items: center;
}

.flight-card-home__airline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.flight-card-home__logo-container {
    background: white;
    padding: 10px;
    border-radius: 8px;
    width: 150px;
    height: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.flight-card-home__logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.flight-card-home__flight-number {
    font-size: 1.1em;
    font-weight: 600;
    color: #4092cc;
}

.flight-card-home__route {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.flight-card-home__airport {
    text-align: center;
}

.flight-card-home__airport-code {
    font-size: 1.8em;
    font-weight: 600;
    color: #2c3e50;
}

.flight-card-home__airport-label {
    font-size: 0.8em;
    color: #94a3b8;
    margin-top: 4px;
}

.flight-card-home__flight-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.flight-card-home__line {
    width: 100px;
    height: 2px;
    background: #cbd5e1;
    position: relative;
    margin: 8px 0;
}

.flight-card-home__plane {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
}

.flight-card-home__duration {
    font-size: 0.9em;
    color: #4092cc;
    font-weight: 600;
    margin-top: 4px;
}

.flight-card-home__details {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.flight-card-home__detail-item {
    text-align: center;
}

.flight-card-home__detail-label {
    font-size: 0.8em;
    color: #94a3b8;
    margin-bottom: 4px;
}

.flight-card-home__detail-value {
    font-weight: 600;
    color: #2c3e50;
}

.fly-button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.fly-button:hover {
    background-color: #218838;
    transform: translateY(-1px);
}