/* =========================================================
   LAYOUT
========================================================= */

.routes-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.routes-sidebar {
    position: sticky;
    top: 20px;
}

.routes-content {
    min-width: 0;
}

.routes-mobile-toggle {
    display: none;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 15px;
    border: none;
    border-radius: 10px;
    background: #111827;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

.routes-filters-panel {
    display: block;
}

/* =========================================================
   FILTER CARDS
========================================================= */

.filter-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.filter-card h3 {
    margin: 0 0 16px;
    font-size: 18px;
    color: #111827;
    line-height: 1.3;
}

.filter-zone {
    margin-bottom: 12px;
}

.filter-zone:last-child {
    margin-bottom: 0;
}

.filter-zone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.filter-zone-label,
.filter-category-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #374151;
    line-height: 1.4;
}

.filter-zone-label input,
.filter-category-label input {
    flex-shrink: 0;
}

.filter-zone-label {
    font-weight: 600;
}

.filter-categories {
    display: grid;
    gap: 12px;
}

.filter-actions .btn,
.filter-actions .btn-secondary {
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================================================
   RESULTS HEADER
========================================================= */

.results-header {
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.results-header h2 {
    margin: 0 0 8px;
    line-height: 1.25;
}

.results-header p {
    margin: 0;
    color: #6b7280;
    line-height: 1.6;
}

/* =========================================================
   ACTIVE FILTERS
========================================================= */

.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
    color: #111827;
    transition: background 0.2s ease;
}

.filter-chip:hover {
    background: #e2e8f0;
}

.filter-chip span {
    font-weight: 700;
}

.clear-filters {
    font-size: 13px;
    text-decoration: none;
    color: #b91c1c;
    font-weight: 700;
}

.clear-filters:hover {
    text-decoration: underline;
}

.filter-chip-zone {
    background: #dbeafe;
    color: #1e3a8a;
}

.filter-chip-zone:hover {
    background: #bfdbfe;
}

.filter-chip-duration {
    background: #dcfce7;
    color: #166534;
}

.filter-chip-duration:hover {
    background: #bbf7d0;
}

.filter-chip-type {
    background: #fef3c7;
    color: #92400e;
}

.filter-chip-type:hover {
    background: #fde68a;
}

/* =========================================================
   LISTĂ TRASEE
========================================================= */

.routes-list {
    display: grid;
    gap: 22px;
}

.route-list-card {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.route-list-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.09);
}

.route-list-image-wrap {
    position: relative;
    min-height: 270px;
    background: #f3f4f6;
    overflow: hidden;
}

.route-list-image {
    width: 100%;
    height: 100%;
    min-height: 270px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.route-list-card:hover .route-list-image {
    transform: scale(1.04);
}

.route-list-placeholder {
    width: 100%;
    height: 100%;
    min-height: 270px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: #9ca3af;
    background: #f3f4f6;
}

.route-list-badges {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    gap: 8px;
    align-content: start;
}

.route-list-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
}

.route-list-badges .badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.itinerary-badges .badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}

.route-list-badges .badge-featured,
.itinerary-badges .badge-featured {
    background: rgba(254, 243, 199, 0.96);
    color: #92400e;
}

.route-list-badges .badge-recommended,
.itinerary-badges .badge-recommended {
    background: rgba(220, 252, 231, 0.96);
    color: #166534;
}

.route-list-badges .badge-seasonal,
.itinerary-badges .badge-seasonal {
    background: rgba(219, 234, 254, 0.96);
    color: #1d4ed8;
}

.route-list-body {
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.route-list-top {
    margin-bottom: 12px;
}

.route-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.route-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.route-list-status-inline {
    margin-bottom: 12px;
}

.route-list-body h3 {
    margin: 0;
    font-size: 24px;
    line-height: 1.3;
    color: #111827;
    letter-spacing: -0.01em;
}

.route-title-link {
    text-decoration: none;
    color: inherit;
}

.route-title-link:hover {
    color: #000000;
}

.route-description {
    margin: 0 0 16px;
    color: #374151;
    line-height: 1.75;
    max-width: 62ch;
}

.route-extra {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    color: #374151;
    font-size: 14px;
    line-height: 1.65;
}

.route-extra strong {
    color: #111827;
}

.route-list-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.route-details-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    color: #111827;
    transition: transform 0.2s ease, color 0.2s ease;
}

.route-details-link::after {
    content: '→';
    font-size: 16px;
    line-height: 1;
}

.route-details-link:hover {
    color: #000000;
    transform: translateX(2px);
}

/* =========================================================
   EMPTY STATE
========================================================= */

.routes-empty-state {
    text-align: center;
    padding: 44px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
}

.routes-empty-state h3 {
    margin: 0 0 12px;
    color: #111827;
    line-height: 1.3;
}

.routes-empty-state p {
    color: #4b5563;
    line-height: 1.75;
    max-width: 700px;
    margin: 0 auto 24px;
}

.routes-empty-state .btn,
.routes-empty-state .btn-primary {
    min-width: 180px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.routes-empty {
    text-align: center;
    padding: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.routes-empty h3 {
    margin-top: 0;
}

.routes-empty p {
    color: #4b5563;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}

.routes-empty-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

/* =========================================================
   SHOW PAGE
========================================================= */

.itinerary-show-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.itinerary-show-sidebar {
    position: sticky;
    top: 20px;
}

.itinerary-show-content {
    min-width: 0;
}

.itinerary-info-card,
.itinerary-description-box,
.itinerary-day-card,
.itinerary-day-empty {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.itinerary-info-card {
    padding: 20px;
}

.itinerary-info-card h3 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 18px;
}

.itinerary-status-mobile {
    display: none;
    margin-bottom: 16px;
}

.itinerary-info-list {
    display: grid;
    gap: 12px;
}

.itinerary-info-item {
    display: grid;
    gap: 4px;
    color: #374151;
}

.itinerary-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.itinerary-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding: 12px 14px;
    border: none;
    border-radius: 10px;
    background: #111827;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.2s ease;
}

.itinerary-back-link:hover {
    background: #1f2937;
    transform: translateY(-1px);
}

.itinerary-description-box {
    padding: 24px;
    margin-bottom: 24px;
}

.itinerary-description-box h2 {
    margin: 0;
}

.itinerary-description-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.itinerary-status-desktop {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.itinerary-description-box p {
    margin: 0;
    color: #4b5563;
    line-height: 1.75;
}

.itinerary-days-list {
    display: grid;
    gap: 24px;
}

.itinerary-day-card {
    padding: 24px;
}

.itinerary-day-header {
    margin-bottom: 12px;
}

.itinerary-day-number {
    display: inline-block;
    margin-bottom: 8px;
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.itinerary-day-header h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.3;
}

.itinerary-day-description {
    margin: 0 0 20px;
    color: #4b5563;
    line-height: 1.75;
}

.itinerary-timeline {
    position: relative;
    display: grid;
    gap: 0;
    margin-top: 6px;
}

.itinerary-timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 111px;
    width: 2px;
    background: #e5e7eb;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
    padding: 18px 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 24px;
    left: 105px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #ffffff;
    border: 3px solid #111827;
    z-index: 1;
    box-sizing: border-box;
}

.timeline-item:first-child {
    padding-top: 0;
}

.timeline-item:first-child::before {
    top: 6px;
}

.timeline-time {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
    min-width: 90px;
    margin-top: 2px;
    font-weight: 700;
    color: #111827;
    font-size: 15px;
    line-height: 1.5;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.timeline-no-time {
    color: #6b7280;
    font-weight: 600;
    font-size: 14px;
}

.timeline-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    min-width: 0;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
    margin-left: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.timeline-image {
    width: 140px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e7eb;
}

.timeline-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.timeline-text {
    min-width: 0;
    flex: 1;
}

.timeline-item-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.timeline-type,
.timeline-optional {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.timeline-type {
    background: #f3f4f6;
    color: #111827;
}

.timeline-type-attraction {
    background: #dbeafe;
    color: #1d4ed8;
}

.timeline-type-accommodation {
    background: #ede9fe;
    color: #6d28d9;
}

.timeline-type-gastronomy {
    background: #fef3c7;
    color: #92400e;
}

.timeline-type-artisan {
    background: #dcfce7;
    color: #166534;
}

.timeline-type-event {
    background: #fee2e2;
    color: #991b1b;
}

.timeline-optional {
    background: #fef3c7;
    color: #92400e;
}

.timeline-title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.35;
    color: #111827;
}

.timeline-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.timeline-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #e2e8f0;
    border-radius: 999px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.timeline-notes {
    margin: 0;
    color: #374151;
    line-height: 1.7;
}

.timeline-meta + .timeline-notes {
    margin-top: 2px;
}

.timeline-item:hover .timeline-content,
.timeline-item-clickable:focus .timeline-content {
    transform: translateY(-2px);
    background: #ffffff;
    border-color: #d1d5db;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.timeline-item:hover::before,
.timeline-item-clickable:focus::before {
    background: #111827;
    border-color: #111827;
}

.timeline-item:hover .timeline-time,
.timeline-item-clickable:focus .timeline-time {
    color: #000000;
}

.timeline-item-clickable {
    cursor: pointer;
}

.timeline-item-clickable:focus {
    outline: none;
}

.itinerary-overnight {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    color: #374151;
}

.itinerary-day-empty {
    padding: 24px;
    color: #6b7280;
}

/* =========================================================
   ITINERARY STATUS BADGE
========================================================= */

.itinerary-status-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.itinerary-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    background: #ffffff;
    border: 1.5px solid;
    letter-spacing: 0.02em;
}

.itinerary-status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: currentColor;
}

/* Varianta standard - pagina traseu */
.status-in-progress {
    color: #ea580c;
    border-color: #fdba74;
}

.status-functional {
    color: #0284c7;
    border-color: #7dd3fc;
}

.status-complete {
    color: #059669;
    border-color: #6ee7b7;
}

.status-unknown {
    color: #6b7280;
    border-color: #d1d5db;
}

/* Varianta vizibilă - listă trasee */
.route-list-status-inline .itinerary-status-badge {
    padding: 6px 10px;
    font-size: 12px;
    border: none;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(17, 24, 39, 0.12);
}

.route-list-status-inline .itinerary-status-badge::before {
    background: rgba(255, 255, 255, 0.92);
}

.route-list-status-inline .status-in-progress {
    background: #ea580c;
    color: #ffffff;
}

.route-list-status-inline .status-functional {
    background: #0284c7;
    color: #ffffff;
}

.route-list-status-inline .status-complete {
    background: #059669;
    color: #ffffff;
}

.route-list-status-inline .status-unknown {
    background: #6b7280;
    color: #ffffff;
}

/* =========================================================
   ITINERARY STATUS HELP
========================================================= */

.itinerary-status-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 2px;
}

.itinerary-status-help-toggle {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid #dbe3ee;
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    user-select: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: all 0.2s ease;
}

.itinerary-status-help-toggle:hover {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
    box-shadow: 0 4px 12px rgba(29, 78, 216, 0.12);
    transform: translateY(-1px);
}

.itinerary-status-help-toggle:focus-visible {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.itinerary-status-help-toggle.is-open {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

/* =========================
   TOOLTIP BOX (PREMIUM)
========================= */

.itinerary-status-help-box {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 20;

    width: 300px;
    min-width: 220px;
    max-width: calc(100vw - 32px);

    padding: 14px 16px;
    border-radius: 14px;

    background: linear-gradient(180deg, #111827, #0f172a);
    color: #f9fafb;

    font-size: 13.5px;
    line-height: 1.6;

    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.22),
        0 6px 16px rgba(0, 0, 0, 0.12);

    border: 1px solid rgba(255, 255, 255, 0.06);

    backdrop-filter: blur(4px);

    animation: fadeInScale 0.16s ease;
    box-sizing: border-box;
}

.itinerary-status-help-box strong {
    color: #ffffff;
}

/* arrow */
.itinerary-status-help-box::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 10px;
    width: 14px;
    height: 14px;
    background: #111827;
    transform: rotate(45deg);
    border-left: 1px solid rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* animație subtilă */
@keyframes fadeInScale {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* =========================
   MOBILE FIX
========================= */

@media (max-width: 768px) {
    .itinerary-status-help-box {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(300px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
    }

    .itinerary-status-help-box::before {
        left: 50%;
        right: auto;
        transform: translateX(-50%) rotate(45deg);
    }
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {
    .routes-layout {
        grid-template-columns: 1fr;
    }

    .routes-sidebar {
        position: static;
    }

    .route-list-card {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .itinerary-show-layout {
        grid-template-columns: 1fr;
    }

    .itinerary-show-sidebar {
        position: static;
    }
}

@media (max-width: 991px) {
    .routes-mobile-toggle {
        display: block;
    }

    .routes-filters-panel {
        display: none;
    }

    .routes-filters-panel.is-open {
        display: block;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .results-header {
        padding-bottom: 12px;
    }

    .routes-empty-state {
        padding: 32px 24px;
    }

    .route-list-card {
        grid-template-columns: 1fr;
    }

    .route-list-image-wrap,
    .route-list-image,
    .route-list-placeholder {
        min-height: 220px;
    }

    .route-list-body {
        padding: 18px;
    }

    .route-list-body h3 {
        font-size: 22px;
    }

    .itinerary-timeline::before {
        display: none;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px 0;
    }

    .timeline-item::before {
        display: none;
    }

    .timeline-time {
        text-align: left;
    }

    .timeline-content {
        flex-direction: column;
        padding: 14px 15px;
        margin-left: 0;
    }

    .timeline-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .itinerary-day-header h2 {
        font-size: 24px;
    }

    .itinerary-status-mobile {
        display: block;
    }

    .itinerary-status-desktop {
        display: none;
    }

    .itinerary-description-header {
        display: block;
    }
}

@media (max-width: 700px) {
    .route-list-body h3 {
        font-size: 20px;
    }
}