/* === Route Map Feature Styles === */

/* Generate Route button */
.btn-generate-route {
    width: 100%;
    background: linear-gradient(135deg, #4DB8B8, #6DD5D5);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-generate-route:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(77, 184, 184, 0.4);
}

.btn-generate-route:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Preview container for the two pages */
.route-map-preview {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
    width: 100%;
    padding: 32px 16px 0;
    margin-top: 0;
}

.route-map-preview.hidden {
    display: none;
}

.route-page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 390px;
}

.route-page-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #b0b0b0;
}

/* Each phone-screenshot-like page */
.route-page {
    width: 360px;
    background: #000000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.route-page-empty {
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #b0b0b0;
}

.empty-page-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.empty-page-text {
    font-size: 1rem;
    font-weight: 500;
}

/* Leaflet map container */
.route-map-container {
    position: relative;
    width: 100%;
    height: 275px;
}

#leaflet-map {
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #1a1a2e;
}

/* Leaflet tooltip for Start/End labels */
.route-tooltip {
    background: rgba(0, 0, 0, 0.75);
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.route-tooltip::before {
    display: none;
}

/* Speed Ranges Card */
.speed-ranges-card {
    margin: 8px 12px;
    background: #1c1c1e;
    border-radius: 14px;
    padding: 16px;
}

.sr-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.sr-icon {
    font-size: 1.1rem;
}

.sr-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.sr-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sr-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sr-line {
    display: block;
    width: 32px;
    height: 4px;
    border-radius: 2px;
}

.sr-red { background: #ef4444; }
.sr-orange { background: #f59e0b; }
.sr-green { background: #22c55e; }
.sr-blue { background: #4DB8B8; }

.sr-text {
    font-size: 0.85rem;
    color: #d1d1d6;
}

/* Travel Time Comparison Card */
.travel-time-card {
    margin: 8px 12px 16px;
    background: #1c1c1e;
    border-radius: 14px;
    padding: 16px 20px;
}

.tt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.tt-icon {
    font-size: 1.1rem;
}

.tt-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.tt-comparison {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tt-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tt-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.tt-label {
    font-size: 0.75rem;
    color: #8e8e93;
    font-weight: 500;
}

.tt-col-diff {
    align-items: center;
}

.tt-diff-value {
    font-size: 1rem;
    font-weight: 700;
    color: #22c55e;
}

.tt-diff-label {
    font-size: 0.75rem;
    color: #22c55e;
    font-weight: 600;
}

/* Per-page download button */
.btn-download-page {
    width: 100%;
    max-width: 360px;
    background: linear-gradient(135deg, #a8ff78, #78ffd6);
    color: #0a0e0a;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download-page:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(168, 255, 120, 0.4);
}

/* Override Leaflet styles for dark theme */
#leaflet-map .leaflet-control-attribution {
    background: rgba(0, 0, 0, 0.5) !important;
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 8px !important;
}

#leaflet-map .leaflet-control-attribution a {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Autocomplete dropdown */
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1c1c1e;
    border-radius: 10px;
    overflow: hidden;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    margin-top: 4px;
}

.autocomplete-list.hidden {
    display: none;
}

.autocomplete-item {
    padding: 10px 14px;
    color: #e0e0e0;
    font-size: 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2e;
    transition: background 0.15s;
}

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

.autocomplete-item:hover {
    background: #2a2a2e;
}

.autocomplete-item .ac-main {
    font-weight: 600;
    color: #ffffff;
}

.autocomplete-item .ac-sub {
    font-size: 0.75rem;
    color: #8e8e93;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
    .route-map-preview {
        padding: 0 8px;
    }

    .route-page {
        width: 100%;
        max-width: 360px;
    }
}
