/* Main CSS file for POS system */

/* POS Styles */
.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.pos-product-card {
    position: relative;
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.pos-product-card:hover {
    border-color: #007bff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 123, 255, 0.25);
    transform: translateY(-2px);
}

.pos-product-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.pos-product-price {
    color: #28a745;
    font-weight: bold;
    font-size: 1.1rem;
}

.pos-cart-sidebar {
    background: #f8f9fc;
    border-radius: 0.5rem;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    background: white;
}

.pos-cart-total {
    background: #28a745;
    color: white;
    padding: 1rem;
    border-radius: 0.375rem;
    text-align: center;
    font-weight: bold;
}

.pos-loading {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.pos-btn {
    white-space: nowrap;
    min-width: 120px;
}

/* Table card styles */
.table-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.table-name {
    font-weight: bold;
    font-size: 1.1rem;
}

.table-status {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.pos-table-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.pos-card {
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.pos-card:hover {
    border-color: #007bff;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 123, 255, 0.25);
    transform: translateY(-2px);
}

.pos-table-card.free {
    border-color: #28a745;
}

.pos-table-card.occupied {
    border-color: #dc3545;
}

.pos-table-card.needs_payment {
    border-color: #ffc107;
}

/* Categories scroll */
.categories-scroll {
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

/* Product description */
.product-description {
    font-size: 0.75rem;
}

/* Cart items container */
.cart-items-container {
    min-height: 200px;
}

/* Dashboard Styles */
.card {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
}

.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.text-primary {
    color: #5a5c69 !important;
}

.text-gray-800 {
    color: #5a5c69 !important;
}

.badge-success {
    background-color: #1cc88a;
}

.badge-warning {
    background-color: #f6c23e;
    color: #000;
}

.btn-block {
    display: block;
    width: 100%;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #856404;
}

/* Custom Toastr styles for flash messages */
#toast-container {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    z-index: 1999 !important;
    width: 350px !important;
    max-width: 90vw !important;
}

.header-link {
    text-decoration: none;
}

.toast {
    margin-bottom: 10px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border-radius: 8px !important;
    border: none !important;
    min-width: 300px !important;
}

.toast .toast-close-button {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
}

.toast .toast-close-button:hover {
    color: white !important;
}

.toast-success {
    background-color: #28a745 !important;
}

.toast-error {
    background-color: #dc3545 !important;
}

.toast-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.toast-info {
    background-color: #17a2b8 !important;
}

.toast .toast-progress {
    background: rgba(255, 255, 255, 0.3) !important;
    height: 3px !important;
}

/* Frontend flash messages */
.alert-dismissible {
    animation: slideDown 0.3s ease-out;
}

.alert-dismissible.fade {
    transition: opacity 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Auto-hide flash messages after 1 second */
.alert-dismissible {
    animation: slideDown 0.3s ease-out, autoHide 0.25s ease-in 1s forwards;
}

@keyframes autoHide {
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}





/* Bottom Sheet Modal Styles */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1055;
    max-height: 80vh;
    overflow: hidden;
}

.bottom-sheet.show {
    transform: translateY(0);
}

.bottom-sheet-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1054;
}

.bottom-sheet-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.bottom-sheet-header {
    padding: 20px 20px 15px;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    margin: 0 auto 15px;
    cursor: grab;
}

.bottom-sheet-handle:active {
    cursor: grabbing;
}

.bottom-sheet-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.bottom-sheet-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bottom-sheet-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.bottom-sheet-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.bottom-sheet-footer {
    padding: 15px 20px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* Quick notes buttons */
.quick-note-btn {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 16px;
    margin: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.quick-note-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.quick-note-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Touch-friendly form elements */
.bottom-sheet .form-control {
    min-height: 48px;
    font-size: 16px; /* Prevents zoom on iOS */
}

.bottom-sheet .btn {
    min-height: 48px;
    padding: 12px 24px;
}

/* Demo styles */
.demo-container {
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
    margin-top: 50px;
}

.pos-product-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pos-product-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .bottom-sheet {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
    }

    .bottom-sheet.show {
        transform: translateX(-50%) translateY(0);
    }
}

/* Animation for content */
.bottom-sheet-content {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

.bottom-sheet.show .bottom-sheet-content {
    opacity: 1;
    transform: translateY(0);
}