/* POS System - Minimal custom CSS using Bootstrap 5 utilities */

/* Body background - Use Bootstrap bg-light utility class instead */
/* Removed: body { background-color: #f5f6f8; } - Use class="bg-light" on body or container */

/* Navbar shadow - Bootstrap has shadow utilities */
/* Removed: .navbar { box-shadow: ... } - Use class="shadow-sm" on navbar */

/* Card styling - Bootstrap has rounded and shadow utilities */
/* Removed: .card { border-radius, box-shadow } - Use class="rounded shadow-sm" on cards */

/* Card header border - Bootstrap handles this */
/* Removed: .card-header { border-bottom-color } - Bootstrap default is sufficient */

/* POS-specific hover effects - Required for functionality */
.pos-item .card {
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
    cursor: pointer;
}

.pos-item .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.12);
}

/* POS item image - Required for consistent sizing */
.pos-item img.card-img-top {
    height: 120px;
    object-fit: cover;
}

/* POS item card body - Required for flex layout */
.pos-item .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* POS category tabs - Required for rounded pill style */
#posCategoryTabs .nav-link {
    border-radius: 999px;
    font-size: 0.85rem;
    padding-inline: 0.85rem;
}

/* POS shortcode button hover - Required for visual feedback */
.pos-shortcode-btn:hover {
    filter: brightness(1.03);
}

/* Kitchen order card status borders - Required for status indication */
.kitchen-order-card .card {
    border-left-width: 4px;
    border-left-style: solid;
}

.kitchen-order-card.status-pending .card {
    border-left-color: #6c757d;
}

.kitchen-order-card.status-preparing .card {
    border-left-color: #ffc107;
}

.kitchen-order-card.status-ready .card {
    border-left-color: #198754;
}

/* Responsive adjustments - Required for mobile */
@media (max-width: 991.98px) {
    .pos-item .card-body h6 {
        font-size: 0.85rem;
    }
}

/* ============================================
   PRINT STYLES FOR REPORTS
   ============================================ */

@media print {
    /* Hide navigation, headers, footers, and non-essential elements */
    nav.navbar,
    .navbar,
    .breadcrumb,
    .breadcrumb-item,
    ol.breadcrumb,
    .container-fluid.mt-3.mb-3,
    h2.mb-1,
    p.text-muted.mb-0.small,
    .alert,
    .btn,
    button,
    .card-header .btn,
    .card-header button,
    .no-print,
    .print-hide,
    .modal,
    .modal-backdrop,
    .spinner-border,
    .spinner-border-sm {
        display: none !important;
    }
    
    /* Hide page title and breadcrumb row */
    .container-fluid > .row:first-child {
        display: none !important;
    }
    
    /* Hide info alerts */
    .alert-info,
    .alert-warning,
    .alert-danger,
    .alert-success {
        display: none !important;
    }
    
    /* Hide filter sections and controls */
    .card:has(.form-select),
    .card:has(.form-control[type="date"]),
    .card:has(.form-control[type="text"][id*="Search"]),
    .card:has(.form-control[type="text"][id*="Filter"]),
    .card:has(button[onclick*="loadReport"]),
    .card:has(button[onclick*="load"]),
    .card:has(button[onclick*="generate"]),
    .card:has(button[onclick*="search"]),
    .card:has(button[onclick*="filter"]) {
        display: none !important;
    }
    
    /* Hide specific filter cards by ID/class */
    #periodSelect,
    #startDate,
    #endDate,
    #orderSearch,
    #orderStatusFilter,
    #orderTypeFilter,
    #paymentMethodFilter,
    .card:has(#periodSelect),
    .card:has(#startDate),
    .card:has(#orderSearch),
    .card:has(#orderStatusFilter) {
        display: none !important;
    }
    
    /* Show only report content */
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    /* Remove padding and margins for print */
    .container-fluid,
    .container {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }
    
    /* Card styling for print */
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 15pt;
    }
    
    .card-header {
        background: #f8f9fa !important;
        color: black !important;
        border-bottom: 2px solid #ddd !important;
        padding: 8pt !important;
        font-weight: bold;
    }
    
    .card-body {
        padding: 10pt !important;
    }
    
    /* Simple table styling for print */
    table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 10pt;
        page-break-inside: auto;
        border: 1px solid #000 !important;
    }
    
    table thead {
        display: table-header-group;
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    table tbody {
        display: table-row-group;
    }
    
    table tr {
        page-break-inside: avoid;
        page-break-after: auto;
        border-bottom: 1px solid #ddd !important;
    }
    
    table th,
    table td {
        border: 1px solid #ddd !important;
        padding: 8pt !important;
        text-align: left;
    }
    
    table th {
        font-weight: bold;
        background: #f0f0f0 !important;
        border-bottom: 2px solid #000 !important;
    }
    
    /* Hide badges completely in print */
    .badge {
        display: none !important;
    }
    
    /* Remove table striping and hover effects */
    .table-striped tbody tr:nth-of-type(odd) {
        background-color: transparent !important;
    }
    
    .table-hover tbody tr:hover {
        background-color: transparent !important;
    }
    
    /* Simple table borders */
    .table {
        border: 1px solid #000 !important;
    }
    
    .table-dark {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .table-dark th {
        background: #f0f0f0 !important;
        color: black !important;
        border-bottom: 2px solid #000 !important;
    }
    
    /* Remove background colors and use borders instead */
    .bg-primary,
    .bg-success,
    .bg-warning,
    .bg-danger,
    .bg-info,
    .bg-secondary {
        background: white !important;
        color: black !important;
        border: 1px solid #333 !important;
    }
    
    /* Text colors for print */
    .text-primary,
    .text-success,
    .text-warning,
    .text-danger,
    .text-info {
        color: black !important;
    }
    
    /* Page breaks */
    .page-break-before {
        page-break-before: always;
    }
    
    .page-break-after {
        page-break-after: always;
    }
    
    .page-break-inside-avoid {
        page-break-inside: avoid;
    }
    
    /* Report title styling */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: black !important;
    }
    
    /* Remove shadows and effects */
    .shadow,
    .shadow-sm,
    .shadow-lg {
        box-shadow: none !important;
    }
    
    /* Ensure images print properly */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Hide DataTables controls */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate,
    .dataTables_wrapper .dataTables_processing {
        display: none !important;
    }
    
    /* Show only the table */
    .dataTables_wrapper .dataTables_scrollBody {
        overflow: visible !important;
    }
    
    /* Ensure DataTables table is visible */
    .dataTables_wrapper table {
        display: table !important;
    }
    
    /* Print report title */
    .card-header h5 {
        font-size: 14pt !important;
        font-weight: bold !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Print header with title, date, and filter details */
    .print-header {
        display: block !important;
        margin-bottom: 20pt;
        padding-bottom: 10pt;
        border-bottom: 2px solid #000;
        page-break-after: avoid;
    }
    
    .print-header .print-title {
        font-size: 18pt;
        font-weight: bold;
        text-align: center;
        margin-bottom: 8pt;
    }
    
    .print-header .print-meta {
        font-size: 10pt;
        text-align: center;
        margin-bottom: 4pt;
    }
    
    .print-header .print-filters {
        font-size: 9pt;
        text-align: center;
        color: #666;
        margin-top: 8pt;
    }
    
    /* Hide summary cards in print - show only tables */
    .card.bg-primary,
    .card.bg-success,
    .card.bg-info,
    .card.bg-warning,
    .card.bg-danger,
    .row.mb-4:has(.card.bg-primary),
    .row.mb-4:has(.card.bg-success) {
        display: none !important;
    }
    
    /* Simplify card headers - just show as simple text */
    .card-header {
        background: transparent !important;
        border-bottom: 1px solid #000 !important;
        padding: 6pt !important;
        font-weight: bold;
        font-size: 12pt;
    }
    
    .card-header h6 {
        margin: 0 !important;
        font-size: 12pt !important;
    }
    
    /* Hide icons in print */
    .bi,
    i.bi,
    [class*="bi-"] {
        display: none !important;
    }
    
    /* Ensure proper spacing for print */
    .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Print page breaks */
    @page {
        margin: 1.5cm;
        size: A4;
    }
    
    /* Avoid breaking important elements */
    .card,
    table {
        page-break-inside: avoid;
    }
    
    /* Allow page breaks between cards */
    .card + .card {
        page-break-before: auto;
    }
    
    /* Convert summary rows to simple table format */
    .row.mb-4 {
        display: block !important;
        margin-bottom: 15pt !important;
    }
    
    /* Convert colored stat cards to simple bordered boxes (no colors) */
    .card.bg-primary,
    .card.bg-success,
    .card.bg-info,
    .card.bg-warning,
    .card.bg-danger,
    .card.bg-secondary,
    .card.text-white {
        background: white !important;
        color: black !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        padding: 0 !important;
    }
    
    .card.bg-primary .card-body,
    .card.bg-success .card-body,
    .card.bg-info .card-body,
    .card.bg-warning .card-body,
    .card.bg-danger .card-body,
    .card.bg-secondary .card-body,
    .card.text-white .card-body {
        padding: 8pt !important;
    }
    
    .card.bg-primary h6,
    .card.bg-success h6,
    .card.bg-info h6,
    .card.bg-warning h6,
    .card.bg-danger h6,
    .card.bg-secondary h6,
    .card.text-white h6 {
        font-size: 10pt !important;
        margin-bottom: 4pt !important;
        font-weight: normal !important;
        color: black !important;
    }
    
    .card.bg-primary h3,
    .card.bg-success h3,
    .card.bg-info h3,
    .card.bg-warning h3,
    .card.bg-danger h3,
    .card.bg-secondary h3,
    .card.text-white h3 {
        font-size: 14pt !important;
        margin: 0 !important;
        font-weight: bold !important;
        color: black !important;
    }
    
    /* Show small summary tables as simple tables */
    table.table-sm {
        display: table !important;
        width: 100% !important;
        margin-bottom: 10pt !important;
        border: 1px solid #000 !important;
    }
    
    /* Hide card headers for summary sections but keep content */
    .card-header.bg-light {
        display: none !important;
    }
    
    /* Convert summary cards to simple bordered boxes */
    .row.mb-4 .card {
        border: 1px solid #000 !important;
        background: white !important;
        box-shadow: none !important;
        margin-bottom: 8pt !important;
    }
    
    .row.mb-4 .card .card-body {
        padding: 8pt !important;
    }
    
    /* Show only main data tables (full-size tables) */
    table.table:not(.table-sm) {
        display: table !important;
    }
    
    /* Ensure table-responsive shows main tables */
    .table-responsive {
        display: block !important;
    }
    
    /* Show the main report card */
    .card.shadow-sm {
        display: block !important;
    }
    
    /* Show only tables and simple content */
    .table-responsive,
    table {
        display: block !important;
    }
    
    /* Simplify card body - remove extra padding and styling */
    .card-body {
        padding: 10pt !important;
    }
    
    /* Hide any alert boxes in report content */
    #reportContent .alert,
    .report-content .alert {
        display: none !important;
    }
    
    /* Print-friendly spacing */
    .py-4,
    .py-3,
    .py-2 {
        padding-top: 10pt !important;
        padding-bottom: 10pt !important;
    }
    
    .mb-4,
    .mb-3,
    .mb-2 {
        margin-bottom: 10pt !important;
    }
    
    /* Report summary cards */
    .card.bg-primary,
    .card.bg-success,
    .card.bg-info,
    .card.bg-warning {
        background: white !important;
        border: 2px solid #333 !important;
        color: black !important;
    }
    
    /* Ensure report content is visible */
    #reportContent,
    .report-content {
        display: block !important;
    }
    
    /* Hide empty states and loading indicators */
    .text-center.py-5,
    .spinner-border,
    .text-muted:contains('Click'),
    .text-muted:contains('Loading') {
        display: none !important;
    }
}