* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --primary: #1d1d1f;
    --secondary: #86868b;
    --accent: #0071e3;
    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;
    --background: #fbfbfd;
    --card: #ffffff;
    --border: rgba(0,0,0,0.08);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 18px;
    --spacing: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--background);
    color: var(--primary);
    line-height: 1.5;
    overflow-x: hidden;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px var(--spacing) 40px;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 400;
}

.dates-banner {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    margin: -20px 20px 20px;
    padding: 15px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    color: var(--primary);
}

.dates-banner .date-range {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--accent);
}

.nav-tabs {
    display: flex;
    background: var(--card);
    margin: 0 var(--spacing);
    padding: 4px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tab {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-tab.active {
    background: var(--accent);
    color: white;
}

.content-section {
    display: none;
    padding: var(--spacing);
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

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

.route-card {
    background: var(--card);
    border-radius: var(--radius);
    margin-bottom: var(--spacing);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 2px solid var(--success);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.route-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.route-number {
    display: inline-block;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 32px;
    font-weight: 700;
    margin-right: 12px;
}

.route-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.route-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--background);
    border-radius: 20px;
    font-size: 0.85em;
    color: var(--secondary);
}

.badge.highlight {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
    font-weight: 600;
}

.map-container {
    height: 250px;
    background: #f0f0f0;
    position: relative;
}

.map-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--secondary);
}

.map-actions {
    padding: 15px 20px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--background);
    text-align: center;
}

.directions-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.directions-button:hover {
    background: #0051a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.directions-button svg {
    flex-shrink: 0;
}

.route-details {
    padding: 20px;
}

.detail-section {
    margin-bottom: 20px;
}

.detail-section h4 {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.detail-section p {
    color: var(--primary);
    font-size: 0.95em;
    line-height: 1.6;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.timeline-time {
    min-width: 60px;
    font-weight: 600;
    color: var(--accent);
    font-size: 0.9em;
}

.timeline-activity {
    flex: 1;
    color: var(--primary);
    font-size: 0.9em;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

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

.winery-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.winery-item {
    background: var(--background);
    padding: 12px;
    border-radius: 12px;
}

.winery-name {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95em;
    margin-bottom: 4px;
}

.winery-details {
    font-size: 0.85em;
    color: var(--secondary);
    line-height: 1.4;
}

.winery-phone {
    color: var(--accent);
    text-decoration: none;
}

.weather-card {
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
    color: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.weather-item {
    text-align: center;
}

.weather-label {
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 4px;
}

.weather-value {
    font-size: 1.2em;
    font-weight: 700;
}

.tips-card {
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
}

.tips-card h4 {
    color: var(--warning);
    font-size: 1em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tips-card ul {
    list-style: none;
    padding: 0;
}

.tips-card li {
    color: var(--primary);
    font-size: 0.9em;
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.tips-card li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--warning);
}

.sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
}

.footer-text {
    font-size: 0.85em;
    color: var(--secondary);
}

.deploy-button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
}

@media (min-width: 768px) {
    body {
        max-width: 90%;
        margin: 0 auto;
    }
    
    .hero h1 {
        font-size: 3.5em;
    }
    
    .content-section {
        max-width: 900px;
        margin: 0 auto;
    }
    
    .route-cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 20px;
    }
    
    .map-container {
        height: 350px;
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary: #f5f5f7;
        --secondary: #86868b;
        --background: #000000;
        --card: #1d1d1f;
        --border: rgba(255,255,255,0.1);
    }
    
    .dates-banner {
        background: rgba(29,29,31,0.95);
    }
    
    .badge {
        background: rgba(255,255,255,0.05);
    }
    
    .winery-item {
        background: rgba(255,255,255,0.05);
    }
}