/* Design System & Variables */
:root {
    /* Colors */
    --bg-base: #f9fafb;      
    --bg-surface: #ffffff;   
    --bg-surface-hover: #f3f4f6; 
    
    --text-primary: #1a1a1a; 
    --text-secondary: #4b5563; 
    --text-muted: #6b7280;   
    
    --accent-primary: #e58c17; /* VARP Gold/Orange */
    --accent-primary-hover: #f9a334;
    
    --accent-success: #84cc16; /* Lime */
    --accent-danger: #ef4444;  /* Red */
    --accent-warning: #f59e0b; /* Amber */
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    
    /* Typography */
    --font-sans: 'Roboto', system-ui, sans-serif;
    --font-heading: 'Allerta Stencil', sans-serif;
    
    /* Effects */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 15px rgba(56, 189, 248, 0.3);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease-in-out;
    --transition-normal: 0.3s ease-in-out;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-hover);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.main-content {
    flex: 1;
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
}

/* Header */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 50;
    font-family: var(--font-sans);
}

.header-top {
    padding: var(--space-3) 0;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.header-bottom {
    border-top: 1px solid #e5e7eb;
}

.header-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.logo a {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.nav-link {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.9rem;
    padding: var(--space-3) 0;
    position: relative;
    text-transform: uppercase;
}

.nav-link:hover {
    color: var(--accent-primary);
}

.add-new-link {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: color 0.2s;
}

.add-new-link:hover {
    color: var(--accent-primary);
}

.btn-store {
    background-color: #ff0000;
    color: #ffffff !important;
    font-weight: 700;
    border-radius: var(--radius-md);
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.2s;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-store:hover {
    background-color: #cc0000;
}

/* Footer */
.footer {
    padding: var(--space-4) 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    font-family: inherit;
    font-size: 1rem;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(56, 189, 248, 0.39);
}

.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.23);
    color: #fff;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Cards */
.card {
    background-color: var(--bg-surface);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 0, 0, 0.15);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.card-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-3);
    display: flex;
    gap: var(--space-3);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: var(--space-4);
}

.grid-cols-1 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
    .grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Forms */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: var(--space-3);
    background-color: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23cbd5e1'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.5em;
    padding-right: 2.5rem;
}

/* Specific Views */
.hero {
    text-align: center;
    padding: var(--space-6) 0;
    margin-bottom: var(--space-6);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--space-3);
    background: linear-gradient(to right, #38bdf8, #a3e635);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-4) auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.1);
}

.badge-grade {
    background-color: var(--accent-success);
    color: #000;
}

.route-list {
    list-style: none;
    margin-top: var(--space-4);
}

.route-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color var(--transition-fast);
}

.route-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

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

.route-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.route-info p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: var(--space-6);
    background-color: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: var(--space-4);
}

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

.animate-fade-in {
    animation: fadeIn var(--transition-normal) forwards;
}

/* Drawing Studio Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-3);
}

.toolbar {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    background-color: var(--bg-surface);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.1);
}

.tools-group {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    border-right: 1px solid rgba(255,255,255,0.1);
    padding-right: var(--space-4);
}
.tools-group:last-child {
    border-right: none;
    padding-right: 0;
}

.tool-btn {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    border: 1px solid transparent;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.tool-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.tool-btn.active {
    border-color: var(--text-primary);
    box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 4px var(--text-primary);
}

.color-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    padding: 0;
}

.btn-danger {
    color: var(--accent-danger);
    background-color: rgba(244, 63, 94, 0.1);
}

.btn-danger:hover {
    background-color: rgba(244, 63, 94, 0.2);
}

.canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #000;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.1);
}

canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
    touch-action: none; /* Prevent scrolling while drawing */
}

/* Route Interactions */
.highlight-route {
    background-color: rgba(255, 255, 255, 0.1) !important;
    transform: scale(1.02);
}

.svg-route-path {
    transition: stroke-width 0.2s;
}

.svg-route-path:hover {
    stroke-width: 8 !important;
}

/* Homepage Redesign */
.full-bleed {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.home-map-container {
    height: 70vh;
    min-height: 400px;
    background: #222;
    margin-top: calc(var(--space-6) * -1); /* counter the main-content padding */
    margin-bottom: var(--space-6);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    gap: var(--space-4);
    padding-bottom: var(--space-4);
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) rgba(255,255,255,0.05);
}

.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}
.horizontal-scroll::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-full);
}
.horizontal-scroll::-webkit-scrollbar-thumb {
    background-color: var(--accent-primary);
    border-radius: var(--radius-full);
}

.horizontal-card {
    min-width: 280px;
    flex-shrink: 0;
}

.feed-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.feed-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background-color: var(--bg-surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    transition: transform 0.2s, background-color 0.2s;
}

.feed-item:hover {
    transform: translateX(4px);
    background-color: var(--bg-surface-hover);
}

.feed-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255,255,255,0.1);
    font-size: 1.2rem;
}

.card-image-wrapper { height: 140px; width: 100%; overflow: hidden; border-radius: var(--radius-md); margin-bottom: 12px; } .card-image-wrapper img { width: 100%; height: 100%; object-fit: cover; display: block; } .placeholder-image { width: 100%; height: 100%; background-color: var(--bg-surface-hover); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-weight: bold; }