/* Custom styles for Maruti Car Booking System */

/* General Layout */
body {
    background-color: #f8f9fa;
}

.sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

/* Ensure proper container layout */
.container-fluid {
    padding-left: 0;
    padding-right: 0;
}

/* Fix Bootstrap grid issues */
.row {
    margin-left: 0;
    margin-right: 0;
    display: flex;
    flex-wrap: wrap;
}

.col-md-3, .col-lg-2 {
    padding-left: 0;
    padding-right: 0;
}

.col-md-9, .col-lg-10 {
    padding-left: 15px;
    padding-right: 15px;
}

/* Ensure proper flex layout */
@media (min-width: 768px) {
    .row {
        display: flex !important;
    }
    
    .col-md-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    
    .col-md-9 {
        flex: 0 0 75% !important;
        max-width: 75% !important;
    }
    
    .col-lg-2 {
        flex: 0 0 16.666667% !important;
        max-width: 16.666667% !important;
    }
    
    .col-lg-10 {
        flex: 0 0 83.333333% !important;
        max-width: 83.333333% !important;
    }
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    border-radius: 8px;
    margin: 2px 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.2);
    color: white;
    transform: translateX(5px);
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* Logout link styling for better visibility */
.sidebar .nav-link.text-danger {
    color: #ff6b6b !important;
    background-color: rgba(255, 107, 107, 0.1) !important;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.sidebar .nav-link.text-danger:hover {
    color: white !important;
    background-color: #ff6b6b !important;
    border-color: #ff6b6b;
    transform: translateX(5px);
}

/* Sidebar Header Styling */
.sidebar h4 {
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.sidebar small {
    font-size: 0.875rem;
    opacity: 0.8;
}

.sidebar hr {
    border-color: rgba(255,255,255,0.3);
    margin: 15px 0;
}

/* Main Content Area */
.main-content {
    padding: 20px;
    min-height: 100vh;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    border: none;
    padding: 15px 20px;
}

.card-header h5 {
    margin: 0;
    font-weight: 600;
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.form-label i {
    margin-right: 8px;
    color: #667eea;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

/* Action buttons in tables */
.btn-group-sm .btn {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 6px;
}

.btn-group-sm .btn i {
    margin-right: 4px;
}

/* Status badges in action column */
.badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
}

.ms-1 {
    margin-left: 0.25rem !important;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Upload Area */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.upload-area i {
    color: #667eea;
    margin-bottom: 15px;
}

/* Car Details Card */
.car-details-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
}

.car-details-card h6 {
    margin-bottom: 15px;
    font-weight: 600;
}

.car-details-card p {
    margin-bottom: 8px;
    font-size: 14px;
}

.car-details-card strong {
    font-weight: 600;
}

/* Tables */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px;
    font-weight: 600;
}

.table tbody tr {
    transition: background-color 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

/* Status Badges */
.badge {
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
}

.badge-pending {
    background-color: #ffc107;
    color: #212529;
}

.badge-approved {
    background-color: #28a745;
    color: white;
}

.badge-rejected {
    background-color: #dc3545;
    color: white;
}

.badge-delivered {
    background-color: #17a2b8;
    color: white;
}

.badge-cancelled {
    background-color: #6c757d;
    color: white;
}

.badge-retailed {
    background-color: #007bff;
    color: white;
}

/* Alerts */
.alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
}

.alert-success {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Progress Bar */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Financial Input Fields */
.financial-input {
    background-color: #f8f9fa;
}

.financial-input:focus {
    background-color: white;
}

/* Financial input styling */
.financial-input {
    border-left: 4px solid #007bff;
}

.financial-input:focus {
    border-left-color: #0056b3;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Readonly input styling */
input[readonly] {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

/* GST field specific styling */
#gst:placeholder-shown {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

#gst:placeholder-shown::placeholder {
    color: #856404;
    font-style: italic;
}

/* GST calculation message styling */
.gst-message {
    font-size: 0.875rem;
    color: #28a745;
    font-weight: 500;
}

.gst-message i {
    margin-right: 5px;
}

/* Form Sections */
.form-section {
    margin-bottom: 30px;
}

.form-section h5 {
    color: #495057;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* Mobile Header Bar */
@media (max-width: 768px) {
    /* Create a mobile header bar */
    .mobile-header-bar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 15px;
        z-index: 1048;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .mobile-page-title {
        color: white;
        font-size: 1.2rem;
        font-weight: 600;
        margin: 0;
        flex: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .mobile-toggle-btn {
        background: rgba(255,255,255,0.2);
        border: none;
        border-radius: 8px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-size: 1.1rem;
        transition: all 0.3s ease;
    }
    
    .mobile-toggle-btn:hover {
        background: rgba(255,255,255,0.3);
        transform: scale(1.05);
    }
    
    /* Adjust main content to account for fixed header */
    main {
        padding-top: 75px !important; /* 60px header + 15px spacing */
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* Hide original page headers on mobile */
    .d-flex.justify-content-between.align-items-center.mb-4 {
        display: none !important;
    }
    
    /* Hide mobile toggle container (replaced by header bar) */
    .mobile-toggle-container {
        display: none !important;
    }
    
    /* Card headers and titles */
    .card-header h5,
    .card-header h6 {
        margin-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Ensure proper spacing for all page content */
    .container-fluid .row .col-md-9,
    .container-fluid .row .col-lg-10 {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}



/* Responsive Design */
@media (max-width: 768px) {
    /* Mobile sidebar styles */
    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        z-index: 1040;
        transition: left 0.3s ease;
        height: 100vh;
        overflow-y: auto;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    /* Main content adjustments for mobile */
    .main-content {
        margin-left: 0 !important;
        padding: 15px;
        padding-top: 80px; /* Space for mobile toggle button */
        width: 100% !important;
    }
    
    /* Offcanvas specific styles */
    .offcanvas {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        z-index: 1045;
        width: 280px !important;
    }
    
    /* Ensure sidebar links are clickable */
    .offcanvas .nav-link {
        color: rgba(255,255,255,0.9) !important;
        padding: 12px 20px;
        border-radius: 8px;
        margin: 2px 10px;
        transition: all 0.3s ease;
        position: relative;
        z-index: 1046;
        text-decoration: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: flex;
        align-items: center;
    }
    
    .offcanvas .nav-link:hover,
    .offcanvas .nav-link.active {
        background-color: rgba(255,255,255,0.25) !important;
        color: white !important;
        transform: translateX(5px);
    }
    
    .offcanvas .nav-link i {
        margin-right: 10px;
        width: 20px;
        text-align: center;
    }
    
    /* Mobile logout link styling */
    .offcanvas .nav-link.text-danger {
        color: #ff6b6b !important;
        background-color: rgba(255, 107, 107, 0.15) !important;
        border: 1px solid rgba(255, 107, 107, 0.4);
    }
    
    .offcanvas .nav-link.text-danger:hover {
        color: white !important;
        background-color: #ff6b6b !important;
        border-color: #ff6b6b;
        transform: translateX(5px);
    }
    
    .offcanvas-header {
        border-bottom: 1px solid rgba(255,255,255,0.2);
        padding: 1rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .offcanvas-body {
        padding: 1rem;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    /* Ensure offcanvas title is visible */
    .offcanvas-title {
        color: white !important;
        font-weight: 600;
    }
    
    /* Close button styling */
    .btn-close-white {
        filter: invert(1) brightness(100%);
    }
    
    /* Fix mobile sidebar interaction */
    .offcanvas .nav-item {
        margin: 0;
    }
    
    .offcanvas .nav-item .nav-link {
        pointer-events: all !important;
        cursor: pointer !important;
        display: block !important;
    }
    
    /* Mobile sidebar backdrop */
    .offcanvas-backdrop {
        z-index: 1040 !important;
    }
    
    /* Ensure mobile sidebar is fully visible */
    .offcanvas.show {
        transform: none !important;
        visibility: visible !important;
    }
    
    /* Ensure main content doesn't overlap */
    main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .card {
        margin-bottom: 20px;
    }
    
    .upload-area {
        padding: 20px;
    }
}

/* Desktop sidebar styles */
@media (min-width: 769px) {
    .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: block !important;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    /* Hide mobile toggle on desktop */
    .mobile-toggle-container {
        display: none !important;
    }
    
    /* Ensure proper desktop layout */
    .col-md-9 {
        margin-left: 0;
    }
    
    .col-lg-10 {
        margin-left: 0;
    }
    
    /* Fix offcanvas issues on desktop */
    .offcanvas {
        position: relative !important;
        transform: none !important;
        visibility: visible !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        width: auto !important;
    }
    
    /* Ensure main content is beside sidebar */
    main {
        margin-left: 0 !important;
        float: none !important;
        padding-top: 30px !important;
    }
    
    /* Force flex layout */
    .container-fluid .row {
        display: flex !important;
        flex-direction: row !important;
    }
    
    /* Hide mobile header bar on desktop */
    .mobile-header-bar {
        display: none !important;
    }
    
    /* Desktop content spacing */
    .col-md-9, .col-lg-10 {
        padding-top: 20px !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* Login Page Styles */
.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    margin: 50px auto;
    max-width: 400px;
    position: relative;
    z-index: 1;
}

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
}

.login-header h3 {
    margin: 0;
    font-weight: 700;
    font-size: 1.8rem;
}

.login-header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.login-body {
    padding: 30px;
}

.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Login page layout */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Hide mobile header on login page */
.login-page .mobile-header-bar {
    display: none !important;
}

/* Fix login page layout on all devices */
@media (max-width: 768px) {
    .login-card {
        margin: 0 auto;
        max-width: 100%;
    }
    
    .login-header {
        padding: 25px 20px;
    }
    
    .login-body {
        padding: 25px;
    }
    
    .login-page {
        padding: 10px;
    }
}

@media (min-width: 769px) {
    .login-card {
        margin: 0 auto;
    }
    
    .login-page {
        padding: 40px;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    text-align: center;
    padding: 20px;
}

.spinner-border {
    color: #667eea;
}

/* Alert Container */
#alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Print Styles */
@media print {
    .sidebar,
    .btn,
    .alert {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
} 