/* Rivian Spotter - Main Stylesheet */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --text-dark: #1a1a1a;
    --text-light: #666;
    --border-color: #e5e5e5;
    --hover-bg: #f9f9f9;
    --active-bg: #f0f7ff;
    --shadow: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-light: 0 1px 3px rgba(0,0,0,0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Container */
.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: var(--shadow-light);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.logo-dot {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
}

/* Navigation */
.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-dark);
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
}

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

/* Sidebar */
.sidebar {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 380px;
    max-width: calc(100% - 2rem);
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 100;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-350px);
}

.sidebar-toggle {
    position: absolute;
    right: -40px;
    top: 1rem;
    background: white;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 0.5rem;
    cursor: pointer;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

/* Search Box */
.search-box {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

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

/* Filter Buttons */
.filter-buttons {
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.filter-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

/* Location Stats */
.location-stats {
    padding: 0.75rem 1rem;
    background: #f8f8f8;
    font-size: 0.85rem;
    color: var(--text-light);
    border-bottom: 1px solid var(--border-color);
}

/* Location List */
.location-list {
    max-height: 400px;
    overflow-y: auto;
}

.location-card {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.location-card:hover {
    background: var(--hover-bg);
}

.location-card.active {
    background: var(--active-bg);
}

.location-type {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.location-type.outpost {
    background: var(--secondary-color);
}

.location-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.location-address {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.4;
}

.location-hours {
    color: var(--primary-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

.location-closed {
    color: #f44336;
}

/* Map Markers */
.marker {
    background-color: var(--primary-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.marker:hover {
    transform: scale(1.1);
}

.marker.outpost {
    background-color: var(--secondary-color);
}

.marker-icon {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Mapbox Popup */
.mapboxgl-popup-content {
    padding: 0;
    border-radius: 8px;
    min-width: 250px;
}

.popup-content {
    padding: 1rem;
}

.popup-type {
    display: inline-block;
    padding: 0.2rem 0.4rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.popup-type.outpost {
    background: var(--secondary-color);
}

.popup-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.popup-address {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.popup-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.popup-button:hover {
    background: #45a049;
}

/* Page Content (for About/Contact pages) */
.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.page-section {
    margin-bottom: 2rem;
}

.page-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.page-section p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Contact Form */
.contact-form {
    max-width: 600px;
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.form-submit:hover {
    background: #45a049;
}

/* Footer */
.footer {
    background: #f8f8f8;
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-text {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: calc(100% - 2rem);
    }
    
    .nav-links {
        display: none;
    }
    
    .filter-buttons {
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-title {
        font-size: 2rem;
    }
}

/* Loading Spinner */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
