/* ============================================================================
   EasyTrack Client App - Styles
   ============================================================================ */

:root {
    --primary: #3B82F6;
    --primary-dark: #2563EB;
    --secondary: #F3F4F6;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Safe area support */
@supports (padding-top: env(safe-area-inset-top)) {
    .safe-area-top { padding-top: env(safe-area-inset-top); }
    .safe-area-bottom { padding-bottom: env(safe-area-inset-bottom); }
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.2);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-primary:hover { background-color: var(--primary-dark); }
.btn-primary:disabled { background-color: #D1D5DB; cursor: not-allowed; }

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-secondary:hover { background-color: #E5E7EB; }

/* Cards */
.card {
    background-color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Vehicle Items */
.vehicle-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.vehicle-item:hover {
    border-color: var(--primary);
    background-color: rgba(59, 130, 246, 0.05);
}

.vehicle-item.selected,
.vehicle-item.active {
    border-color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Status colors */
.status-moving { color: var(--success); }
.status-parked { color: var(--primary); }
.status-offline { color: var(--text-secondary); }

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.moving { background-color: var(--success); }
.status-dot.parked { background-color: var(--primary); }
.status-dot.offline { background-color: #9CA3AF; }

/* Map Markers */
.custom-marker {
    background: transparent !important;
    border: none !important;
}

.marker-content {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.plate-badge-container {
    background: transparent !important;
    border: none !important;
}

.plate-speed-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    white-space: nowrap;
}

.plate-badge {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.model-badge {
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.85);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 8px;
    font-weight: 500;
}

.speed-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    color: white;
}

.parked-badge {
    background: #3B82F6;
    display: flex;
    align-items: center;
    gap: 2px;
}

.leaflet-control-zoom {
    display: none !important;
}

/* Navigation */
.nav-item {
    transition: all 0.3s ease;
}

.nav-item:hover {
    transform: translateY(-2px);
}

.nav-item.active {
    color: var(--primary);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Replay Timeline */
.timeline-container {
    position: relative;
    padding: 0.5rem 1rem;
    background: white;
    border-top: 1px solid var(--border);
}

.timeline-slider {
    width: 100%;
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

.timeline-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--primary);
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    cursor: grab;
}

.timeline-thumb:active {
    cursor: grabbing;
}

/* Trip List */
.trip-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
}

.trip-item:hover {
    background: #F9FAFB;
}

.trip-item.active {
    border: 2px solid var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

/* Account Menu Items */
.menu-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-item:hover {
    background: #F9FAFB;
}

/* Leaflet overrides */
.leaflet-container {
    font-family: inherit;
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
}

.leaflet-control-zoom a {
    background: white !important;
    color: var(--text-primary) !important;
}

.leaflet-control-zoom a:hover {
    background: #F3F4F6 !important;
}

/* Date picker */
.date-picker-input {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    width: 100%;
    cursor: pointer;
}

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

/* Stats cards */
.stat-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state svg {
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Pull to refresh indicator */
.pull-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 0.5rem;
    background: white;
    transform: translateY(-100%);
    transition: transform 0.3s;
}

.pull-indicator.visible {
    transform: translateY(0);
}

/* Splash screen float animation */
@keyframes splash-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}
.splash-float {
    animation: splash-float 2.5s ease-in-out infinite;
}
