/* ═══════════════════════════════════════════════════════
   ShipTea Itinerary Pages — Scoped under .stcdb-itinerary-wrapper
   ═══════════════════════════════════════════════════════ */

.stcdb-itinerary-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a2e;
}

/* ── Hero ── */
.stcdb-itinerary-hero {
    background: linear-gradient(135deg, #023E73 0%, #0077B6 100%);
    color: #fff;
    padding: 48px 32px;
    border-radius: 12px;
    margin-bottom: 32px;
    text-align: center;
}

.stcdb-itinerary-hero h1 {
    font-size: 2rem;
    margin: 0 0 12px;
    font-weight: 700;
    color: #fff;
}

.stcdb-itinerary-hero p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stcdb-itinerary-hero-stats {
    display: flex;
    gap: 32px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

.stcdb-itinerary-hero-stat {
    text-align: center;
}

.stcdb-itinerary-hero-stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #FF6B35;
}

.stcdb-itinerary-hero-stat-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
    margin-top: 4px;
}

/* ── Search & Filters ── */
.stcdb-itinerary-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.stcdb-itinerary-search {
    flex: 1;
    min-width: 240px;
    position: relative;
}

.stcdb-itinerary-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.stcdb-itinerary-search input:focus {
    outline: none;
    border-color: #0077B6;
}

.stcdb-itinerary-search::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

.stcdb-itinerary-filter select {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
}

.stcdb-itinerary-sort select {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
}

/* ── Ship Grid ── */
.stcdb-itinerary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stcdb-itinerary-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.stcdb-itinerary-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stcdb-itinerary-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stcdb-itinerary-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #023E73;
    margin: 0;
}

.stcdb-itinerary-card-line {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2px;
}

.stcdb-itinerary-card-count {
    background: #0077B6;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.stcdb-itinerary-card-next {
    background: #FFF1E6;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

.stcdb-itinerary-card-next-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    margin-bottom: 4px;
}

.stcdb-itinerary-card-next-dest {
    font-weight: 600;
    color: #023E73;
    font-size: 0.95rem;
}

.stcdb-itinerary-card-next-date {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
}

.stcdb-itinerary-card-changes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    font-size: 0.8rem;
    color: #d97706;
    font-weight: 600;
}

/* ── Port Search Results ── */
.stcdb-port-results {
    margin-bottom: 32px;
}

.stcdb-port-results-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #023E73;
}

.stcdb-port-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
}

.stcdb-port-result-ship {
    font-weight: 600;
    color: #023E73;
}

.stcdb-port-result-date {
    font-size: 0.85rem;
    color: #64748b;
}

/* ── Changes Feed ── */
.stcdb-changes-feed {
    margin-top: 40px;
}

.stcdb-changes-feed h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #023E73;
    margin-bottom: 16px;
}

.stcdb-change-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.stcdb-change-item:last-child {
    border-bottom: none;
}

/* ── Change Badges ── */
.stcdb-change-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.stcdb-change-badge-green {
    background: #dcfce7;
    color: #166534;
}

.stcdb-change-badge-red {
    background: #fee2e2;
    color: #991b1b;
}

.stcdb-change-badge-amber {
    background: #fef3c7;
    color: #92400e;
}

.stcdb-change-badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

.stcdb-change-badge-gray {
    background: #f1f5f9;
    color: #475569;
}

.stcdb-change-ship {
    font-weight: 600;
    color: #023E73;
    font-size: 0.9rem;
}

.stcdb-change-detail {
    font-size: 0.85rem;
    color: #64748b;
}

.stcdb-change-date {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-left: auto;
    white-space: nowrap;
}

/* ── Detail Page: Ship Hero ── */
.stcdb-itinerary-detail-hero {
    background: linear-gradient(135deg, #023E73 0%, #0077B6 100%);
    color: #fff;
    padding: 40px 32px;
    border-radius: 12px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.stcdb-itinerary-detail-hero h1 {
    font-size: 1.8rem;
    margin: 0 0 4px;
    font-weight: 700;
    color: #fff;
}

.stcdb-itinerary-detail-line {
    font-size: 0.95rem;
    opacity: 0.85;
}

.stcdb-itinerary-detail-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

/* ── Voyage List ── */
.stcdb-voyage-list {
    margin-bottom: 40px;
}

.stcdb-voyage-list h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #023E73;
    margin-bottom: 16px;
}

.stcdb-voyage-item {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
}

.stcdb-voyage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    cursor: pointer;
    background: #fff;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}

.stcdb-voyage-header:hover {
    background: #f8fafc;
}

.stcdb-voyage-name {
    font-weight: 600;
    font-size: 1rem;
    color: #023E73;
}

.stcdb-voyage-dates {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 2px;
}

.stcdb-voyage-duration {
    background: #FFF1E6;
    color: #FF6B35;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.stcdb-voyage-toggle {
    font-size: 0.8rem;
    color: #94a3b8;
    transition: transform 0.2s;
    margin-left: 12px;
}

.stcdb-voyage-item[data-expanded="true"] .stcdb-voyage-toggle {
    transform: rotate(90deg);
}

.stcdb-voyage-detail {
    display: none;
    padding: 0 20px 20px;
    border-top: 1px solid #f1f5f9;
}

.stcdb-voyage-item[data-expanded="true"] .stcdb-voyage-detail {
    display: block;
}

/* ── Port Timeline ── */
.stcdb-port-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 20px 0;
    overflow-x: auto;
    position: relative;
}

.stcdb-port-timeline-stop {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    position: relative;
    flex-shrink: 0;
}

.stcdb-port-timeline-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0077B6;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #0077B6;
    z-index: 1;
}

.stcdb-port-timeline-stop:first-child .stcdb-port-timeline-dot,
.stcdb-port-timeline-stop:last-child .stcdb-port-timeline-dot {
    background: #FF6B35;
    box-shadow: 0 0 0 2px #FF6B35;
}

.stcdb-port-timeline-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #023E73;
    margin-top: 8px;
    text-align: center;
    max-width: 90px;
    word-wrap: break-word;
}

.stcdb-port-timeline-line {
    flex: 1;
    height: 2px;
    background: #cbd5e1;
    min-width: 20px;
}

/* ── Schedule Card (Ship Profile Partial) ── */
.stcdb-schedule-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #FFF1E6 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.stcdb-schedule-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #023E73;
    margin: 0 0 16px;
}

.stcdb-schedule-card-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}

.stcdb-schedule-card-next {
    flex: 1;
}

.stcdb-schedule-card-next-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.stcdb-schedule-card-next-dest {
    font-size: 1.3rem;
    font-weight: 700;
    color: #023E73;
    margin-top: 4px;
}

.stcdb-schedule-card-next-date {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 2px;
}

.stcdb-schedule-countdown {
    text-align: center;
    background: #fff;
    border-radius: 10px;
    padding: 12px 20px;
    border: 1px solid #e2e8f0;
}

.stcdb-schedule-countdown-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #FF6B35;
    line-height: 1;
}

.stcdb-schedule-countdown-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 4px;
}

.stcdb-schedule-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 8px;
}

.stcdb-schedule-mini-table th {
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 8px 0;
    border-bottom: 2px solid #e2e8f0;
}

.stcdb-schedule-mini-table td {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.stcdb-schedule-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.stcdb-schedule-view-all {
    color: #0077B6;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.stcdb-schedule-view-all:hover {
    text-decoration: underline;
}

/* ── No Data State ── */
.stcdb-itinerary-empty {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.stcdb-itinerary-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* ── Back Link ── */
.stcdb-itinerary-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0077B6;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    margin-bottom: 16px;
}

.stcdb-itinerary-back:hover {
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .stcdb-itinerary-wrapper {
        padding: 12px;
    }

    .stcdb-itinerary-hero {
        padding: 32px 20px;
    }

    .stcdb-itinerary-hero h1 {
        font-size: 1.5rem;
    }

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

    .stcdb-itinerary-controls {
        flex-direction: column;
    }

    .stcdb-itinerary-search {
        min-width: 100%;
    }

    .stcdb-itinerary-detail-hero {
        padding: 24px 16px;
        flex-direction: column;
        text-align: center;
    }

    .stcdb-itinerary-detail-hero h1 {
        font-size: 1.4rem;
    }

    .stcdb-port-timeline {
        padding: 12px 0;
    }

    .stcdb-voyage-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .stcdb-schedule-card-hero {
        flex-direction: column;
    }

    .stcdb-change-item {
        flex-wrap: wrap;
    }

    .stcdb-change-date {
        margin-left: 0;
        width: 100%;
    }
}
