/* ===================================================================
   Transport Dashboard Widget — Phase 6D
   Collapsible section on dashboard showing saved itineraries,
   group travel, and upcoming departures.
   =================================================================== */

/* --- Wrapper --- */
.tdw-wrapper {
    padding: 1.25rem;
    background: rgba(255,255,255,0.02);
}

/* --- Stats Row --- */
.tdw-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 900px) {
    .tdw-stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
    .tdw-stats-row { grid-template-columns: 1fr; }
}

.tdw-stat-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    transition: all 0.25s ease;
}
.tdw-stat-card:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(127,255,0,0.15);
    transform: translateY(-1px);
}

.tdw-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.3rem;
}
.tdw-stat-itineraries { background: rgba(59,130,246,0.15); color: #3b82f6; }
.tdw-stat-groups      { background: rgba(168,85,247,0.15); color: #a855f7; }
.tdw-stat-upcoming    { background: rgba(249,115,22,0.15); color: #f97316; }
.tdw-stat-co2         { background: rgba(34,197,94,0.15);  color: #22c55e; }

.tdw-stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.tdw-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.tdw-stat-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* --- Tab Bar --- */
.tdw-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 0;
}

.tdw-tab {
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.tdw-tab:hover {
    color: rgba(255,255,255,0.8);
}
.tdw-tab.active {
    color: #7FFF00;
    border-bottom-color: #7FFF00;
}

/* --- Tab Content Panels --- */
.tdw-tab-panel {
    display: none;
}
.tdw-tab-panel.active {
    display: block;
}

/* --- Itinerary List --- */
.tdw-itinerary-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tdw-itinerary-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
}
.tdw-itinerary-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(127,255,0,0.12);
    transform: translateY(-1px);
}

.tdw-itin-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(59,130,246,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.tdw-itin-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.tdw-itin-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tdw-itin-route {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tdw-itin-date {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.35);
    margin-top: 1px;
}

.tdw-itin-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* --- Status Badge --- */
.tdw-status-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: capitalize;
    padding: 2px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.tdw-status-draft      { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.5); }
.tdw-status-confirmed  { background: rgba(59,130,246,0.18);  color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); }
.tdw-status-booked     { background: rgba(127,255,0,0.15);   color: #7FFF00; border: 1px solid rgba(127,255,0,0.2); }
.tdw-status-completed  { background: rgba(34,197,94,0.15);   color: #22c55e; border: 1px solid rgba(34,197,94,0.2); }
.tdw-status-cancelled  { background: rgba(239,68,68,0.15);   color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }

/* --- Departure Countdown --- */
.tdw-countdown {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.4);
    white-space: nowrap;
}
.tdw-countdown.soon {
    color: #f97316;
    font-weight: 600;
}
.tdw-countdown.imminent {
    color: #ef4444;
    font-weight: 700;
    animation: tdw-pulse 1.5s ease-in-out infinite;
}

@keyframes tdw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Group Travel Cards --- */
.tdw-group-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tdw-group-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}
.tdw-group-card:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(168,85,247,0.15);
}

.tdw-group-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(168,85,247,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.tdw-group-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.tdw-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tdw-group-detail {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
}

.tdw-group-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.tdw-group-spots {
    font-size: 0.72rem;
    font-weight: 600;
    color: #a855f7;
}
.tdw-group-cost {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
}

/* --- Transport Type Icons --- */
.tdw-transport-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    background: rgba(255,255,255,0.04);
    padding: 1px 6px;
    border-radius: 4px;
}

/* --- Upcoming Departures --- */
.tdw-departure-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.tdw-departure-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}
.tdw-departure-card.departing-soon {
    border-color: rgba(249,115,22,0.25);
    background: rgba(249,115,22,0.04);
}
.tdw-departure-card.departing-imminent {
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.04);
}

.tdw-dep-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
    flex-shrink: 0;
}
.tdw-dep-time-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.tdw-dep-time-label {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}

.tdw-dep-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.tdw-dep-route {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tdw-dep-event {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Empty State --- */
.tdw-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: rgba(255,255,255,0.4);
}
.tdw-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.tdw-empty p {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
}
.tdw-empty-cta {
    color: #7FFF00;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}
.tdw-empty-cta:hover { opacity: 0.8; }

/* --- Loading --- */
.tdw-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 2rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
}
.tdw-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(127,255,0,0.2);
    border-top-color: #7FFF00;
    border-radius: 50%;
    animation: tdw-spin 0.7s linear infinite;
}
@keyframes tdw-spin {
    to { transform: rotate(360deg); }
}

/* --- CTA Row --- */
.tdw-cta-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.tdw-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    background: linear-gradient(135deg, #7FFF00, #32CD32);
    color: #0A1A1A;
    border: none;
    cursor: pointer;
}
.tdw-cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(127,255,0,0.3);
}
.tdw-cta-secondary {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.1);
}
.tdw-cta-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    box-shadow: none;
}

@media (max-width: 540px) {
    .tdw-cta-row { flex-direction: column; }
    .tdw-cta-btn { justify-content: center; }
}

/* --- Badge in toggle bar --- */
.tdw-badge {
    display: inline-block;
    background: rgba(127,255,0,0.15);
    color: #7FFF00;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 0.5rem;
}

/* --- Notification Toast (in-widget) --- */
.tdw-notification-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f97316;
    flex-shrink: 0;
    animation: tdw-pulse 2s ease-in-out infinite;
}
