:root {
    --brand-primary: #00a0dc; /* Skyscanner Blue */
    --brand-primary-hover: #0087b8;
    --brand-dark: #05203c; /* Deep Blue for text/headings */
    --brand-dark-hover: #031526;
    --bg-gray: #f1f5f9;
    --border-color: #cbd5e1;
    --white: #ffffff;
    --success: #00a698;
    --danger: #d9383a;
    --text-main: #05203c;
    --text-muted: #64748b;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; color: var(--text-main); background-color: var(--white); overflow-x: hidden; }

/* Custom Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--brand-dark); color: var(--white); padding: 15px 25px; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); font-weight: 600; font-size: 0.95rem; transform: translateX(120%); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); border-left: 5px solid var(--brand-primary); }
.toast.show { transform: translateX(0); }

/* Navbars */
.top-nav { background-color: var(--brand-dark); color: var(--white); font-size: 0.85rem; font-weight: 500; }
.nav-container { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; padding: 10px 20px; }
.nav-left a, .nav-right a { color: #cbd5e1; text-decoration: none; margin-right: 20px; transition: color 0.2s; }
.nav-left a:hover, .nav-right a:hover { color: var(--white); }
.nav-right .highlight { color: var(--brand-primary); font-weight: 700; }

.main-header { background-color: var(--white); box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.header-container { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; padding: 15px 20px; }
.logo { margin-right: 40px; }
.main-menu { list-style: none; display: flex; gap: 25px; }
.main-menu a { color: var(--brand-dark); text-decoration: none; font-weight: 600; font-size: 1rem; transition: color 0.2s; padding-bottom: 5px; }
.main-menu a:hover { color: var(--brand-primary); }
.main-menu a.active-menu { color: var(--brand-primary); border-bottom: 2px solid var(--brand-primary); }

/* Views */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Hero Section */
.hero-section { position: relative; padding: 60px 20px; min-height: 450px; display: flex; justify-content: center; align-items: flex-start; }
.hero-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(rgba(5, 32, 60, 0.7), rgba(5, 32, 60, 0.7)), url('https://images.unsplash.com/photo-1436491865332-7a615061c4ca?auto=format&fit=crop&w=2000&q=80') center/cover; z-index: -1; }
.search-container { width: 100%; max-width: 1100px; margin-top: 40px; }
.search-title { color: var(--white); font-size: 3rem; font-weight: 800; margin-bottom: 30px; letter-spacing: -1px; text-align: center; }
.search-widget { background-color: var(--white); border-radius: 12px; padding: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.search-tabs { display: flex; gap: 15px; margin-bottom: 20px; }
.search-tabs button { background: transparent; border: none; color: var(--text-main); font-size: 1rem; font-weight: 600; padding: 8px 15px; cursor: pointer; border-radius: 20px; transition: all 0.2s; }
.search-tabs button.active { background: var(--brand-dark); color: var(--white); }
.search-tabs button:hover:not(.active) { background: var(--bg-gray); }

.flight-form { background: transparent; }
.form-row { display: flex; gap: 10px; margin-bottom: 15px; }
.main-row { align-items: center; }
.input-block { flex: 1; min-width: 180px; position: relative; }
.input-block label { display: block; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.input-block input, .input-block select { width: 100%; border: 1px solid var(--border-color); border-radius: 4px; padding: 10px; font-size: 1rem; color: var(--brand-dark); font-weight: 600; background: var(--white); outline: none; transition: border-color 0.2s; }
.input-block input:focus, .input-block select:focus { border-color: var(--brand-primary); }
.edit-inline-input { width: 100%; padding: 12px; border: none; border-radius: 4px; font-size: 1rem; font-weight: 700; color: var(--brand-dark); outline: none; }

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}
.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid var(--bg-gray);
    display: flex;
    flex-direction: column;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--bg-gray); }
.ac-main { font-weight: 700; color: var(--brand-dark); font-size: 0.95rem; margin-bottom: 2px; }
.ac-sub { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.swap-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: var(--bg-gray); border-radius: 50%; color: var(--brand-dark); cursor: pointer; margin-top: 20px; transition: background 0.2s, transform 0.3s ease; }
.swap-icon:hover { background: #e2e8f0; }
.swap-icon.swapping { transform: rotate(180deg); }

.btn-primary { background-color: var(--brand-primary); color: var(--white); border: none; padding: 14px 35px; font-size: 1.1rem; font-weight: 700; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.btn-primary:hover { background-color: var(--brand-primary-hover); }
.btn-secondary { background-color: transparent; color: var(--brand-primary); border: 2px solid var(--brand-primary); padding: 8px 20px; font-size: 0.95rem; font-weight: 700; border-radius: 8px; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background-color: var(--bg-gray); }

/* Loader View */
#view-loader { text-align: center; padding: 120px 20px; }
.plane-loader { margin-bottom: 30px; animation: fly 2s infinite ease-in-out; }
#view-loader h2 { color: var(--brand-dark); font-size: 2.2rem; font-weight: 800; margin-bottom: 20px; }
.progress-bar { width: 100%; max-width: 400px; height: 6px; background: #e2e8f0; border-radius: 3px; margin: 0 auto 20px auto; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand-primary); width: 0%; animation: fillBar 3s forwards; }
.loader-text { color: var(--text-muted); font-size: 1.1rem; }
@keyframes fly { 0% { transform: translateY(0) scale(1); } 50% { transform: translateY(-15px) scale(1.1); } 100% { transform: translateY(0) scale(1); } }
@keyframes fillBar { 0% { width: 0%; } 100% { width: 100%; } }

/* Aggregator Results Layout */
.results-top-bar { background: var(--white); border-bottom: 1px solid var(--border-color); padding: 15px 20px; position: sticky; top: 62px; z-index: 990; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.results-top-container { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.search-summary h3 { font-size: 1.2rem; font-weight: 800; color: var(--brand-dark); margin-bottom: 2px; }
.search-summary h3 span { color: var(--text-muted); font-weight: 400; margin: 0 10px; }
.search-summary p { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }

.results-layout-sky { max-width: 1100px; margin: 30px auto; display: grid; grid-template-columns: 260px 1fr; gap: 30px; padding: 0 20px 80px 20px; }

/* Sidebar */
.filters-sidebar { background: transparent; }
.filter-group { border-bottom: 1px solid var(--border-color); padding-bottom: 20px; margin-bottom: 20px; }
.filter-group h4 { font-size: 1rem; font-weight: 700; color: var(--brand-dark); margin-bottom: 15px; }
.custom-checkbox { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; cursor: pointer; font-size: 0.95rem; font-weight: 500; color: var(--text-main); }
.custom-checkbox input { cursor: pointer; width: 18px; height: 18px; accent-color: var(--brand-dark); }

/* Main Results */
.sort-tabs { display: flex; background: var(--white); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); margin-bottom: 20px; }
.sort-tab { flex: 1; padding: 15px; text-align: center; cursor: pointer; border-right: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 5px; transition: background 0.2s; }
.sort-tab:last-child { border-right: none; }
.sort-tab strong { font-size: 1rem; font-weight: 700; color: var(--brand-dark); }
.sort-tab span { font-size: 0.85rem; color: var(--text-muted); }
.sort-tab.active { border-bottom: 3px solid var(--brand-primary); }
.sort-tab:hover { background: #f8fafc; }
.highlight-tab strong { color: var(--danger); }
.results-count { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 15px; }

/* Horizontal Flight Card (Skyscanner Style) */
.flight-card-sky { background: var(--white); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.1); padding: 20px; margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; transition: box-shadow 0.2s; border: 1px solid transparent; }
.flight-card-sky:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.flight-info-area { flex: 1; padding-right: 20px; }

.leg { display: flex; align-items: center; gap: 20px; margin-bottom: 10px; }
.airline-logo-box { width: 40px; height: 40px; background: var(--bg-gray); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem; color: var(--brand-dark); border: 1px solid var(--border-color); flex-shrink: 0; }
.time-route { display: flex; flex-direction: column; }
.time-route .times { font-size: 1.2rem; font-weight: 700; color: var(--brand-dark); }
.time-route .airports { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; margin-top: 3px; }
.duration-stops { margin-left: auto; text-align: right; }
.duration-stops .dur { font-size: 0.9rem; color: var(--text-muted); font-weight: 500; }
.duration-stops .stops { font-size: 0.9rem; color: var(--success); font-weight: 600; margin-top: 3px; }
.stops.multi { color: var(--danger); }

.price-area { border-left: 1px solid var(--border-color); padding-left: 25px; text-align: right; min-width: 180px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.price-area .deal-tag { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 5px; font-weight: 600; }
.price-area .price-val { font-size: 1.6rem; font-weight: 800; color: var(--brand-dark); letter-spacing: -0.5px; margin-bottom: 12px; }
.btn-select { background: var(--success); color: var(--white); border: none; padding: 10px 25px; font-size: 1rem; font-weight: 700; border-radius: 8px; cursor: pointer; transition: background 0.2s; width: 100%; }
.btn-select:hover { background: #008f83; }

/* Glitch Flight */
.glitch-flight {
    border: 2px solid #a855f7 !important;
    background: linear-gradient(135deg, #f3e8ff 0%, #faf5ff 100%);
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.2);
    position: relative;
    overflow: hidden;
}

.glitch-price-area {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.old-price {
    text-decoration: line-through;
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: -5px;
}
.glitch-flight .btn-select {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
    border: none;
}
.glitch-flight .btn-select:hover { background: #7c3aed; }

/* Modal CPA */
.modal { display: none; position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(5, 32, 60, 0.9); z-index: 9999; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal.active { display: flex; animation: fadeIn 0.3s; }
.modal-box { background: var(--white); width: 90%; max-width: 500px; border-radius: 12px; overflow: hidden; box-shadow: 0 25px 50px rgba(0,0,0,0.3); }
.modal-header { background: var(--brand-dark); color: var(--white); padding: 20px; text-align: center; font-size: 1.3rem; font-weight: 800; }
.modal-body { padding: 35px; text-align: center; }
.modal-body p { margin-bottom: 20px; font-size: 1rem; line-height: 1.6; color: var(--text-main); font-weight: 500; }
.modal-body strong { color: var(--danger); font-weight: 700; }

/* Destinations */
.destinations-section { max-width: 1100px; margin: 60px auto; padding: 0 20px; }
.destinations-section h2 { color: var(--brand-dark); font-size: 2rem; font-weight: 800; margin-bottom: 25px; letter-spacing: -0.5px; }
.dest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.dest-card { background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0,0,0,0.05); cursor: pointer; transition: transform 0.3s, box-shadow 0.3s; border: 1px solid var(--border-color); }
.dest-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); border-color: var(--brand-primary); }
.dest-card img { width: 100%; height: 160px; object-fit: cover; }
.dest-info { padding: 20px; }
.dest-info h3 { color: var(--brand-dark); margin-bottom: 8px; font-size: 1.2rem; font-weight: 800; }
.dest-info p { color: var(--text-muted); font-weight: 500; font-size: 1rem; }
.dest-info span { color: var(--brand-primary); font-size: 1.3rem; font-weight: 800; display: block; margin-top: 2px; }

/* Hotel and Car Cards */
.media-card-sky { background: var(--white); border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,0.1); display: flex; margin-bottom: 15px; overflow: hidden; transition: box-shadow 0.2s; border: 1px solid transparent; height: 160px; }
.media-card-sky:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.media-img { width: 240px; flex-shrink: 0; }
.media-img img { width: 100%; height: 100%; object-fit: cover; }
.media-content { flex: 1; padding: 20px; display: flex; justify-content: space-between; }
.media-info h3 { font-size: 1.3rem; font-weight: 800; color: var(--brand-dark); margin-bottom: 5px; }
.media-info .stars { color: #f59e0b; font-size: 0.9rem; margin-bottom: 10px; letter-spacing: 2px; }
.media-info .amenities { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; display: flex; gap: 10px; margin-top: 15px; }
.media-price-area { border-left: 1px solid var(--border-color); padding-left: 20px; text-align: right; min-width: 160px; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; }
.media-price-area .price-val { font-size: 1.6rem; font-weight: 800; color: var(--brand-dark); letter-spacing: -0.5px; margin-bottom: 12px; }
.media-price-area .price-sub { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }

.glitch-flight.media-card-sky { border: 1px solid #8b5cf6; background: #faf5ff; }

/* Footer */
.site-footer { background-color: var(--brand-dark); color: var(--white); padding: 50px 20px; border-top: 4px solid var(--brand-primary); }
.footer-container { max-width: 1200px; margin: 0 auto; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 35px; margin-bottom: 25px; flex-wrap: wrap; }
.footer-links a { color: #cbd5e1; text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: color 0.2s; }
.footer-links a:hover { color: var(--white); text-decoration: underline; }
.copyright { color: #94a3b8; font-size: 0.85rem; font-weight: 400; line-height: 1.5; }

/* Edit Search Inputs */
.edit-input {
    height: 46px;
    padding: 0 15px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-dark);
    background-color: var(--white);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    box-sizing: border-box;
}
.edit-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

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

.highlight-error {
    border: 2px solid var(--danger) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.4) !important;
    animation: shake 0.5s;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    /* Navigations */
    .top-nav .nav-left { display: none; }
    .top-nav .nav-container { justify-content: center; padding: 5px; }
    
    .header-container { flex-direction: column; padding: 15px 10px; }
    .logo { margin-right: 0; margin-bottom: 15px; }
    .main-menu { width: 100%; justify-content: space-between; gap: 5px; padding-bottom: 0; }
    .main-menu a { font-size: 0.95rem; }

    /* Hero section */
    .hero-section { padding: 30px 15px; min-height: auto; }
    .search-title { font-size: 1.8rem; margin-bottom: 20px; text-align: center; line-height: 1.2; }
    .search-widget { padding: 15px; width: 100%; box-sizing: border-box; }
    .search-tabs { justify-content: center; margin-bottom: 15px; }
    
    /* Form */
    .form-row { flex-direction: column; gap: 10px; width: 100%; margin-bottom: 10px; }
    .input-block { width: 100%; flex: none; }
    .input-block input, .input-block select { width: 100%; box-sizing: border-box; }
    .swap-icon { align-self: center; transform: rotate(90deg); margin: 0; }
    .swap-icon.swapping { transform: rotate(270deg); }
    .btn-primary { width: 100%; box-sizing: border-box; margin-top: 10px; }
    
    /* Results Layout */
    .results-layout-sky { grid-template-columns: 1fr; padding: 0 10px 40px; margin-top: 15px; gap: 15px; }
    .filters-sidebar { display: none; } /* Ascundem filtrele pe mobil pentru a afisa direct rezultatele */
    .results-count { display: none; } /* Ascundem nr rezultate pe mobil pt a economisi spatiu */
    .results-top-container { flex-direction: column; align-items: stretch; gap: 10px; }
    .edit-search-bar { width: 100%; flex-direction: column; gap: 10px; }
    .edit-input { width: 100%; box-sizing: border-box; margin-right: 0 !important; }
    .edit-search-bar .btn-secondary { width: 100%; box-sizing: border-box; }
    
    /* Flight Cards */
    .flight-card-sky { flex-direction: column; align-items: stretch; padding: 15px; }
    .flight-info-area { width: 100%; padding-right: 0; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 15px; }
    .time-route { flex: 1; }
    .duration-stops { text-align: right; }
    .price-area { border-left: none; padding-left: 0; width: 100%; align-items: center; flex-direction: row; justify-content: space-between; }
    .price-area .price-val { margin-bottom: 0; font-size: 1.4rem; }
    .btn-select { width: auto; padding: 10px 20px; }
    
    /* Glitch Flight Mobile adjustment */
    .glitch-price-area { flex-direction: row; justify-content: space-between; width: 100%; align-items: center; }
    .glitch-price-area > div { display: flex; flex-direction: column; }
    
    /* Media Cards (Hotel/Car) */
    .media-card-sky { flex-direction: column; height: auto; }
    .media-img { width: 100%; height: 200px; }
    .media-content { flex-direction: column; gap: 15px; padding: 15px; }
    .media-price-area { border-left: none; padding-left: 0; align-items: flex-start; flex-direction: row; justify-content: space-between; width: 100%; }
    
    /* Sort Tabs */
    .sort-tabs { overflow-x: auto; display: flex; width: 100%; }
    .sort-tab { padding: 10px 5px; flex: 1; min-width: 80px; }
    
    /* Modals */
    .modal-box { width: 95%; margin: 0 auto; }
    .modal-body { padding: 20px; }
}
