/* route.css - Vimania Route Page (Glassmorphism Design) */
/* Used by: uk/flights/route.php, es/vuelos/ruta.php */

:root {
    --bg-deep: #0a0a0a;
    --glass-bg: rgba(18, 18, 18, 0.75);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-hover: rgba(255, 255, 255, 0.1);

    --accent: #ff6b35;
    --accent-glow: rgba(255, 107, 53, 0.25);

    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.15);

    --text-white: #ffffff;
    --text-light: #e5e5e5;
    --text-muted: #737373;

    --font-display: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;

    --radius: 12px;
    --radius-lg: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
}

.bg-wrapper { position: fixed; inset: 0; z-index: -1; }
.bg-image { width: 100%; height: 100%; object-fit: cover; opacity: 0.35; filter: blur(2px); }
.bg-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(10,10,10,0.4) 0%,
        rgba(10,10,10,0.8) 50%,
        rgba(10,10,10,1) 85%);
}

.page-container { max-width: 960px; margin: 0 auto; padding: 1.5rem; position: relative; }
.nav { display: flex; justify-content: space-between; align-items: center; padding: 1rem 0 2rem; }
.logo { font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; color: var(--text-white); text-decoration: none; }
.logo em { color: var(--accent); font-style: italic; }
.back-link { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.back-link:hover { color: var(--text-white); }

.hero { text-align: center; padding: 2rem 0 3rem; }
.route-display { display: flex; align-items: center; justify-content: center; gap: 2rem; margin-bottom: 0.75rem; }
.city-code { font-family: var(--font-body); font-size: clamp(3rem, 10vw, 5rem); font-weight: 700; letter-spacing: -0.03em; color: var(--text-white); }
.plane-icon { font-size: 1.5rem; color: var(--accent); animation: float 3s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) translateX(0); } 50% { transform: translateY(-5px) translateX(5px); } }
.route-subtitle { color: var(--text-muted); font-size: 1.1rem; }

.main-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin-bottom: 2rem;
}

.price-section { text-align: center; padding-bottom: 2rem; border-bottom: 1px solid var(--glass-border); margin-bottom: 2rem; }
.price-eyebrow { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-muted); margin-bottom: 0.5rem; }
.price-big { font-family: var(--font-body); font-size: clamp(4rem, 12vw, 6rem); font-weight: 700; color: var(--text-white); line-height: 1; letter-spacing: -0.04em; }
.price-big .currency { font-size: 0.4em; vertical-align: super; opacity: 0.5; margin-left: 0.1em; }

.verdict { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 1rem; padding: 0.6rem 1.25rem; border-radius: 100px; font-weight: 600; font-size: 0.95rem; }
.verdict.good { background: var(--success-soft); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.3); }
.verdict.bad { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-item { background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 1.25rem 1rem; text-align: center; }
.stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 0.5rem; }
.stat-value { font-size: 1.5rem; font-weight: 600; color: var(--text-white); }
.stat-value.green { color: var(--success); }

.chart-section { background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 1.5rem; }
.section-title { font-family: var(--font-display); font-size: 1.3rem; font-weight: 500; font-style: italic; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.chart-wrapper { position: relative; height: 220px; width: 100%; }

.offers-list { display: flex; flex-direction: column; gap: 0.75rem; }
.offer-card {
    display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 1rem;
    background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius);
    padding: 1rem 1.25rem; transition: all 0.25s ease; cursor: pointer; text-decoration: none; color: inherit;
}
.offer-card:hover { border-color: var(--accent); transform: translateX(6px); }
.airline-badge { width: 56px; height: 56px; background: white; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.airline-badge img { width: 40px; height: 40px; object-fit: contain; }
.offer-info h4 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--text-white); }
.offer-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-muted); }
.price-tag { font-size: 1.4rem; font-weight: 700; color: var(--text-white); }
.score-tag { font-size: 0.7rem; color: var(--text-muted); }

.insight-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), transparent);
    border: 1px solid rgba(16, 185, 129, 0.2); border-radius: var(--radius-lg);
    padding: 1.75rem; display: flex; gap: 1.25rem; align-items: flex-start; margin: 2rem 0;
}
.insight-icon { width: 48px; height: 48px; background: rgba(16, 185, 129, 0.15); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex-shrink: 0; }
.insight-content h3 { font-family: var(--font-display); font-size: 1.2rem; font-style: italic; margin-bottom: 0.5rem; color: var(--text-white); }
.insight-content p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.7; }

.cta-section { text-align: center; }
.cta-btn {
    display: inline-flex; align-items: center; gap: 0.5rem; background: var(--text-white); color: var(--bg-deep);
    font-weight: 600; font-size: 1rem; padding: 1rem 2.5rem; border-radius: 100px; text-decoration: none;
    transition: all 0.3s; box-shadow: 0 4px 20px rgba(255,255,255,0.1);
}
.cta-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(255,255,255,0.2); }

/* === SEO Enrichment Sections === */

.enrichment-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: 2rem 0;
}
.enrichment-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Monthly Price Table */
.data-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.data-table th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
}
.data-table td {
    padding: 0.75rem 1rem;
    color: var(--text-light);
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.data-table tr:hover td { background: rgba(255,255,255,0.03); }
.data-table td:nth-child(2),
.data-table td:nth-child(3) { font-weight: 600; color: var(--text-white); }

/* Airlines Grid */
.airlines-grid { display: flex; flex-direction: column; gap: 0.5rem; }
.airline-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius);
}
.airline-name { font-weight: 600; color: var(--text-white); min-width: 120px; }
.airline-prices { color: var(--text-light); font-size: 0.9rem; flex: 1; }
.airline-offers { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }

/* DOW Bar Chart */
.dow-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    align-items: end;
    height: 180px;
    padding-top: 1rem;
}
.dow-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    height: 100%;
    justify-content: flex-end;
}
.dow-pct {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.dow-bar {
    width: 100%;
    max-width: 48px;
    background: linear-gradient(180deg, rgba(255,107,53,0.6), rgba(255,107,53,0.2));
    border-radius: 4px 4px 0 0;
    min-height: 8px;
    transition: background 0.3s;
}
.dow-best .dow-bar {
    background: linear-gradient(180deg, var(--success), rgba(16,185,129,0.3));
}
.dow-best .dow-pct { color: var(--success); font-weight: 600; }
.dow-best .dow-label { color: var(--success); font-weight: 600; }
.dow-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* DTD Buckets */
.dtd-buckets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}
.dtd-bucket {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    padding: 1rem 0.75rem;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    border-top: 3px solid var(--text-muted);
}
.dtd-success { border-top-color: var(--success); }
.dtd-info { border-top-color: #3b82f6; }
.dtd-warning { border-top-color: #f59e0b; }
.dtd-danger { border-top-color: #ef4444; }
.dtd-name { font-weight: 600; font-size: 0.85rem; color: var(--text-white); }
.dtd-range { font-size: 0.75rem; color: var(--text-muted); }
.dtd-impact { font-size: 1.1rem; font-weight: 700; color: var(--text-white); margin-top: 0.25rem; }
.dtd-success .dtd-impact { color: var(--success); }
.dtd-info .dtd-impact { color: #3b82f6; }
.dtd-warning .dtd-impact { color: #f59e0b; }
.dtd-danger .dtd-impact { color: #ef4444; }

/* Deal History */
.deal-history-list { display: flex; flex-direction: column; gap: 0.5rem; }
.deal-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius);
}
.deal-history-info { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.deal-history-price { font-weight: 700; font-size: 1.1rem; color: var(--text-white); }
.deal-history-airline { color: var(--text-light); font-size: 0.85rem; }
.deal-history-date { color: var(--text-muted); font-size: 0.8rem; }
.deal-history-badges { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.score-tag.score-hot {
    background: rgba(255,107,53,0.15);
    color: var(--accent);
    border: 1px solid rgba(255,107,53,0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.deal-status {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}
.deal-active { background: rgba(16,185,129,0.15); color: var(--success); }
.deal-expired { background: rgba(115,115,115,0.15); color: var(--text-muted); }

/* Related Routes */
.related-routes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.related-route-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.related-route-card:hover {
    border-color: var(--accent);
    background: var(--glass-hover);
}

.related-route-codes {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
}

.related-route-name {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === ML Prediction Block === */

.prediction-block {
    position: relative;
    overflow: hidden;
}
.prediction-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.prediction-buy::before { background: linear-gradient(90deg, #ef4444, #f97316); }
.prediction-wait::before { background: linear-gradient(90deg, #10b981, #34d399); }
.prediction-neutral::before { background: linear-gradient(90deg, #eab308, #fbbf24); }

.prediction-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.prediction-header .section-title { margin-bottom: 0; }

.prediction-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.prediction-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
}
.pred-buy {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.pred-wait {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.pred-neutral {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}
.prediction-window {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prediction-prices {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}
.prediction-price-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.prediction-price-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.prediction-price-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-white);
    font-family: var(--font-body);
    letter-spacing: -0.02em;
}
.prediction-price-up { color: #ef4444; }
.prediction-price-down { color: #10b981; }
.prediction-price-stable { color: var(--text-white); }

.prediction-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.prediction-change {
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.prediction-change-up {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}
.prediction-change-down {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}
.prediction-change-stable {
    background: rgba(234, 179, 8, 0.12);
    color: #eab308;
}

.prediction-confidence { margin-bottom: 1.25rem; }
.prediction-confidence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.prediction-confidence-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.prediction-confidence-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
}
.prediction-confidence-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}
.prediction-confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.prediction-tip {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--text-muted);
}
.prediction-buy .prediction-tip { border-left-color: #ef4444; }
.prediction-wait .prediction-tip { border-left-color: #10b981; }
.prediction-neutral .prediction-tip { border-left-color: #eab308; }

/* Responsive */
@media (max-width: 640px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .offer-card { grid-template-columns: 48px 1fr; }
    .insight-box { flex-direction: column; }

    .enrichment-section { padding: 1.25rem; }
    .dow-chart { height: 140px; gap: 0.25rem; }
    .dow-pct { font-size: 0.6rem; }
    .dow-label { font-size: 0.65rem; }
    .dtd-buckets { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
    .airline-row { flex-wrap: wrap; }
    .airline-name { min-width: auto; }
    .deal-history-item { flex-direction: column; align-items: flex-start; }
    .deal-history-badges { align-self: flex-end; }
    .related-routes-grid { grid-template-columns: 1fr 1fr; }

    /* Prediction mobile */
    .prediction-header { flex-direction: column; }
    .prediction-prices { flex-direction: column; gap: 1rem; }
    .prediction-arrow { transform: rotate(90deg); }
    .prediction-price-value { font-size: 1.5rem; }
    .prediction-meta { flex-wrap: wrap; }
}
