/* Travel Map Styles - Theme-aware */

/* Header */
.travel-header {
    margin: 20px 0 30px 0;
    text-align: center;
}

.travel-title h2 {
    font-size: 1.8rem;
    margin: 0 0 8px 0;
    font-weight: 400;
    color: var(--text-primary);
}

.travel-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Map */
.map-container {
    width: 100%;
    height: 450px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px var(--shadow);
}

#map {
    width: 100%;
    height: 100%;
    background: var(--bg-tertiary);
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Year Filter */
.year-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.year-filter-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-right: 4px;
}

.year-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.year-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.year-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Continent Groups */
.continent-header {
    background: var(--bg-tertiary);
    cursor: pointer;
    user-select: none;
}

.continent-header:hover {
    background: var(--bg-secondary);
}

.continent-header td {
    padding: 14px 10px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.continent-toggle {
    display: inline-block;
    width: 16px;
    margin-right: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.continent-name {
    color: var(--text-primary);
}

.continent-stats {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
    margin-left: 12px;
}

.continent-country td:first-child {
    padding-left: 34px;
}

/* Timeline Year Groups */
.timeline-year-header {
    background: var(--bg-tertiary);
    cursor: pointer;
    user-select: none;
}

.timeline-year-header:hover {
    background: var(--bg-secondary);
}

.timeline-year-header td {
    padding: 14px 10px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.timeline-year-toggle {
    display: inline-block;
    width: 16px;
    margin-right: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.timeline-year-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.05rem;
}

.timeline-year-stats {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
    margin-left: 12px;
}

.timeline-year-flags {
    margin-left: 12px;
    font-size: 1rem;
}

.timeline-month td:first-child {
    padding-left: 34px;
}

/* Tabs - override theme.css for travel page specific styling */
.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Tab Content */
.tab-content {
    min-height: 300px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Search */
.search-box {
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    box-sizing: border-box;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 2px solid var(--border);
    font-weight: 500;
    color: var(--text-secondary);
}

.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.data-table .country-flag {
    margin-right: 8px;
}

.data-table .visits-cell {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 300px;
}

/* Leaflet Popup - theme aware */
.leaflet-popup-content-wrapper {
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 3px 14px var(--shadow);
}

.leaflet-popup-content {
    margin: 12px 14px;
    font-size: 14px;
    line-height: 1.4;
}

.leaflet-popup-tip {
    background: var(--bg-secondary);
}

/* Detail toggle control on map */
.leaflet-detail-toggle {
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    background: var(--bg-secondary);
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-muted);
    box-shadow: 0 1px 5px rgba(0,0,0,0.3);
    transition: color 0.2s;
}

.leaflet-detail-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.leaflet-detail-toggle.active {
    color: var(--accent);
}

/* Leaflet controls - theme aware */
.leaflet-control-zoom a {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-tertiary) !important;
}

.leaflet-control-attribution {
    background: var(--bg-secondary) !important;
    color: var(--text-muted) !important;
}

.leaflet-control-attribution a {
    color: var(--text-secondary) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .map-container {
        height: 350px;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .year-filter {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 5px;
    }

    .year-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
        flex-shrink: 0;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        padding: 10px 14px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
    }

    .data-table .visits-cell {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .travel-title h2 {
        font-size: 1.5rem;
    }

    .map-container {
        height: 280px;
        border-radius: 0;
        margin-left: -20px;
        margin-right: -20px;
        width: calc(100% + 40px);
    }

    .stats-cards {
        gap: 10px;
    }

    .stat-card {
        padding: 15px 10px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }
}
