:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f3f4f6;
    --sidebar-bg: #ffffff;
    --text-main: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --danger-color: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 350px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    z-index: 10;
}

.header {
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

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

/* Controls */
.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

input[type="text"], select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    ring: 2px solid rgba(37, 99, 235, 0.2);
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
    border: none;
    transition: background-color 0.2s;
}

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

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

.btn-secondary {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--bg-color);
}

.hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Route Actions */
.route-actions {
    padding: 1rem;
    background-color: #eff6ff;
    border-radius: 0.5rem;
    border: 1px solid #dbeafe;
    margin-bottom: 1.5rem;
}

.route-actions h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #1e40af;
}

.description {
    font-size: 0.75rem;
    color: #1e3a8a;
    margin-bottom: 0.75rem;
}

/* Market List */
.market-list-container {
    flex: 1;
    overflow-y: auto;
}

.market-list-container h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.market-list {
    list-style: none;
}

.market-item {
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.market-item:hover {
    background-color: var(--bg-color);
}

.market-item.active {
    background-color: #eff6ff;
    border-color: #bfdbfe;
}

.market-name {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    display: block;
}

.market-type {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.type-municipal { background-color: #d1fae5; color: #065f46; }
.type-tianguis { background-color: #fce7f3; color: #9d174d; }
.type-apoyo { background-color: #fef3c7; color: #92400e; }
.type-especializado { background-color: #e0e7ff; color: #3730a3; }

/* Map Area */
.map-container {
    flex: 1;
    position: relative;
    background-color: #e5e7eb;
}

#map {
    width: 100%;
    height: 100%;
}

.map-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    z-index: 5;
}

.placeholder-content {
    text-align: center;
    max-width: 400px;
    padding: 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.placeholder-content h2 {
    margin-bottom: 1rem;
    color: var(--text-main);
}

.placeholder-content p {
    color: var(--text-secondary);
}

/* Utility */
.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(1);
}
