/* 
   style.css - Die DBE-Fly | Flight Booking Website
   Míriam Domínguez Martínez - 25.03.2026
*/

/* ============================================
   1. ROOT VARIABLES & COLORS
*/

/* Root variables for consistent theming */
:root {
    --primary-color: #17a2a2;
    --primary-dark: #0d6f6f;
    --dark-bg: #2d2d2d;
    --light-bg: #f5f5f5;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #e0e0e0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* ============================================
   2. FONTS
*/

@font-face {
    font-family: 'Segoe UI';
    src: url('../fonts/segoe-ui-regular.woff2') format('woff2'),
         url('../fonts/segoe-ui-regular.woff') format('woff');
    font-weight: 400;
}

@font-face {
    font-family: 'Segoe UI';
    src: url('../fonts/segoe-ui-semibold.woff2') format('woff2'),
         url('../fonts/segoe-ui-semibold.woff') format('woff');
    font-weight: 600;
}

@font-face {
    font-family: 'Segoe UI';
    src: url('../fonts/segoe-ui-bold.woff2') format('woff2'),
         url('../fonts/segoe-ui-bold.woff') format('woff');
    font-weight: 700;
}

/* ============================================
   3. GLOBAL STYLES
*/

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Enables smooth scrolling for anchor links */
}

body {
    font-family: 'Segoe UI', sans-serif; /* Local font Segoe UI */
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6; 
}

/* ============================================
   4. HEADER & NAVIGATION
*/

/* Header styles */
header {
    background-color: var(--white);
    padding: 20px 0;
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Container for header content */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo styles */
.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Full logo image for larger screens */
.logo-img-full {
    width: 80px;
    height: auto;
}

/* Compact logo image for smaller screens */
.logo-img-compact {
    width: 40px;
    height: auto;
    display: none; /* Hidden by default, shown on smaller screens */
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
}

/* Tagline styles */
.logo p {
    font-size: 10px;
    color: var(--primary-color);
    letter-spacing: 1px;
    margin: 0;
}

/* Navigation styles */
nav ul {
    list-style: none;
    display: flex;
    gap: 30px; /* Increased gap for better spacing between links */
}

nav a {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease; /* Smooth color transition for hover effect */
}

nav a:hover {
    color: var(--primary-color); /* Hover effect for navigation links */
}

/* ============================================
   5. HERO SECTION
*/

/* Hero section with parallax background and dark overlay for better text visibility */
.hero {
    position: relative;
    height: 600px;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), 
                url('img/background.jpg') center/cover; /* Background image with dark overlay for better text visibility */
    background-attachment: fixed; /* Parallax effect */
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    padding-top: 0;
}


.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(23, 162, 162, 0.1), rgba(13, 111, 111, 0.2)); /* Subtle gradient overlay for added depth */
    z-index: 1;
}

/* Content inside the hero section */
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
}

/* ============================================
   6. TABS SECTION
*/

.tabs-container {
    margin-bottom: 0;
}

.tabs {
    display: flex;
    gap: 1px;
    background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background for better contrast */
    border-radius: 0; /* Cambiar de 4px a 0 */
    overflow: hidden;
    flex-wrap: wrap; /* Allows tabs to wrap on smaller screens */
    border-radius: 8px 8px 0 0; /* Add border-radius on the top*/
}

.tab {
    flex: 1; /* Each tab takes equal space */
    min-width: 120px;
    padding: 12px 20px;
    background-color: rgba(0, 0, 0, 0.4); /* Slightly lighter background for inactive tabs */
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    display: flex; /* Flexbox for icon and text alignment */
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease; /* Smooth transition for hover and active states */
    border: none;
}

.tab:hover {
    background-color: rgba(0, 0, 0, 0.8); /* Darker background on hover */
}

.tab.active {
    background-color: var(--white); /* White background for active tab for better contrast */
    color: var(--primary-color); /* Primary color for active tab text */
}

.tab-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1); /* Ensures icons are white for better visibility since tabs are dark */
}

/* I've tried with "fill", but the SVG color doesn't change, 
   so I used "filter" to achieve the desired color for active icons.
*/
.tab-icon-active {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(65%) sepia(56%) saturate(1199%) hue-rotate(122deg) brightness(80%) contrast(86%);
}

/* ============================================
   7. BOOKING FORM
*/

/* Form wrapper with white background and shadow for better visibility against the hero background */
.form-wrapper {
    background-color: var(--white);
    padding: 30px;
    box-shadow: none;
    position: relative;
    z-index: 3;
    border-radius: 0 0 8px 8px ; /* Add border-radius on bottom */
}

.booking-form {
    display: flex;
    flex-direction: column; /* Stack form elements vertically */
    gap: 20px; /* Space between form sections */
}

/* Trip type selector */
.trip-selector {
    display: flex;
    gap: 20px;
}

.trip-selector label { /* Flexbox for better alignment of radio buttons and labels */
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer; /* Cursor pointer */
}

/* Radio buttons */
.trip-selector input[type="radio"] {
    cursor: pointer; /* Cursor pointer */
}

/* Form grid */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns for better layout */
    gap: 20px; /* Space between form groups */
}

.form-group {
    position: relative;
    display: flex; /* Flexbox for better alignment of labels and inputs */
    flex-direction: column; /* Stack label and input vertically */
}

/* Form labels */
.form-group label { 
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dark); 
    margin-bottom: 8px;
    text-transform: uppercase; /* Uppercase for better readability */
    letter-spacing: 0.5px;
}

/* Form inputs and selects */
.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit; /* Inherit font from body for consistency */
    transition: all 0.3s ease; /* Smooth transition for focus state */
    background-color: var(--white);
}

/* Focus state for inputs and selects */
.form-group input:focus,
.form-group select:focus {
    outline: none; /* Remove default outline */
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(23, 162, 162, 0.1); /* Subtle shadow for better focus visibility */
}

.form-icon {
    position: absolute;
    right: 16px;
    bottom: 12px;
    width: 20px;
    height: 20px;
    color: var(--text-light);
    pointer-events: none; /* Allows clicks to pass through the icon to the input */
}

/* Checkbox group */
.checkbox-group {
    display: flex; /* Flexbox for better alignment of checkbox and label */
    align-items: center;
    gap: 8px;
}

.checkbox-group input[type="checkbox"] {
    cursor: pointer; /* Cursor pointer */
    width: 18px;
    height: 18px;
}

.checkbox-group label {
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer; /* Cursor pointer */
}

/* Search button */
.search-btn {
    padding: 14px 32px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none; /* Remove default border */
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer; /* Cursor pointer */
    transition: all 0.3s ease; /* Smooth transition for hover and active states */
    text-transform: uppercase; /* Uppercase for better readability */
    letter-spacing: 0.5px; 
    align-self: flex-end; /* Aligns the search button to the right in the form */
}

.search-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);  /* Slight lift effect on hover for */
    box-shadow: var(--shadow-lg); /* Add shadow on hover*/
}

.search-btn:active {
    transform: translateY(0);  /* Reset transform on active state */
    box-shadow: var(--shadow); /* Reduce shadow on active state */
}

/* ============================================
   8. MAIN CONTENT AREA
*/

.main-content {
    padding: 60px 20px;
    background-color: var(--white);
}

.content-container {
    max-width: 1200px; /* Center the content and set a max width */
    margin: 0 auto;    /* Center the content */
    display: grid;     /* Grid layout for featured cards */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid with a minimum card width of 300px */
    gap: 30px;         /* Space between cards */
}

/* Featured cards */
.featured-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for hover effects */
    cursor: pointer; /* Cursor pointer */
}

.featured-card:hover {
    transform: translateY(-8px);  /* Lift effect on hover */
    box-shadow: var(--shadow-lg); /* Add shadow on hover */
}

.featured-card img {
    width: 100%;
    height: 250px;
    object-fit: cover; /* Ensures the image covers the card area without distortion */
}

.card-content {
    padding: 24px;
}

.card-label {
    display: inline-block; /* Makes the label fit its content */
    font-size: 11px;       /* Smaller font size for labels */
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase; /* Uppercase for better readability */
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.featured-card h3 {
    font-size: 20px;
    color: var(--text-dark); /* Darker text color for better contrast */
    margin-bottom: 12px;
}
.featured-card p {
    font-size: 14px;
    color: var(--text-light); /* Lighter text color for better readability */
    line-height: 1.4;         /* Increased line height*/
}

/* ============================================
   9. FOOTER
*/

/* Footer styles */
footer {
    background-color: var(--white); /* White background for better contrast with text */
    color: var(--dark-bg);          /* Darker text color for better contrast */
    padding: 32px 48px;
    text-align: center;
    font-size: 14.4px;
}

footer p {
    color: var(--dark-bg); /* Darker text color for better contrast */
    margin: 0;             /* Removes default margin from the footer paragraph for better spacing */
}

/* ============================================
   10. RESPONSIVE DESIGN - TABLET
*/

@media (max-width: 768px) {
    
    /* Header */
    .header-container {
        flex-direction: column;
        gap: 20px;
    }

    nav {
        width: 100%;
    }

    nav ul {
        flex-direction: row;
        gap: 10px;
        text-align: center;
        justify-content: center;
        flex-wrap: wrap;
    }

    nav a {
        font-size: 9px;
        display: inline-block;
        padding: 8px 8px;
    }

    /* Hero section */
    .hero {
        height: 600px;
        background-attachment: scroll;
    }

    /* Tabs */
    .tabs-container {
        margin-bottom: 0;
    }

    .tabs {
        gap: 1px;
        flex-wrap: nowrap;
        background-color: rgba(0, 0, 0, 0.5);
        border-radius: 0;
        border-radius: 8px 8px 0 0; /* Add border-radius on the top*/
    }

    .tab {
        flex: 1;
        min-width: auto;
        padding: 12px 20px;
        font-size: 0; /* Hide text */
        gap: 8px;
        color: var(--white);
        background-color: rgba(0, 0, 0, 0.4);
    }

    .tab:hover {
        background-color: rgba(0, 0, 0, 0.5);
    }

    .tab.active {
        background-color: var(--white);
        color: var(--primary-color);
    }

    .tab-icon {
        width: 16px;
        height: 16px;
        filter: brightness(0) invert(1);
    }

    /* Form */
    .form-wrapper {
        padding: 20px;
        border-radius: 0;
        box-shadow: none;
        border-radius: 0 0 8px 8px ; /* Add border-radius on bottom */
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .search-btn {
        align-self: stretch;
    }

    /* Main content */
    .main-content {
        display: none !important;
    }

    .content-container {
        display: none !important;
    }

    /* Footer */
    footer {
        display: block !important;
        visibility: visible !important;
        background-color: var(--white);
        color: var(--dark-bg);
        padding: 12px 20px;
        font-size: 12px;
        text-align: center;
        margin: auto;
        margin-bottom: auto;
    }

    footer p {
        color: var(--dark-bg);
        margin: 0;
    }
}

/* ============================================
   11. RESPONSIVE DESIGN - MOBILE
*/

@media (max-width: 480px) {
    
    /* Header */
    header {
        position: relative;
        z-index: 100;
        padding: 15px 0;
    }

    .header-container {
        gap: 12px;
        padding: 10px 10px;
    }

    .logo h1 {
        font-size: 22px;
    }

    .logo p {
        font-size: 9px;
    }

    nav ul {
        gap: 10px;
    }

    nav a {
        padding: 8px 8px;
    }

    /* Hero section */
    .hero {
        height: 100vh;
        margin-top: 0;
    }

    .hero-content {
        padding: 0 10px;
        display: flex;
        flex-direction: column;
    }

    /* Tabs */
    /* No margin to keep it symmetric to the hero section */
    .tabs-container {
        margin-bottom: 0; 
        margin-left: 0;
        margin-right: 0;
        padding: 0 10px;
    }

    .tabs {
        gap: 1px; /* Keep a small gap between tabs for better separation */
        flex-wrap: nowrap;
        background-color: rgba(0, 0, 0, 0.5);
        border-radius: 8px 8px 0 0; /* Add border-radius on the top*/
    }

    .tab {
        padding: 12px 20px;
        font-size: 0; /* Hide text */
    }

    .tab:hover {
        background-color: rgba(0, 0, 0, 0.5);
    }

    .tab.active {
        background-color: var(--white);
        color: var(--primary-color);
    }

    .tab-icon {
        width: 16px;
        height: 16px;
        filter: brightness(0) invert(1);
    }

    /* Form */
    .form-wrapper {
        padding: 16px;
        margin: 0 10px;
        transform: none;
        order: 2;
        border-radius: 0 0 8px 8px ; /* Add border-radius on bottom */
        box-shadow: none;
    }

    .trip-selector {
        flex-direction: column;
        gap: 12px;
    }

    .trip-selector label {
        margin-left: 0;
    }

    .form-grid {
        gap: 16px;
    }

    .form-group label {
        font-size: 11px;
    }

    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 13px;
    }

    .search-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    /* Main content */
    .main-content {
        display: none !important;
    }

    .content-container {
        display: none !important;
    }

    /* Footer */
    footer {
        display: block !important;
        visibility: visible !important;
        background-color: var(--white);
        color: var(--dark-bg);
        padding: 12px 20px;
        font-size: 11px;
        text-align: center;
        margin: auto;
        margin-bottom: auto;
    }

    footer p {
        color: var(--dark-bg);
        margin: 0;
    }
}
/* ============================================
   12. FLIGHT RESULTS SECTION
*/

.results-section {
    background-color: var(--light-bg);
    padding: 50px 20px 60px;
    min-height: 400px;
}

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

/* Results header row */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.results-title h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.results-subtitle {
    font-size: 14px;
    color: var(--text-light);
}

.results-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

/* Filter / sort bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn {
    padding: 7px 18px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background-color: var(--white);
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Flight results list */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Individual flight card */
.flight-card {
    background-color: var(--white);
    border-radius: 8px;
    padding: 24px 28px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.flight-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* Route section (left) */
.flight-route {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.flight-city {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.city-code {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: 1px;
}

.city-name {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
    text-align: center;
}

/* Arrow between cities */
.flight-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--primary-color);
    font-size: 22px;
    flex: 1;
    gap: 2px;
}

.arrow-line {
    width: 100%;
    height: 1px;
    background-color: var(--primary-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.arrow-duration {
    background-color: var(--white);
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0 6px;
    white-space: nowrap;
}

/* Meta info (middle) */
.flight-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 130px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: fit-content;
}

.badge-direct {
    background-color: rgba(23, 162, 162, 0.12);
    color: var(--primary-dark);
}

.badge-stops {
    background-color: rgba(23, 162, 162, 0.12);
    color: var(--primary-dark);
}

.meta-item {
    font-size: 12px;
    color: var(--text-light);
}

.class-tag {
    font-weight: 600;
    color: var(--text-dark);
}

/* Price + button (right) */
.flight-price {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 130px;
}

.price-amount {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.book-btn {
    padding: 10px 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.book-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* No results message */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 16px;
    line-height: 2;
}

/* ============================================
   12a. RESULTS - RESPONSIVE TABLET
*/

@media (max-width: 768px) {

    .results-section {
        padding: 36px 16px 48px;
    }

    .flight-card {
        flex-wrap: wrap;
        padding: 20px;
        gap: 16px;
    }

    .flight-route {
        width: 100%;
    }

    .flight-meta {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: unset;
    }

    .flight-price {
        flex-direction: row;
        align-items: center;
        width: 100%;
        justify-content: space-between;
        min-width: unset;
    }
}

/* ============================================
   12b. RESULTS - RESPONSIVE MOBILE
*/

@media (max-width: 480px) {

    .results-section {
        padding: 28px 12px 40px;
    }

    .results-title h2 {
        font-size: 20px;
    }

    .city-code {
        font-size: 18px;
    }

    .price-amount {
        font-size: 20px;
    }

    .book-btn {
        padding: 9px 16px;
        font-size: 13px;
    }

    .flight-card {
        padding: 16px;
    }
}

/* ============================================
   DESTINATION SELECT & DATE INPUTS
*/

/* Make select in form-group look identical to text inputs */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

/* Native date input styling */
input[type="date"] {
    cursor: pointer;
    color: var(--text-dark);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0; /* hide default icon, we use our own SVG via form-icon */
    position: absolute;
    right: 0;
    width: 40px;
    height: 100%;
    cursor: pointer;
}

/* Return date group hidden by default (shown by JS for round trips) */
#return-date-group {
    flex-direction: column;
}

