* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-image: url('../images/login_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
}

.logo {
    height: 60px;
    width: auto;
}

.login-container {
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group button {
    width: 100%;
    padding: 0.75rem;
    background-color: #1877f2;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.form-group button:hover {
    background-color: #166fe5;
}

.error-message {
    color: #ff0000;
    text-align: center;
    margin-top: 1rem;
    display: none;
}

/* Common styles used across pages */
.navbar {
    background-color: #1877f2;
    padding: 15px 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    gap: 20px;
    align-items: center;
}

.logout-button {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.logout-button:hover {
    background-color: #c82333;
    
}

.error-message {
    color: red;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
}

/* Navigation Bar Styles */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    width: 100%;
}

.logout-button {
    margin-left: auto;
    position: absolute;
    right: 20px;
}

.nav-brand {
    margin-right: auto;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link i {
    font-size: 1.2rem;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #1877f2;
        flex-direction: column;
        padding: 1rem;
        gap: 10px;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        display: flex;
        padding: 12px;
        justify-content: flex-start;
        width: 100%;
    }
}

.mileage-summary {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.mileage-grid {
    display: grid;
    gap: 15px;
    margin-top: 10px;
}

.mileage-item {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.mileage-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.date-range {
    font-weight: bold;
    color: #1877f2;
}

.mileage-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.mileage-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.mileage-pagination button {
    padding: 5px 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.mileage-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vehicle-container {
    padding: 20px;
    max-width: 1800px;
    margin: 0 auto;
    margin-top: 60px;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 25px;
    padding: 10px;
}

.vehicle-card {
    background-color: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
}

.vehicle-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #1877f2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.vehicle-title {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-id {
    margin: 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.device-id::before {
    content: '📹';
    font-size: 0.9rem;
}

.status-indicator {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    letter-spacing: 0.3px;
}

.status-indicator.online {
    background-color: #10b981;
    color: #fff;
    border: 1px solid #059669;
}

.status-indicator.offline {
    background-color: #ef4444;
    color: #fff;
    border: 1px solid #dc2626;
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    background-color: #fff;
}

.status-indicator.online::before {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.status-indicator.offline::before {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.vehicle-type {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.device-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.vehicle-details {
    padding: 20px;
    background-color: white;
}

.vehicle-details p {
    margin: 10px 0;
    color: #4b5563;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vehicle-details strong {
    color: #1f2937;
    font-weight: 600;
}

.device-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
}

.device-details[style*="display: none"] {
    opacity: 0;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.device-item {
    background-color: white;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 10px;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.device-item:hover {
    background-color: #f8fafc;
    border-color: #d1d5db;
}

.device-info p {
    margin: 6px 0;
    color: #4b5563;
}

.view-devices-btn {
    background-color: #1877f2;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    font-weight: 600;
    width: 100%;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(24, 119, 242, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}

.view-devices-btn:hover {
    background-color: #1666d8;
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.4);
    filter: brightness(1.05);
}

.error {
    color: #dc3545;
    font-size: 0.9rem;
}

/* Responsive breakpoints */
@media (max-width: 1024px) {
    .vehicle-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .vehicle-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .vehicle-container {
        padding: 15px;
    }

    .vehicle-card {
        padding: 15px;
    }

    .vehicle-title h3 {
        font-size: 1.1rem;
    }
}

.vehicle-title h3 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.location-info {
    background-color: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    margin: 15px 0;
    border: 1px solid #e2e8f0;
}

.location-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #1f2937;
    font-weight: 600;
}

.location-icon {
    font-size: 1.2rem;
    color: #1877f2;
}

.location-address {
    color: #4b5563;
    font-size: 0.95rem;
    margin: 8px 0;
    line-height: 1.4;
    padding-left: 24px;
}

.location-time {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 0.85rem;
    margin: 8px 0;
}

.time-icon {
    font-size: 1rem;
    color: #9ca3af;
}

.coordinates {
    display: flex;
    gap: 10px;
    margin: 12px 0;
}

.coordinates span {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-family: monospace;
    font-size: 0.9rem;
    color: #1f2937;
}

.coord-icon {
    font-size: 1rem;
    color: #1877f2;
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #1877f2;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.map-link:hover {
    background-color: #1666d8;
    transform: translateY(-1px);
}

.map-link::before {
    content: '🗺️';
    font-size: 1.1rem;
}
