:root {
    --bg-color: #fdfbfb;
    --panel-bg: rgba(255, 255, 255, 0.7);
    --panel-border: rgba(255, 255, 255, 0.5);
    --text-primary: #334155; /* slate-700 */
    --text-secondary: #64748b; /* slate-500 */
    --accent-color: #2563eb; /* blue-600 */
    --accent-hover: #1d4ed8; /* blue-700 */
    --input-bg: rgba(255, 255, 255, 0.8);
    --input-border: #e2e8f0; /* slate-200 */
    --panel-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 2rem;
    box-shadow: var(--panel-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 2rem;
    gap: 2rem;
}

.header {
    text-align: center;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: transparent;
    background: linear-gradient(to right, #2563eb, #4f46e5);
    -webkit-background-clip: text;
    background-clip: text;
}

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

.main-content {
    display: flex;
    gap: 2rem;
    height: 600px;
}

.sidebar {
    flex: 0 0 350px;
    display: flex;
    flex-direction: column;
}

.map-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.glass-panel {
    background: transparent;
    border-right: 1px solid var(--panel-border);
    padding: 2rem;
    overflow-y: auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.map-panel {
    padding: 0.5rem;
    overflow: hidden;
    width: 100%;
    flex: 1;
    min-height: 300px;
}

#distance-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-group input, .input-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.input-group input:focus, .input-group select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    background: #ffffff;
}

.input-group select option {
    background: #ffffff;
    color: var(--text-primary);
}

#calculate-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to right, #2563eb, #4f46e5);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

#calculate-btn:hover {
    background: linear-gradient(to right, #1d4ed8, #4338ca);
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -3px rgba(37, 99, 235, 0.4);
}

#calculate-btn:active {
    transform: translateY(0);
}

.toll-helper {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--input-border);
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toll-helper.hidden {
    display: none;
}

.toll-helper h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.helper-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: -0.5rem;
}

.suggested-roads {
    font-size: 0.85rem;
    color: #059669; /* emerald-600 */
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
    margin-bottom: 0.5rem;
}

.suggested-roads.hidden {
    display: none;
}

.helper-cost {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

#helper-cost-val {
    font-weight: bold;
    color: var(--text-primary);
}

#add-toll-btn {
    background: var(--input-border);
    color: var(--text-primary);
    border: none;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

#add-toll-btn:not(:disabled):hover {
    background: #75B343; /* Green */
    color: white;
}

#add-toll-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.added-tolls-list {
    list-style: none;
    margin-top: 0.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.added-toll-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.remove-toll-btn {
    background: transparent;
    border: none;
    color: #ef4444; /* red-500 */
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    padding: 0 0.5rem;
}

.remove-toll-btn:hover {
    color: #dc2626;
}

.results-container {
    margin-top: 1rem;
    padding: 1.5rem;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: 1rem;
    box-shadow: var(--panel-shadow);
    opacity: 1;
    transition: opacity 0.4s ease;
}

.results-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.results-container h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.5rem;
}

.result-item .label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.result-item .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
}

.result-item.highlight {
    background: rgba(37, 99, 235, 0.05); /* Blue-500/5 */
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.result-item.highlight .value {
    color: #2563eb; /* blue-600 */
    font-size: 1.5rem;
}

.toll-warning {
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(245, 158, 11, 0.1); /* amber-500 */
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 0.5rem;
    color: #d97706; /* amber-600 */
    font-size: 0.875rem;
    text-align: center;
}

.toll-warning.hidden {
    display: none;
}

#map {
    flex: 1;
    width: 100%;
    min-height: 400px;
    border-radius: 0.5rem;
    background-color: #f1f5f9; /* slate-100 */
}

/* Custom map styling to fit dark mode will be handled in JS */

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        flex: none;
    }
    
    .map-section {
        height: 400px;
    }
}
