/* SkyAgro Order Management System - Custom CSS */

/* Global Styles */
html, body {
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body {
    padding-bottom: 60px; /* Space for mobile bottom navigation */
}

@media (min-width: 768px) {
    body {
        padding-bottom: 0; /* Remove padding on larger screens */
    }
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

@media (max-width: 576px) {
    .login-container {
        margin: 20px auto;
        padding: 15px;
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.login-logo img:hover {
    transform: scale(1.05);
}

.login-logo h2 {
    color: #007bff;
    margin-bottom: 5px;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 0;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
    background-color: #f8f9fa;
}

.sidebar-sticky {
    position: sticky;
    top: 0;
    height: calc(100vh);
    padding-top: 0.5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin: 0.2rem 0.5rem;
}

.sidebar .nav-link:hover {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

.sidebar .nav-link.active {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
}

/* Mobile Bottom Navigation */
.navbar.fixed-bottom {
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    height: 60px;
}

.navbar.fixed-bottom .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #6c757d;
    padding: 0.25rem;
}

.navbar.fixed-bottom .nav-link i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.navbar.fixed-bottom .nav-link.active {
    color: #007bff;
}

/* Content */
.content {
    padding: 20px;
}

@media (max-width: 576px) {
    .content {
        padding: 10px;
    }
}

/* Cards */
.card {
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 500;
}

/* Dashboard Stats */
.stats-card {
    border-left: 4px solid;
    transition: transform 0.3s;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card.primary {
    border-left-color: #007bff;
}

.stats-card.success {
    border-left-color: #28a745;
}

.stats-card.warning {
    border-left-color: #ffc107;
}

.stats-card.danger {
    border-left-color: #dc3545;
}

.stats-card .icon {
    font-size: 2rem;
    opacity: 0.7;
}

/* Tables */
.table th {
    font-weight: 500;
    background-color: #f8f9fa;
}

/* Responsive Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* DataTables Responsive */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    background-color: #007bff;
    width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 50%;
    box-shadow: none;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-bottom: 10px;
}

@media (max-width: 576px) {
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        float: none;
        text-align: left;
    }
    
    .dataTables_wrapper .dataTables_filter input {
        width: 100%;
        margin-left: 0;
    }
    
    .dataTables_wrapper .dataTables_paginate {
        float: none;
        text-align: center;
    }
}

/* Status Badges */
.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
}

/* Order Status Colors */
.status-pending {
    background-color: #FFFFFF;
    color: #000000;
    border: 1px solid #dee2e6;
}

.status-approved {
    background-color: #FFFF00;
    color: #000000;
}

.status-in-production {
    background-color: #FFA500;
    color: #000000;
}

.status-quality-check {
    background-color: #FFA500;
    color: #000000;
}

.status-ready-for-dispatch {
    background-color: #00BFFF;
    color: #000000;
}

.status-dispatched {
    background-color: #32CD32;
    color: #000000;
}

.status-delivered {
    background-color: #008000;
    color: #FFFFFF;
}

.status-completed {
    background-color: #A52A2A;
    color: #FFFFFF;
}

.status-rejected {
    background-color: #808080;
    color: #FFFFFF;
}

/* Forms */
.form-label {
    font-weight: 500;
}

.required:after {
    content: " *";
    color: #dc3545;
}

/* Improved form controls for touch */
.form-control, .form-select, .btn {
    min-height: 44px; /* Minimum touch target size */
}

.input-group-text {
    min-height: 44px;
}

.btn-sm {
    min-height: 32px;
}

/* Select2 Customization */
.select2-container--default .select2-selection--single {
    height: 44px;
    border: 1px solid #ced4da;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px;
}

@media (max-width: 576px) {
    .select2-container {
        width: 100% !important;
    }
}

/* Order Cart */
.cart-item {
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-total {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Dealer Details */
.dealer-details {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.dealer-photo {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Button groups for mobile */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.btn-group .btn {
    margin-bottom: 2px;
}

/* Offcanvas improvements */
.offcanvas-body {
    padding-top: 0;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
    .sidebar {
        position: static;
        height: auto;
    }
    
    .sidebar-sticky {
        height: auto;
    }
    
    .content {
        margin-left: 0;
    }
    
    /* Adjust spacing for mobile */
    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 0.75rem;
    }
    
    .card {
        margin-bottom: 15px;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Improve touch targets */
    .nav-link {
        padding: 0.75rem;
    }
    
    /* Fix table overflow */
    .table {
        width: 100% !important;
    }
}

@media (max-width: 576px) {
    .btn-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .btn-group .btn {
        margin-bottom: 5px;
        width: 100%;
    }
} 