/* ==========================================================================
   KRISPY KING INVENTORY MANAGEMENT SYSTEM - PRODUCTION CSS
   Version: 2.0 Production Ready
   
   Features:
   - Responsive design for mobile and desktop
   - Clean, modern UI with consistent branding
   - Mobile-first navigation with hamburger menu
   - Optimized for performance and accessibility
   ========================================================================== */

/* ==========================================================================
   KRISPY KING INVENTORY MANAGEMENT SYSTEM - CUSTOM CSS
   ========================================================================== */

/* ==========================================================================
   BASE STYLES
   ========================================================================== */

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Body with fixed navbar spacing */
body {
    padding-top: 80px;
}

/* ==========================================================================
   NAVBAR STYLES (FIXED HEADER)
   ========================================================================== */

.navbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    height: 80px;
    background-color: #ff6b6b !important;
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: none;
}

/* Navbar brand */
.navbar-brand {
    font-weight: 600;
    font-size: 1.5rem;
    color: white !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-right: 2rem;
    transition: transform 0.2s ease;
}

.navbar-brand:hover {
    color: white !important;
    text-decoration: none;
    transform: scale(1.02);
}

.navbar-brand img {
    height: 40px;
    margin-right: 10px;
}

/* User navigation buttons */
.navbar .btn {
    margin-left: 0.3rem;
    border-radius: 5px;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.navbar .btn-outline-light {
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
}

.navbar .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-1px);
}

.navbar .btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.navbar .btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-1px);
}

.navbar-text {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
}

/* Mobile navbar toggle */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 0.7rem;
    border-radius: 5px;
    background-color: transparent;
    color: white;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    outline: none;
}

.navbar-toggler:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler i {
    font-size: 1.1rem;
    color: white;
}

/* ==========================================================================
   SIDEBAR STYLES
   ========================================================================== */

.sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    width: 250px;
    height: calc(100vh - 80px);
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: all 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

/* Sidebar content wrapper */
.sidebar .position-sticky {
    padding: 1.5rem 0;
}

/* Sidebar navigation */
.sidebar .nav {
    padding: 0 1rem;
}

.sidebar .nav-item {
    margin-bottom: 0.2rem;
}

.sidebar .nav-link {
    color: #495057;
    font-weight: 500;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar .nav-link:hover {
    background-color: #f8f9fa;
    color: #ff6b6b;
    text-decoration: none;
    border-color: #ff6b6b;
    transform: translateX(3px);
}

.sidebar .nav-link.active {
    background-color: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.8rem;
    font-size: 1rem;
}

/* ==========================================================================
   MOBILE USER NAVIGATION IN SIDEBAR
   ========================================================================== */

.mobile-user-nav {
    border-top: 1px solid #e9ecef !important;
    margin-top: 1rem;
    padding-top: 1rem;
}

.mobile-user-nav .text-muted {
    font-weight: 500;
    color: #6c757d !important;
    display: block;
    margin-bottom: 0.5rem;
}

.mobile-user-nav .nav-link {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.mobile-user-nav .nav-link.text-danger {
    color: #dc3545 !important;
}

.mobile-user-nav .nav-link.text-danger:hover {
    background-color: #f8d7da;
    color: #721c24 !important;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */

main {
    margin-left: 250px;
    padding: 2rem 0 1rem 0;
    min-height: calc(100vh - 80px);
    transition: margin-left 0.3s ease;
}

main .container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 100%;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

/* Mobile devices */
@media (max-width: 767.98px) {
    body {
        padding-top: 70px;
    }
    
    .navbar {
        height: 70px;
        padding: 0.5rem 1rem;
    }
    
    .navbar-brand {
        font-size: 1.3rem;
        margin-right: 1rem;
    }
    
    .navbar-brand img {
        height: 35px;
    }
    
    /* Hide button text on mobile */
    .navbar .btn .d-none.d-md-inline {
        display: none !important;
    }    /* Sidebar off-screen by default */
    .sidebar {
        position: fixed !important;
        top: 70px !important;
        left: -250px !important;
        width: 250px !important;
        height: calc(100vh - 70px) !important;
        z-index: 1040 !important;
        box-shadow: 3px 0 15px rgba(0, 0, 0, 0.2) !important;
        background-color: #ffffff !important;
        border-right: 1px solid #e0e0e0 !important;
        transition: left 0.3s ease !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        display: block !important;
    }
    
    .sidebar.show {
        left: 0 !important;
    }
    
    /* Main content full width on mobile */
    main {
        margin-left: 0;
        padding: 1.5rem 0 1rem 0;
    }
    
    main .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }    /* Mobile overlay */
    .sidebar-overlay {
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        width: 100% !important;
        height: calc(100vh - 70px) !important;
        background-color: rgba(0, 0, 0, 0.5) !important;
        z-index: 1035 !important;
        display: none !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
    }
    
    .sidebar-overlay.show {
        display: block !important;
        opacity: 1 !important;
    }
}

/* Desktop and tablet */
@media (min-width: 768px) {
    .sidebar {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    main {
        margin-left: 250px;
    }
}

/* ==========================================================================
   COMPONENT STYLES
   ========================================================================== */

/* Dashboard cards */
.dashboard-card {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.dashboard-card:hover {
    transform: translateY(-3px);
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin-bottom: 15px;
}

/* Card icon colors */
.bg-primary-soft {
    background-color: #cfe2ff;
    color: #0d6efd;
}

.bg-success-soft {
    background-color: #d1e7dd;
    color: #198754;
}

.bg-warning-soft {
    background-color: #fff3cd;
    color: #ffc107;
}

.bg-danger-soft {
    background-color: #f8d7da;
    color: #dc3545;
}

.bg-info-soft {
    background-color: #cff4fc;
    color: #0dcaf0;
}

/* Tables */
.table {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    margin-bottom: 1rem;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    font-weight: 600;
}

.table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* Cards and content overflow prevention */
.card, .card-body {
    overflow-x: hidden;
    word-wrap: break-word;
}

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 0 0.25rem rgba(255, 107, 107, 0.25);
}

/* Buttons */
.btn-primary {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #ff5252;
    border-color: #ff5252;
}

.btn-outline-primary {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.btn-outline-primary:hover {
    background-color: #ff6b6b;
    border-color: #ff6b6b;
}

.btn {
    transition: all 0.2s ease;
}

/* Modals */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Badges */
.badge-low-stock {
    background-color: #ff6b6b;
    color: white;
}

/* Alerts */
.alert {
    border-radius: 8px;
    margin-bottom: 20px;
}

/* DataTables customization */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #ff6b6b !important;
    color: white !important;
    border: 1px solid #ff6b6b !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #ff5252 !important;
    color: white !important;
    border: 1px solid #ff5252 !important;
}

/* Product images */
.product-image {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

/* Print styles */
@media print {
    .sidebar, .navbar, .no-print {
        display: none !important;
    }
    
    main {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .card {
        break-inside: avoid;
    }
}

/* Notification indicators */
.notification-indicator {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ffc107;
    border: 2px solid #ff6b6b;
}

.nav-link {
    position: relative;
}
