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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Login Page Styles */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 0 15px;
}

.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 50px;
    color: white;
}

.login-box h2 {
    color: #333;
    font-weight: 700;
    margin-top: 20px;
}

.login-box .text-muted {
    color: #666;
    font-size: 14px;
}

.login-box .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.login-box .input-group-text {
    background: #f8f9fa;
    border-right: none;
}

.login-box .form-control {
    border-left: none;
    padding: 12px 15px;
}

.login-box .form-control:focus {
    box-shadow: none;
    border-color: #667eea;
}

.login-box .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 10px;
}

.login-box .btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
}

/* Dashboard Layout */
.navbar {
    height: 60px;
    padding: 0 20px;
    z-index: 1000;
}

.sidebar {
    width: 250px;
    height: calc(100vh - 60px);
    position: fixed;
    top: 60px;
    left: 0;
    background: #2c3e50;
    color: white;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 999;
}

.sidebar-header {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-icon-sidebar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 30px;
}

.sidebar h5 {
    margin: 0;
    font-weight: 700;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-left-color: #667eea;
}

.sidebar .nav-link i {
    font-size: 18px;
    width: 20px;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
}

.user-role {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.main-content {
    margin-left: 250px;
    margin-top: 60px;
    padding: 30px;
    min-height: calc(100vh - 60px);
    background: #f5f7fa;
    transition: margin-left 0.3s ease;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    cursor: pointer;
}

/* Page Header */
.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    color: white;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.hero-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 16px;
    opacity: 0.9;
}

/* Stat Cards */
.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
}

.stat-primary .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.stat-warning .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-info .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-content h3 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    color: #2c3e50;
}

.stat-content p {
    margin: 0;
    color: #7f8c8d;
    font-size: 14px;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.card-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 20px;
    border-radius: 15px 15px 0 0 !important;
}

.card-header h5 {
    margin: 0;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Route Cards */
.route-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.route-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.route-header h5 {
    margin: 0;
    font-weight: 700;
    color: #2c3e50;
}

.route-info {
    margin-bottom: 15px;
}

.route-locations {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.location-item {
    margin-bottom: 10px;
}

.location-item:last-child {
    margin-bottom: 0;
}

.location-item strong {
    display: block;
    font-size: 11px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.location-item p {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
}

.driver-assignment {
    margin-bottom: 15px;
}

.driver-assignment .alert {
    padding: 12px;
    font-size: 14px;
}

.route-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.route-actions .btn {
    flex: 1;
    min-width: fit-content;
}

/* Tables */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead {
    background: #f8f9fa;
}

.table th {
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    padding: 15px;
}

.table td {
    padding: 15px;
    vertical-align: middle;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid #dee2e6;
    padding: 12px 15px;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Buttons */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #0e877c 0%, #2ed368 100%);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 10px;
}

/* Modals */
.modal-content {
    border-radius: 20px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    border-radius: 20px 20px 0 0;
    padding: 20px;
}

.modal-title {
    font-weight: 700;
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 20px;
}

/* Switches */
.form-switch .form-check-input {
    width: 50px;
    height: 25px;
    cursor: pointer;
}

.form-switch .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* Badges */
.badge {
    padding: 6px 12px;
    font-weight: 600;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-section {
        padding: 30px 20px;
    }
    
    .hero-content h2 {
        font-size: 24px;
    }
    
    .hero-content p {
        font-size: 14px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .stat-content h3 {
        font-size: 24px;
    }
}

@media (max-width: 767px) {
    .login-box {
        padding: 30px 20px;
    }
    
    .navbar {
        padding: 0 15px;
    }
    
    .navbar-brand {
        font-size: 14px;
    }
    
    .navbar-text {
        font-size: 12px;
    }
    
    .main-content {
        padding: 20px 15px;
    }
    
    .page-header h1 {
        font-size: 22px;
    }
    
    .hero-section {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .route-actions {
        flex-direction: column;
    }
    
    .route-actions .btn {
        width: 100%;
    }
    
    .stat-content h3 {
        font-size: 20px;
    }
    
    .stat-content p {
        font-size: 12px;
    }
}

@media (max-width: 575px) {
    .login-box {
        padding: 25px 15px;
    }
    
    .logo-icon {
        width: 80px;
        height: 80px;
        font-size: 40px;
    }
    
    .login-box h2 {
        font-size: 24px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
    }
    
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 10px;
    }
}

/* Overlay for mobile menu */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100vh - 60px);
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.sidebar-overlay.show {
    display: block;
}
/* Notification Button Styling */
.btn-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-info:hover {
    background: linear-gradient(135deg, #5568d3 0%, #653a8a 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-info i {
    margin-right: 5px;
}

/* Notification Modal Styling */
#sendNotificationModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#sendNotificationModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}
/* Ensure driver assignment box is always visible */
.driver-assignment {
    margin-bottom: 1rem;
    min-height: 60px;
}

.driver-assignment .alert {
    margin-bottom: 0 !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.driver-assignment .alert-success {
    background-color: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.driver-assignment .alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

/* Make sure driver name is visible */
.driver-assignment small {
    font-size: 0.9rem;
    font-weight: 500;
}
/* Existing styles... */

/* Mobile Sidebar Toggle */
.navbar-toggler {
    display: none;
    border: none !important;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar States */
.sidebar {
    transition: transform 0.3s ease, left 0.3s ease;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .navbar-toggler {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 999;
        transform: translateX(0);
    }
    
    .sidebar.active {
        left: 0;
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .navbar-brand {
        font-size: 0.9rem;
    }
    
    .navbar-text {
        font-size: 0.8rem;
    }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
    .navbar-toggler {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 999;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

/* Desktop - Sidebar always visible */
@media (min-width: 1025px) {
    .sidebar {
        position: fixed;
        left: 0;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 260px;
        width: calc(100% - 260px);
    }
}

/* Smooth transitions */
.sidebar,
.main-content {
    transition: all 0.3s ease;
}