* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f6fa;
    color: #2c3e50;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
}

.github-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 0.85rem;
}

.github-link span {
    font-size: 0.8rem;
    opacity: 0.9;
}

.github-link a {
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.github-link a:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.github-link svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.author-text {
    font-size: 0.75rem;
    opacity: 0.9;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.role-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.role-selector label {
    font-weight: 500;
}

.role-selector select {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 0.9rem;
    min-width: 120px;
}

.role-selector select option {
    background: #667eea;
    color: white;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 0.5rem 2rem;
    font-size: 0.75rem;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    flex-shrink: 0;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    flex: 1;
    text-align: left;
}

.footer-right {
    flex: 1;
    text-align: right;
}

.copyright {
    font-size: 0.75rem;
    opacity: 0.9;
}

.author-text {
    font-size: 0.75rem;
    opacity: 0.9;
}

.author-text a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.author-text a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.sidebar {
    width: 380px;
    background: white;
    border-right: 1px solid #e1e8ed;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.panel {
    padding: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
}

.panel h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status {
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.status .active {
    background: #d4edda;
    color: #155724;
}

.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.info span {
    font-weight: 500;
}

.stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

.stat-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
}

.driver-list, .order-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
}

.driver-item, .order-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.driver-item.offline {
    border-left-color: #6c757d;
    opacity: 0.7;
}

.driver-name, .order-id {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.driver-status, .order-status {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.driver-location, .order-route {
    font-size: 0.8rem;
    color: #6c757d;
}

.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

.map-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255,255,255,0.95);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.legend-marker.driver-online {
    background: #27ae60;
}

.legend-marker.driver-offline {
    background: #6c757d;
}

.legend-marker.pickup {
    background: #3498db;
    border-radius: 0;
    transform: rotate(45deg);
}

.legend-marker.drop {
    background: #e74c3c;
    border-radius: 0;
    transform: rotate(45deg);
}

.legend-marker.current-user {
    background: #3498db;
    border-radius: 50%;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.notification.success {
    background: #27ae60;
}

.notification.error {
    background: #e74c3c;
}

.notification.info {
    background: #3498db;
}

.notification.warning {
    background: #f39c12;
}

.notification.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.hidden {
    display: none !important;
}

.no-drivers, .no-orders {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem 0;
}

/* Interactive animations */
.driver-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
    transition: all 0.2s ease;
    cursor: pointer;
}

.panel:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.status.active {
    background: #d4edda;
    color: #155724;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom marker animations */
.custom-marker {
    background: transparent !important;
    border: none !important;
    transition: all 0.3s ease;
}

.custom-marker:hover {
    transform: scale(1.1);
}

.driver-marker-online {
    background: #27ae60;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.driver-marker-offline {
    background: #6c757d;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.pickup-marker {
    background: #3498db;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transform: rotate(45deg);
}

.drop-marker {
    background: #e74c3c;
    width: 16px;
    height: 16px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transform: rotate(45deg);
}

.leaflet-marker-icon {
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.driver-marker-online {
    background: #27ae60;
    border: 3px solid white;
}

.driver-marker-offline {
    background: #95a5a6;
    border: 3px solid white;
}

.user-marker {
    background: #3498db;
    border: 3px solid white;
}

/* Responsive design */
@media (max-width: 1024px) {
    .sidebar {
        width: 320px;
    }
}

@media (max-width: 768px) {
    .app-container {
        min-height: 100vh;
    }
    
    .header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-left {
        width: 100%;
        justify-content: center;
    }
    
    .header-center {
        order: -1;
        width: 100%;
        justify-content: center;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
    }
    
    .header h1 {
        font-size: 1.2rem;
        text-align: center;
        margin: 0;
    }
    
    .role-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .role-selector label {
        text-align: center;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e1e8ed;
    }
    
    .map-container {
        height: 45vh;
    }
    
    .footer {
        padding: 0.5rem 1rem;
        font-size: 0.7rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
    }
    
    .footer-left,
    .footer-right {
        text-align: center;
        flex: none;
    }
    
    .map-legend {
        bottom: 10px;
        right: 10px;
        padding: 0.5rem;
        font-size: 0.75rem;
    }
    
    .panel {
        padding: 1rem;
    }
    
    .panel h3 {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .controls {
        gap: 0.75rem;
    }
    
    .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1rem;
    }
    
    .sidebar {
        height: 45vh;
    }
    
    .map-container {
        height: 45vh;
    }
    
    .panel {
        padding: 0.75rem;
    }
    
    .panel h3 {
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 0.5rem 0.7rem;
        font-size: 0.75rem;
    }
    
    .map-legend {
        display: none;
    }
}
