/* ===========================
   COMPONENTS.CSS - Shared UI Components
   =========================== */

/* --- Cards --- */
.card {
    background: var(--adult-card-bg);
    border-radius: 8px;
    padding: var(--space-md);
    margin: var(--space-md) 0;
}

.card-gradient {
    background: var(--kids-gradient);
    color: white;
}

.card-gradient h2,
.card-gradient h3 {
    color: white;
}

/* --- Page Header --- */
.page-header {
    text-align: center;
    padding: var(--space-lg) 0 var(--space-md);
}

.page-header .subtitle {
    color: var(--adult-text-light);
    font-size: 0.875em;
    margin-top: var(--space-sm);
}

.page-kids .page-header .subtitle {
    color: var(--kids-yellow);
    font-weight: 700;
    font-size: 1.3em;
}

/* --- Badges — all one neutral style --- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 0.75em;
    color: var(--adult-text-light);
    background: var(--adult-surface);
}

.badge-orange,
.badge-pink,
.badge-blue,
.badge-red,
.badge-purple,
.badge-terracotta,
.badge-sage { background: var(--adult-surface); color: var(--adult-text-light); }

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    color: white;
    background: var(--adult-accent);
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    font-size: 0.875em;
}

.btn:hover {
    background: var(--adult-accent-hover);
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-green { background: var(--adult-accent); }
.btn-green:hover { background: var(--adult-accent-hover); }

.btn-orange { background: var(--adult-secondary); }
.btn-orange:hover { background: #8A7468; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--adult-accent);
    color: var(--adult-accent);
}
.btn-outline:hover {
    background: var(--adult-accent);
    color: white;
}

/* --- Checkbox List --- */
.checkbox-list {
    list-style: none;
    padding: 0;
    margin: var(--space-md) 0;
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    padding: 6px 12px;
    margin: 4px 0;
    background: var(--adult-surface);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    -webkit-user-select: none;
    user-select: none;
}

.checkbox-item:hover {
    background: #EDEAE6;
    border-color: var(--adult-accent);
}

.checkbox-item.checked {
    background: #EDF3F0;
    border-color: var(--adult-success);
}

.checkbox-item.checked .checkbox-text {
    text-decoration: line-through;
    color: var(--adult-text-light);
}

.checkbox-box {
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--adult-accent);
    border-radius: 4px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: white;
    transition: all 0.2s;
}

.checkbox-item.checked .checkbox-box {
    background: var(--adult-success);
    border-color: var(--adult-success);
    color: white;
}

.checkbox-text {
    flex: 1;
    font-size: 0.9em;
    padding-top: 1px;
}

/* --- Fun Fact / Callout --- */
.fun-fact {
    background: var(--adult-surface);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border-left: none;
}

.fun-fact::before {
    content: "\1F92F ";
}

/* --- Warning / Danger Boxes --- */
.warning-box {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.06);
    border-left: 3px solid var(--block-warning);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 0.9em;
}

.danger-box {
    background: var(--adult-surface);
    border-left: 2px solid var(--adult-danger);
    border-radius: 0 8px 8px 0;
    padding: 15px;
    margin: 15px 0;
}

/* --- Drive Info Box --- */
.drive-box {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.06);
    border-left: 3px solid var(--block-drive);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 0.9em;
    text-align: left;
}

.drive-icon {
    font-size: 1.1em;
    display: inline;
    margin-right: 4px;
}

.drive-from-to {
    font-size: 1em;
    font-weight: 700;
    color: var(--adult-text);
    margin: 0 0 2px;
    display: block;
}

.drive-route {
    font-size: 0.85em;
    color: var(--adult-text-light);
    margin: 2px 0;
}

.drive-time {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--adult-text-light);
}

/* Consistent text sizing inside contained blocks */
.warning-box .md-content {
    font-size: 0.9em;
}

.no-drive-box {
    background: transparent;
    border: none;
    border-top: 1px solid var(--adult-border);
    border-radius: 0;
    padding: 8px 0;
    margin: 8px 0;
    text-align: left;
    color: var(--adult-text-light);
    font-weight: 600;
    font-size: 0.95em;
}

/* --- Stats Row --- */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    text-align: center;
    margin: var(--space-lg) 0;
    gap: var(--space-sm);
}

.stat-item {
    padding: var(--space-md);
}

.stat-number {
    font-family: var(--font-adult);
    font-weight: 700;
    font-size: 1.75em;
    color: var(--adult-primary);
}

.stat-label {
    font-weight: 600;
    color: var(--adult-text-light);
    font-size: 0.75em;
}

/* --- Day Header Box --- */
.day-header-box {
    background: transparent;
    color: var(--adult-primary);
    border-radius: 0;
    padding: 8px 0;
    margin-bottom: 16px;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.day-label {
    font-family: var(--font-adult);
    font-weight: 700;
    font-size: 0.85em;
    color: var(--adult-accent);
}

.day-date {
    font-size: 1em;
    font-weight: 500;
    color: var(--adult-text-light);
    background: none;
    padding: 0;
    border-radius: 0;
    margin-left: 4px;
}

/* --- Sleep Info --- */
.sleep-info {
    background: none;
    border: 1px solid rgba(0,0,0,0.06);
    border-left: 3px solid var(--block-sleep);
    border-radius: 6px;
    padding: 10px 12px;
    margin-top: 8px;
    font-size: 0.9em;
}

.sleep-info .icon {
    font-size: 1.5em;
}

/* --- Flight Box --- */
.flight-box {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.06);
    border-left: 3px solid var(--block-flight);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 0.9em;
    color: var(--adult-text);
}

.flight-route {
    font-size: 1em;
    font-weight: 700;
    text-align: left;
    margin: 4px 0;
}

.flight-box .activity-list {
    color: var(--adult-text-light);
}

.flight-box .activity-list > li,
.drive-box .activity-list > li,
.campfire-box .activity-list > li,
.sleep-info .activity-list > li {
    padding-left: 0;
}

/* --- Campfire Box --- */
.campfire-box {
    background: transparent;
    border: 1px solid rgba(0,0,0,0.06);
    border-left: 3px solid var(--block-campfire);
    border-radius: 6px;
    padding: 10px 12px;
    margin: 10px 0;
    font-size: 0.9em;
    color: var(--adult-text);
}

.campfire-box p {
    color: var(--adult-text-light);
}

/* --- State Badges --- */
.state-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.state-badge {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1px solid var(--adult-border);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-user-select: none;
    user-select: none;
}

.state-badge:hover { transform: scale(1.05); border-color: var(--adult-accent); }
.state-badge.checked { background: var(--adult-accent); color: white; border-color: var(--adult-accent); }
.state-badge .state-check { margin-right: 6px; font-size: 1.1em; }

/* --- Park Section --- */
.park-section {
    background: transparent;
    border-radius: 0;
    padding: 16px 0;
    margin: 12px 0;
    border-left: none;
}

.grand-canyon,
.zion,
.bryce,
.teton,
.yellowstone { border-color: transparent; }

/* --- Along the Way --- */
.along-way {
    background: var(--adult-surface);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.along-way h4 {
    margin: 0 0 10px 0;
    color: var(--adult-primary);
}

/* --- Hero Image --- */
.hero-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    border-radius: 8px;
    margin: 15px 0;
    background: var(--adult-surface);
}

.photo-caption {
    text-align: center;
    font-size: 0.85em;
    color: var(--adult-text-light);
    font-style: italic;
    margin-top: 5px;
}

/* --- Progress Bar --- */
.progress-bar {
    background: var(--adult-border);
    border-radius: var(--radius-pill);
    height: 6px;
    overflow: hidden;
    margin: var(--space-sm) 0;
}

.progress-fill {
    height: 100%;
    background: var(--adult-accent);
    border-radius: var(--radius-pill);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-label {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--adult-text-light);
}

/* --- Emoji Header --- */
.emoji-header {
    font-size: 1.8em;
    margin-right: 10px;
}

/* --- Day Tab Navigation (underline indicator) --- */
.day-tabs-bar {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    z-index: 900;
    background: rgba(255, 255, 255, 0.96);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0;
}

.day-tabs-scroll {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-md);
    scrollbar-width: none;
}

.day-tabs-scroll::-webkit-scrollbar {
    display: none;
}

/* Push page content below fixed tab bar */
body[data-page="adventure"] .page-content,
body[data-page="itinerary"] .page-content {
    padding-top: calc(var(--nav-height) + 48px + var(--space-md));
}

/* Tab buttons */
.day-tab {
    flex-shrink: 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 44px;
    height: 48px;
    padding: 4px 14px 0;
    border: none;
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.82em;
    color: var(--adult-text-light);
    opacity: 0.7;
    cursor: pointer;
    transition: color 0.2s, opacity 0.2s;
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.day-tab:hover {
    opacity: 1;
    color: var(--adult-text);
}

.day-tab.active {
    opacity: 1;
    color: var(--adult-accent);
    font-weight: 700;
}

/* Underline indicator */
.day-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--adult-accent);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.day-tab.active::after {
    width: calc(100% - 12px);
}

.day-tab-emoji {
    font-size: 1.15em;
    line-height: 1;
}

.day-tab-date {
    font-size: 0.82em;
    font-weight: 700;
    line-height: 1;
}

.day-tab-sub {
    font-size: 0.62em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    opacity: 0.7;
    line-height: 1;
}

.day-tab-num {
    font-size: 0.95em;
    font-weight: 700;
}

.day-tab-label {
    font-size: 0.78em;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.day-tab--cat {
    padding: 4px 16px 0;
}

/* Kids page tab styling */
.page-kids .day-tabs-bar {
    background: rgba(44, 36, 24, 0.85);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.page-kids .day-tab {
    color: rgba(255, 255, 255, 0.55);
    opacity: 1;
}

.page-kids .day-tab:hover {
    color: rgba(255, 255, 255, 0.85);
}

.page-kids .day-tab.active {
    color: var(--kids-yellow);
}

.page-kids .day-tab::after {
    background: var(--kids-yellow);
}

.page-kids .day-tab.active::after {
    width: calc(100% - 8px);
    box-shadow: 0 0 8px rgba(212, 168, 67, 0.5);
}

/* Tab panels */
.day-tab-panel {
    display: none;
}

.day-tab-panel.active {
    display: block;
}

/* Bypass scroll-reveal animations inside tab panels */
.day-tab-panel .reveal {
    opacity: 1;
    transform: none;
}

/* Itinerary day cards in tab panels — remove timeline decoration */
.day-tab-panel .day-card {
    margin-left: 0;
    padding-left: 0;
}

/* Preserve TODAY left accent in tab panels */
.day-tab-panel .day-card.day-today {
    border-left: 3px solid var(--adult-accent);
}

.day-tab-panel .day-card::before {
    display: none;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .card {
        padding: var(--space-sm);
        margin: var(--space-sm) 0;
        border-radius: 8px;
    }

    .day-header-box {
        flex-direction: row;
        text-align: left;
    }

    .stats-row {
        gap: 0;
    }

    .stat-number {
        font-size: 1.5em;
    }

    .day-tab {
        min-width: 40px;
        height: 44px;
        padding: 4px 10px 0;
        font-size: 0.78em;
    }

    .day-tab--cat {
        padding: 4px 12px 0;
    }
}
