/* ============================================================
   SkyLink v2 - Complete Stylesheet
   Modern, clean, mobile-first
   ============================================================ */

:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --warning: #ca8a04;
    --warning-bg: #fef3c7;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }

/* Header */
.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.95);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 16px;
}
.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.logo-icon { font-size: 24px; }
.nav { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.nav-link:hover:not(.disabled) { background: var(--bg); color: var(--primary); }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }

.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: #fff;
    cursor: pointer;
    color: var(--text-secondary);
}
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.user-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}
.user-menu a:hover { color: var(--primary); }
.btn-link {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--border);
}
.btn-outline:hover { background: var(--bg); border-color: var(--primary); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; padding: 14px; font-size: 16px; }
.btn-search { margin-top: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Hero */
.hero { text-align: center; padding: 40px 0 24px; }
.hero h1 { font-size: 32px; font-weight: 700; margin-bottom: 8px; }
.hero-sub { color: var(--text-secondary); font-size: 16px; }

/* Search Card */
.search-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}
.form-field { display: flex; flex-direction: column; gap: 4px; }
.form-field label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: #fff;
    transition: var(--transition);
    font-family: inherit;
    color: var(--text);
}
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.input::placeholder { color: var(--text-muted); }

/* Popular Routes */
.popular-routes { margin-top: 32px; }
.popular-routes h3 { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.route-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.route-tag {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--card);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}
.route-tag:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Engine Card */
.engine-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    max-width: 500px;
    margin: 0 auto;
}
.engine-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 15px;
    color: var(--text-secondary);
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.supplier-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.supplier-name { width: 70px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.supplier-bar {
    flex: 1;
    height: 10px;
    background: var(--bg);
    border-radius: 5px;
    overflow: hidden;
}
.supplier-fill {
    height: 100%;
    width: 0%;
    border-radius: 5px;
    transition: width 0.8s ease-out;
}
#bar-pk { background: var(--accent); }
#bar-du { background: #8b5cf6; }
#bar-hu { background: #f59e0b; }
.supplier-price { width: 50px; text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.results-header h2 { font-size: 20px; }
.results-count { font-size: 14px; color: var(--text-secondary); }

.flight-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}
.flight-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.flight-card.best { border-color: var(--success); background: var(--success-bg); }

.flight-info { flex: 1; }
.flight-airline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.airline-code {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}
.airline-name { font-weight: 600; font-size: 15px; }
.flight-number { color: var(--text-secondary); font-size: 13px; }

.flight-route-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 12px 0;
}
.time-block { text-align: center; }
.time-block .time { font-size: 20px; font-weight: 700; }
.time-block .airport { font-size: 12px; color: var(--text-muted); }

.route-line {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.route-line .duration { font-size: 12px; color: var(--text-secondary); }
.route-line .line {
    width: 100%;
    height: 2px;
    background: var(--border);
    position: relative;
}
.route-line .line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.flight-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}
.badge-best { background: var(--success-bg); color: var(--success); }
.badge-bag { background: var(--warning-bg); color: var(--warning); }
.badge-refund { background: #e0e7ff; color: #4338ca; }

.flight-price-block { text-align: right; min-width: 100px; }
.flight-price-block .net { font-size: 12px; color: var(--text-muted); text-decoration: line-through; }
.flight-price-block .price { font-size: 24px; font-weight: 700; }
.flight-price-block .total-label { font-size: 12px; color: var(--text-muted); }

/* Booking Layout */
.booking-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
}

.flight-summary-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: sticky;
    top: 80px;
}
.flight-summary-card h3 { font-size: 16px; margin-bottom: 16px; }

.price-breakdown { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.price-row.total {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid var(--border);
}

.booking-main {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}
.booking-main h2 { font-size: 20px; margin-bottom: 20px; }

.third-party-box {
    background: var(--accent-light);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}
.checkbox-label input { width: 18px; height: 18px; accent-color: var(--accent); }
.third-party-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding-left: 28px;
}

.booking-form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Success */
.success-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 48px 32px;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: var(--shadow-lg);
}
.success-icon {
    width: 72px;
    height: 72px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
}
.success-card h2 { font-size: 24px; margin-bottom: 8px; }
.success-card > p { color: var(--text-secondary); margin-bottom: 24px; }

.pnr-display {
    background: var(--bg);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}
.pnr-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.pnr-code {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary);
    display: block;
    margin-top: 4px;
}

.success-actions { display: flex; gap: 12px; justify-content: center; }

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-box h3 { font-size: 20px; margin-bottom: 20px; }
.modal-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.modal-switch a { color: var(--accent); font-weight: 500; text-decoration: none; }

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 48px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}
.footer-links { margin-top: 8px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; margin: 0 8px; }
.footer-links a:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .nav { display: none; }
    .hero h1 { font-size: 24px; }
    .booking-layout { grid-template-columns: 1fr; }
    .flight-summary-card { position: static; }
    .flight-card { flex-direction: column; }
    .flight-price-block { text-align: left; width: 100%; }
    .form-row { grid-template-columns: 1fr; }
    .success-actions { flex-direction: column; }
}

@media (max-width: 480px) {
    .form-grid { grid-template-columns: 1fr; }
    .container { padding: 0 12px; }
    .search-card, .booking-main { padding: 16px; }
}