/* ============================================
   Rota Planlayıcı - Premium Dark Theme
   ============================================ */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #22222f;
    --bg-input: #15151f;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent: #6c5ce7;
    --accent-light: #8b7cf7;
    --accent-glow: rgba(108, 92, 231, 0.3);
    --accent-gradient: linear-gradient(135deg, #6c5ce7, #a855f7);
    --gold: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px var(--accent-glow);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

/* Header */
.header {
    background: linear-gradient(180deg, rgba(108, 92, 231, 0.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: blur(20px);
}

.header-content {
    max-width: 1000px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between;
}

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

.logo-icon {
    width: 42px; height: 42px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    color: white; box-shadow: var(--shadow-glow);
}

.logo h1 {
    font-size: 1.4rem; font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle { font-size: 0.85rem; color: var(--text-secondary); }

.btn-back {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-input); border: 1px solid var(--border-color);
    color: var(--text-secondary); text-decoration: none;
    font-size: 1.1rem; transition: var(--transition);
}
.btn-back:hover { background: var(--bg-card-hover); border-color: var(--accent); color: var(--accent-light); }

/* Input Section */
.input-section { padding: 24px 0 0; }

.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

.input-header { margin-bottom: 16px; }
.input-header h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.input-hint { font-size: 0.82rem; color: var(--text-muted); }

.textarea-wrapper { position: relative; width: 100%; }

.textarea-wrapper textarea {
    width: 100%; padding: 16px; padding-bottom: 32px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem; font-family: 'Inter', sans-serif;
    line-height: 1.8; resize: vertical;
    outline: none; transition: var(--transition);
}
.textarea-wrapper textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.textarea-wrapper textarea::placeholder { color: var(--text-muted); }

.line-count {
    position: absolute; bottom: 10px; right: 14px;
    font-size: 0.75rem; color: var(--text-muted);
    pointer-events: none;
}

.input-options { margin-top: 16px; }

.start-point { display: flex; flex-direction: column; gap: 6px; }
.start-point label { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }
.start-point input {
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem; font-family: 'Inter', sans-serif;
    outline: none; transition: var(--transition);
}
.start-point input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.start-point input::placeholder { color: var(--text-muted); }

.input-actions {
    display: flex; gap: 10px; margin-top: 20px;
}

.btn-optimize {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 28px;
    background: var(--accent-gradient);
    border: none; border-radius: var(--radius-md);
    color: white; font-size: 0.95rem; font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer; transition: var(--transition);
}
.btn-optimize:hover { transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-optimize:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-clear {
    padding: 14px 20px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem; font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer; transition: var(--transition);
}
.btn-clear:hover { background: var(--bg-card-hover); border-color: var(--border-hover); color: var(--text-primary); }

/* Main Content */
.main-content { padding: 24px 0 48px; }

.map-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.map-container { width: 100%; height: 55vh; min-height: 400px; background: var(--bg-secondary); }

/* Status Bar */
.status-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}
.status-icon { font-size: 1.2rem; }
.status-text { flex: 1; font-size: 0.88rem; color: var(--text-secondary); }
.progress-bar {
    width: 120px; height: 4px;
    background: var(--bg-input); border-radius: 2px; overflow: hidden;
}
.progress-fill {
    height: 100%; width: 0%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Route Results */
.route-results {
    margin-top: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 24px;
}

.route-results .results-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.route-results .results-header h2 { font-size: 1.1rem; font-weight: 700; }

.route-stats { display: flex; gap: 8px; }
.stat {
    padding: 4px 12px;
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 100px;
    font-size: 0.78rem; font-weight: 600; color: var(--accent-light);
}

/* Route List */
.route-list { display: flex; flex-direction: column; gap: 0; }

.route-item {
    display: flex; align-items: center; gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}
.route-item:last-child { border-bottom: none; }
.route-item:hover { background: rgba(255,255,255,0.02); }

.route-number {
    width: 32px; height: 32px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 700; color: white;
    flex-shrink: 0;
}
.route-number.start {
    background: linear-gradient(135deg, #10b981, #059669);
}

.route-connector {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px; flex-shrink: 0; width: 32px;
    padding: 4px 0;
}
.connector-line {
    width: 2px; height: 20px;
    background: var(--border-color);
}
.connector-distance {
    font-size: 0.7rem; color: var(--text-muted); white-space: nowrap;
}

.route-info { flex: 1; min-width: 0; }
.route-name { font-size: 0.92rem; font-weight: 600; margin-bottom: 2px; }
.route-address { font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.route-meta { text-align: right; flex-shrink: 0; }
.route-distance { font-size: 0.82rem; font-weight: 600; color: var(--accent-light); }
.route-duration { font-size: 0.72rem; color: var(--text-muted); }

/* Route Actions */
.route-actions { display: flex; gap: 10px; margin-top: 20px; }

.btn-action {
    flex: 1; padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.85rem; font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer; transition: var(--transition);
    text-align: center;
}
.btn-action:hover { background: var(--bg-card-hover); border-color: var(--border-hover); }
.btn-action.primary { background: var(--accent-gradient); border-color: transparent; color: white; }

/* Not Found */
.not-found-section {
    margin-top: 16px; padding: 16px 20px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-md);
}
.not-found-section h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 8px; }
.not-found-section ul { list-style: none; }
.not-found-section li {
    font-size: 0.82rem; color: var(--text-secondary);
    padding: 4px 0; padding-left: 16px; position: relative;
}
.not-found-section li::before {
    content: '✗'; position: absolute; left: 0; color: var(--danger);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content { flex-direction: column; align-items: flex-start; gap: 4px; }
    .input-actions { flex-direction: column; }
    .route-actions { flex-direction: column; }
    .route-stats { flex-wrap: wrap; }
    .map-container { height: 40vh; min-height: 300px; }
    .route-item { padding: 12px 8px; }
}

@media (max-width: 640px) {
    .header-subtitle { display: none; }
    .route-results .results-header { flex-direction: column; align-items: flex-start; }
}
