* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #e63946 0%, #0f3460 50%, #3498db 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 3px solid #f4d03f;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Ccircle cx='30' cy='30' r='14' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='2'/%3E%3Cline x1='16' y1='30' x2='44' y2='30' stroke='rgba(255,255,255,0.08)' stroke-width='2'/%3E%3Ccircle cx='30' cy='30' r='4' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='2'/%3E%3C/svg%3E");
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.app-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.app-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
}

.location-badge {
    margin-left: auto;
    background: rgba(244, 208, 63, 0.2);
    border: 1px solid #f4d03f;
    color: #f4d03f;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.header-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.nav-link.active {
    color: #1a1a2e;
    background: #f4d03f;
    border-color: #f4d03f;
}

/* Main */
.app-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* Page Blurb */
.page-blurb {
    text-align: center;
    padding: 1.25rem 1rem;
    margin-bottom: 1rem;
}

.page-blurb h2 {
    font-size: 1.4rem;
    color: #f4d03f;
    margin-bottom: 0.4rem;
}

.page-blurb p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Input Section */
.input-section {
    background: #16213e;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #0f3460;
}

.input-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 200px;
}

.input-wrapper label {
    display: block;
    font-size: 0.8rem;
    color: #3498db;
    margin-bottom: 0.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper input {
    width: 100%;
    padding: 0.7rem 1rem;
    background: #1a1a2e;
    border: 2px solid #0f3460;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.input-wrapper input::placeholder {
    color: #555;
}

/* Button */
.btn-primary {
    padding: 0.7rem 1.5rem;
    background: #e63946;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.btn-primary:hover:not(:disabled) {
    background: #c0392b;
    transform: scale(1.03);
}

.btn-primary:disabled {
    background: #555;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

/* Status Area */
.status-area {
    margin-bottom: 1rem;
    min-height: 1.5rem;
}

.status-area .status-msg {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
}

.status-area .status-info {
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.3);
    color: #3498db;
}

.status-area .status-success {
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.status-area .status-error {
    background: rgba(230, 57, 70, 0.15);
    border: 1px solid rgba(230, 57, 70, 0.3);
    color: #e63946;
}

/* Map + Route Stops Layout */
.map-route-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.map-section {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #0f3460;
    flex: 1;
    min-width: 0;
}

#map {
    width: 100%;
    min-height: 500px;
    height: 60vh;
    background: #1a1a2e;
}

/* Leaflet Popup Dark Theme */
.leaflet-popup-content-wrapper {
    background: #16213e;
    color: #e0e0e0;
    border-radius: 8px;
    border: 1px solid #0f3460;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.leaflet-popup-content {
    margin: 0.75rem 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
}

.leaflet-popup-content .popup-retailer {
    font-weight: 700;
    color: #f4d03f;
    margin-bottom: 0.25rem;
}

.leaflet-popup-content .popup-id {
    color: #3498db;
    font-size: 0.75rem;
}

.leaflet-popup-content .popup-address {
    color: #ccc;
    margin-top: 0.25rem;
}

.leaflet-popup-tip {
    background: #16213e;
    border: 1px solid #0f3460;
}

/* Pokeball Marker */
.pokeball-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #333;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.pokeball-marker::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: #e63946;
}

.pokeball-marker::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: #fff;
}

.pokeball-marker .pokeball-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 50%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pokeball-label {
    font-size: 5px;
    font-weight: 900;
    color: #333;
    line-height: 1;
    letter-spacing: -0.3px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* King Soopers: Red Pokeball */
.pokeball-ks::before {
    background: #e63946;
}

.pokeball-ks {
    border-color: #8b0000;
}

.pokeball-ks .pokeball-center {
    border-color: #8b0000;
}

/* Safeway: Red Pokeball (vending machine) */
.pokeball-sf::before {
    background: #e63946;
}

.pokeball-sf {
    border-color: #8b0000;
}

.pokeball-sf .pokeball-center {
    border-color: #8b0000;
}

/* Target: Dark Red Pokeball */
.pokeball-target::before {
    background: #cc0000;
}

.pokeball-target {
    border-color: #990000;
}

.pokeball-target .pokeball-center {
    border-color: #990000;
}

/* Walmart: Blue Pokeball */
.pokeball-walmart::before {
    background: #0071ce;
}

.pokeball-walmart {
    border-color: #004c91;
}

.pokeball-walmart .pokeball-center {
    border-color: #004c91;
}

/* Best Buy: Yellow Pokeball */
.pokeball-bestbuy::before {
    background: #fff200;
}

.pokeball-bestbuy {
    border-color: #c4a700;
}

.pokeball-bestbuy .pokeball-center {
    border-color: #c4a700;
}

.pokeball-bestbuy .pokeball-label {
    color: #1a1a2e;
}

/* GameStop: Orange Pokeball */
.pokeball-gamestop::before {
    background: #ff6600;
}

.pokeball-gamestop {
    border-color: #cc5200;
}

.pokeball-gamestop .pokeball-center {
    border-color: #cc5200;
}

/* Costco: Green Pokeball */
.pokeball-costco::before {
    background: #2ecc71;
}

.pokeball-costco {
    border-color: #1a9c54;
}

.pokeball-costco .pokeball-center {
    border-color: #1a9c54;
}

/* Dollar General: Teal Pokeball */
.pokeball-dollargeneral::before {
    background: #17a2b8;
}

.pokeball-dollargeneral {
    border-color: #117a8b;
}

.pokeball-dollargeneral .pokeball-center {
    border-color: #117a8b;
}

.pokeball-lgs::before {
    background: #9b59b6;
}

.pokeball-lgs {
    border-color: #6c3483;
}

.pokeball-lgs .pokeball-center {
    border-color: #6c3483;
}

.pokeball-lgs .pokeball-label {
    color: #fff;
}

/* Marker Cluster Overrides */
.marker-cluster-small {
    background-color: rgba(230, 57, 70, 0.4) !important;
}
.marker-cluster-small div {
    background-color: rgba(230, 57, 70, 0.7) !important;
    color: #fff !important;
}

.marker-cluster-medium {
    background-color: rgba(244, 208, 63, 0.4) !important;
}
.marker-cluster-medium div {
    background-color: rgba(244, 208, 63, 0.7) !important;
    color: #1a1a2e !important;
}

.marker-cluster-large {
    background-color: rgba(52, 152, 219, 0.4) !important;
}
.marker-cluster-large div {
    background-color: rgba(52, 152, 219, 0.7) !important;
    color: #fff !important;
}

/* Results Panel */
.results-panel {
    margin-top: 1rem;
}

.results-panel .result-card {
    background: #0f3460;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #16213e;
}

.results-panel .result-card a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.results-panel .result-card a:hover {
    text-decoration: underline;
    color: #f4d03f;
}

/* Secondary Button */
.btn-secondary {
    padding: 0.7rem 1.5rem;
    background: #0f3460;
    color: #e0e0e0;
    border: 2px solid #3498db;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, background-color 0.2s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #16213e;
    transform: scale(1.03);
}

/* Progress Area */
.progress-area {
    margin-bottom: 1rem;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #0f3460;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #e63946, #f4d03f, #3498db);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: #3498db;
    animation: pulsing 1.5s ease-in-out infinite;
}

@keyframes pulsing {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Route Stop Markers */
.route-stop-marker {
    background: none !important;
    border: none !important;
}

.stop-label {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Route Info Card */
.route-info-card {
    background: #16213e;
    border-radius: 12px;
    border: 1px solid #0f3460;
    overflow: hidden;
    width: 300px;
    flex-shrink: 0;
    max-height: 60vh;
    display: flex;
    flex-direction: column;
}

.route-summary {
    padding: 1.25rem;
    border-bottom: 1px solid #0f3460;
}

.summary-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #f4d03f;
}

.stat-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.route-stops-list {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.stops-heading {
    font-size: 0.9rem;
    color: #3498db;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stops-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.stop-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.stop-item:hover {
    background: rgba(52, 152, 219, 0.1);
}

.stop-item.stop-start {
    background: rgba(46, 204, 113, 0.1);
}

.stop-item.stop-end {
    background: rgba(230, 57, 70, 0.1);
}

.stop-number {
    width: 24px;
    height: 24px;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    border: 2px solid #3498db;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

.stop-start .stop-number {
    background: #2ecc71;
    border-color: #27ae60;
}

.stop-end .stop-number {
    background: #e63946;
    border-color: #c0392b;
}

.stop-details {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    overflow: hidden;
}

.stop-name {
    font-size: 0.85rem;
    color: #e0e0e0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stop-addr {
    font-size: 0.75rem;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-remove-stop {
    margin-left: auto;
    width: 22px;
    height: 22px;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(230, 57, 70, 0.15);
    border: 1px solid rgba(230, 57, 70, 0.3);
    border-radius: 50%;
    color: #e63946;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    line-height: 1;
}

.stop-item:hover .btn-remove-stop {
    opacity: 1;
}

.btn-remove-stop:hover {
    background: rgba(230, 57, 70, 0.3);
    border-color: #e63946;
}

/* Route stops list scrollbar */
.route-stops-list::-webkit-scrollbar {
    width: 6px;
}

.route-stops-list::-webkit-scrollbar-track {
    background: #0f3460;
    border-radius: 3px;
}

.route-stops-list::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 3px;
}

/* Navigation Links */
.nav-links-header {
    margin-bottom: 1rem;
}

.nav-links-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f4d03f;
    margin-bottom: 0.25rem;
}

.nav-links-subtitle {
    font-size: 0.85rem;
    color: #888;
}

.nav-links-instruction {
    font-size: 0.8rem;
    color: #3498db;
    margin-top: 0.5rem;
    font-style: italic;
}

.btn-copy-all {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #0f3460;
    color: #3498db;
    border: 1px solid #3498db;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 1rem;
    transition: background-color 0.2s ease;
}

.btn-copy-all:hover:not(:disabled) {
    background: #16213e;
}

.btn-copy-all:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nav-links-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.nav-link-card {
    background: #0f3460;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    border: 1px solid #16213e;
    transition: border-color 0.2s ease;
}

.nav-link-card:hover {
    border-color: #3498db;
}

.nav-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.nav-card-segment {
    font-size: 0.9rem;
    font-weight: 700;
    color: #f4d03f;
}

.nav-card-distance {
    font-size: 0.8rem;
    color: #2ecc71;
    font-weight: 600;
}

.nav-card-locations {
    margin-bottom: 0.5rem;
}

.nav-card-loc {
    font-size: 0.8rem;
    color: #ccc;
    padding: 0.15rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-loc-label {
    color: #888;
    font-weight: 600;
}

.nav-card-stops {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.75rem;
}

.nav-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-open-maps {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #e63946;
    color: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn-open-maps:hover {
    background: #c0392b;
    transform: scale(1.03);
    color: #fff;
    text-decoration: none;
}

.btn-copy-link {
    padding: 0.5rem 1rem;
    background: transparent;
    color: #3498db;
    border: 1px solid #3498db;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s ease;
}

.btn-copy-link:hover:not(:disabled) {
    background: rgba(52, 152, 219, 0.1);
}

.btn-copy-link:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Filter Section */
.filter-section {
    background: #16213e;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #0f3460;
}

.filter-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.filter-group label {
    font-size: 0.75rem;
    color: #3498db;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    background: #1a1a2e;
    border: 2px solid #0f3460;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    min-width: 160px;
    transition: border-color 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: #3498db;
}


/* Deselected Pokeball Marker */
.pokeball-dim {
    opacity: 0.3;
}

/* Round Trip Section */
.roundtrip-section {
    background: #16213e;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid #0f3460;
    border-left: 4px solid #f4d03f;
    animation: fadeSlideIn 0.3s ease-out;
}

.roundtrip-row {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.roundtrip-slider-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.roundtrip-slider-group label {
    font-size: 0.8rem;
    color: #3498db;
    font-weight: 600;
    white-space: nowrap;
}

.roundtrip-slider-group input[type="range"] {
    flex: 1;
    min-width: 100px;
    max-width: 200px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #0f3460;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.roundtrip-slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f4d03f;
    border: 2px solid #1a1a2e;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.roundtrip-slider-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f4d03f;
    border: 2px solid #1a1a2e;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stop-count-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f4d03f;
    min-width: 28px;
    text-align: center;
}

/* Retailer Legend */
.retailer-legend {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-left: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: #e0e0e0;
    font-weight: 600;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.legend-dot-ks {
    background: #e63946;
}

.legend-dot-sf {
    background: #e63946;
}

.legend-dot-target {
    background: #cc0000;
}

.legend-dot-walmart {
    background: #0071ce;
}

.legend-dot-bestbuy {
    background: #fff200;
}

.legend-dot-gamestop {
    background: #ff6600;
}

.legend-dot-costco {
    background: #2ecc71;
}

.legend-dot-dollargeneral {
    background: #17a2b8;
}
.legend-dot-lgs {
    background: #9b59b6;
}

.filter-hint {
    font-size: 0.72rem;
    color: #888;
    margin-top: 0.6rem;
    padding: 0.4rem 0.6rem;
    background: rgba(52, 152, 219, 0.06);
    border-left: 2px solid #3498db;
    border-radius: 0 4px 4px 0;
    line-height: 1.4;
}

/* Tertiary Controls */
.tertiary-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #0f3460;
}

.tertiary-label {
    font-size: 0.75rem;
    color: #3498db;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tertiary-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #e0e0e0;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #0f3460;
    background: #1a1a2e;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.tertiary-checkbox:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.tertiary-checkbox input[type="checkbox"] {
    accent-color: #f4d03f;
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.tertiary-checkbox .legend-dot {
    width: 8px;
    height: 8px;
}

.vending-badge {
    font-size: 0.6rem;
    background: #f4d03f;
    color: #1a1a2e;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 700;
    margin-left: 2px;
    letter-spacing: 0.5px;
}

/* Priority List Section */
.priority-section {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem 1.25rem;
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 12px;
}

.priority-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.priority-list-title {
    font-size: 0.75rem;
    color: #3498db;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.priority-list-hint {
    font-size: 0.7rem;
    color: #888;
    font-style: italic;
}

.priority-list,
ul.priority-list,
ul#priority-list {
    list-style: none;
    list-style-type: none;
    padding: 0;
    margin: 0;
    padding-left: 0;
}

ul.priority-list li,
ul#priority-list li,
.priority-list .priority-item {
    list-style: none;
    list-style-type: none;
}

.priority-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    margin-bottom: 2px;
    background: #1a1a2e;
    border: 1px solid #0f3460;
    border-radius: 6px;
    cursor: default;
    transition: border-color 0.2s ease, background 0.15s ease, transform 0.15s ease;
    user-select: none;
}

.priority-item:hover {
    border-color: #3498db;
    background: rgba(52, 152, 219, 0.08);
}

.priority-item.sortable-chosen {
    border-color: #f4d03f;
    background: rgba(244, 208, 63, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.02);
    z-index: 10;
}

.priority-item.sortable-ghost {
    opacity: 0.3;
}

.priority-rank {
    font-size: 0.7rem;
    color: #f4d03f;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

.priority-item .legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
}

.priority-item-name {
    font-size: 0.8rem;
    color: #e0e0e0;
    font-weight: 500;
    flex: 1;
}

.drag-handle {
    cursor: grab;
    color: #555;
    font-size: 1rem;
    padding: 0 0.2rem;
    margin-left: auto;
    transition: color 0.15s ease;
}

.drag-handle:hover {
    color: #f4d03f;
}

.drag-handle:active {
    cursor: grabbing;
}

.priority-empty {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
    padding: 0.75rem;
    font-style: italic;
}

/* Input with button (Use My Location) */
.input-with-btn {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-with-btn input {
    flex: 1;
}

.btn-location {
    padding: 0.6rem;
    background: #0f3460;
    color: #3498db;
    border: 2px solid #0f3460;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    min-width: 44px;
    min-height: 44px;
}

.btn-location:hover {
    border-color: #3498db;
    background: #16213e;
}

.btn-location:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Input error styling */
.input-wrapper input.input-error {
    border-color: #e63946;
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.2);
}

.input-error-msg {
    font-size: 0.75rem;
    color: #e63946;
    margin-top: 0.25rem;
}

/* Loading Overlay / Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    gap: 1.5rem;
}

.spinner-pokeball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    position: relative;
    animation: spin-pokeball 1s linear infinite;
    border: 3px solid #333;
    overflow: hidden;
}

.spinner-pokeball-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: #e63946;
}

.spinner-pokeball-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: #fff;
}

.spinner-pokeball-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #fff;
    border: 3px solid #333;
    border-radius: 50%;
    z-index: 1;
}

@keyframes spin-pokeball {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner-text {
    color: #f4d03f;
    font-size: 1rem;
    font-weight: 600;
    animation: pulsing 1.5s ease-in-out infinite;
}

/* Footer */
.app-footer {
    background: #16213e;
    border-top: 1px solid #0f3460;
    padding: 1rem 1.5rem;
    text-align: center;
    margin-top: 2rem;
}

.app-footer p {
    font-size: 0.75rem;
    color: #888;
    max-width: 1200px;
    margin: 0 auto;
}

/* Panel transition animations */
.route-info-card,
.results-panel {
    animation: fadeSlideIn 0.4s ease-out;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for accessibility */
.btn-primary:focus,
.btn-secondary:focus,
.btn-copy-all:focus,
.btn-copy-link:focus,
.btn-open-maps:focus {
    outline: 2px solid #f4d03f;
    outline-offset: 2px;
}

.filter-group select:focus {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.btn-location:focus {
    outline: 2px solid #f4d03f;
    outline-offset: 2px;
    box-shadow: none;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.stop-item:focus {
    outline: 2px solid #3498db;
    outline-offset: -2px;
    background: rgba(52, 152, 219, 0.1);
}


/* Responsive: Tablets and small screens */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .location-badge {
        margin-left: 0;
    }

    .input-group {
        flex-direction: column;
    }

    .input-wrapper {
        min-width: 100%;
    }

    .btn-primary {
        width: 100%;
        min-height: 44px;
    }

    .btn-secondary {
        width: 100%;
        min-height: 44px;
    }

    .map-route-wrapper {
        flex-direction: column;
    }

    .route-info-card {
        width: 100%;
        max-height: 300px;
    }

    #map {
        min-height: 300px;
        height: 50vh;
    }

    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .retailer-legend {
        margin-left: 0;
        width: 100%;
        margin-top: 0.5rem;
    }

    .tertiary-controls {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tertiary-label {
        width: 100%;
    }

    .roundtrip-row {
        flex-direction: column;
        align-items: stretch;
    }

    .roundtrip-slider-group {
        flex-wrap: wrap;
    }

    .nav-card-actions {
        flex-direction: column;
    }

    .btn-open-maps,
    .btn-copy-link {
        width: 100%;
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .btn-copy-all {
        width: 100%;
        min-height: 44px;
    }

    .route-stops-list {
        max-height: 250px;
    }

    .results-panel {
        overflow-y: auto;
    }

    .summary-stats {
        gap: 1rem;
    }

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

    .app-main {
        padding: 1rem;
    }
}

/* Responsive: Small phones (320px) */
@media (max-width: 380px) {
    .app-header {
        padding: 1rem;
    }

    .app-title {
        font-size: 1.4rem;
    }

    .app-subtitle {
        font-size: 0.8rem;
    }

    .app-main {
        padding: 0.75rem;
    }

    .input-section {
        padding: 1rem;
    }

    .filter-section {
        padding: 0.75rem 1rem;
    }

    #map {
        min-height: 250px;
        height: 40vh;
    }

    .nav-link-card {
        padding: 0.75rem 1rem;
    }

    .summary-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ============================================
   MOBILE NAVIGATION - Hamburger Menu
   ============================================ */

.nav-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    margin-left: auto;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

@media (max-width: 900px) {
    .nav-toggle {
        display: block;
    }
    
    .header-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .header-nav.active {
        display: flex;
    }
    
    .nav-link {
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .header-content {
        flex-wrap: wrap;
    }
    
    .location-badge {
        display: none;
    }
    
    .app-title {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 1rem;
    }
    
    .app-title {
        font-size: 1.2rem;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 0.6rem 0.75rem;
    }
}
