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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px;
}

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

.logo {
    text-align: center;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.logo h1 {
    font-size: 28px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
}

.city-confirm {
    text-align: center;
    background: var(--card);
    padding: 32px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 40px;
}

.city-question {
    color: var(--text-muted);
    font-size: 16px;
}

.city-confirm h2 {
    font-size: 32px;
    color: var(--primary);
    margin: 8px 0 16px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-text {
    background: transparent;
    color: var(--text-muted);
}

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

.btn-large {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    margin-top: 24px;
}

.city-selector {
    margin-top: 32px;
    background: var(--card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-container {
    position: relative;
    margin-bottom: 16px;
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card);
    border: 2px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

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

.suggestion-item:hover {
    background: rgba(37, 99, 235, 0.05);
}

.city-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.city-option {
    padding: 14px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.city-option:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.city-option .city-name {
    font-weight: 600;
    font-size: 16px;
}

.city-option .city-country {
    font-size: 13px;
    color: var(--text-muted);
}

.form-select, .form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    margin-bottom: 16px;
}

.form-select:focus, .form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.hidden {
    display: none !important;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
}

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

h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.option-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.option-btn {
    flex: 1;
    min-width: 100px;
    padding: 16px 12px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.option-btn:hover {
    border-color: var(--primary);
}

.option-btn.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.option-icon {
    display: block;
    font-size: 24px;
    margin-bottom: 6px;
}

.option-btn span:nth-child(2) {
    display: block;
    font-weight: 600;
    font-size: 14px;
}

.option-detail {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.place-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.place-card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.place-card:hover {
    border-color: var(--primary);
}

.place-card.selected {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.place-card h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.place-card .category {
    font-size: 12px;
    color: var(--text-muted);
}

.selected-mustgos {
    margin-bottom: 16px;
}

.mustgo-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-right: 8px;
    margin-bottom: 8px;
}

.mustgo-tag .remove {
    cursor: pointer;
    opacity: 0.7;
}

.mustgo-tag .remove:hover {
    opacity: 1;
}

.plan-header {
    text-align: center;
    margin-bottom: 32px;
}

.plan-summary {
    color: var(--text-muted);
    margin-top: 8px;
}

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-stop {
    position: relative;
    padding-left: 50px;
    padding-bottom: 24px;
}

.timeline-stop:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 12px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--card);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-stop.mustgo .timeline-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 2px #f59e0b;
}

.timeline-stop.optional .timeline-dot {
    background: var(--secondary);
    box-shadow: 0 0 0 2px var(--secondary);
}

.stop-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.stop-time {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.stop-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mustgo-badge {
    background: #fef3c7;
    color: #b45309;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.stop-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.stop-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 8px;
}

.live-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    margin-top: 10px;
}

.live-status.green {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.live-status.yellow {
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
}

.live-status.red {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.live-status.gray {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.confidence-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.confidence-track {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: var(--success);
    border-radius: 2px;
    transition: width 0.3s;
}

.confidence-fill.medium {
    background: var(--warning);
}

.confidence-fill.low {
    background: var(--danger);
}

.confidence-label {
    font-size: 11px;
    color: var(--text-muted);
}

.stop-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.stop-action-btn {
    flex: 1;
    padding: 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    cursor: pointer;
    transition: all 0.2s;
}

.stop-action-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.travel-info {
    padding: 12px 0 12px 50px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-actions {
    margin-top: 32px;
    text-align: center;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 8px;
}

.modal-content p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.report-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.report-btn {
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.report-btn.green:hover {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.report-btn.yellow:hover {
    border-color: var(--warning);
    background: rgba(234, 179, 8, 0.1);
}

.report-btn.red:hover {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

@media (max-width: 400px) {
    .option-buttons {
        flex-direction: column;
    }
    
    .option-btn {
        min-width: 100%;
    }
    
    .place-grid {
        grid-template-columns: 1fr;
    }
}
