/* Custom styles for restaurant website */

body {
    font-family: 'Kanit', sans-serif;
    background-color: #f8f9fa;
}

.navbar-brand {
    font-weight: bold;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-img-top {
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

.btn-group .btn {
    border-radius: 0.375rem;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.badge {
    font-size: 0.875em;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}

/* Menu item cards */
.menu-item .card {
    height: 100%;
}

.menu-item .card-body {
    display: flex;
    flex-direction: column;
}

.menu-item .card-text {
    flex-grow: 1;
}

/* Cart styles */
#cart-items {
    max-height: 400px;
    overflow-y: auto;
}

/* Form styles */
.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Status badges */
.badge.bg-warning {
    color: #000;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .btn-group {
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ระบบร้านอาหาร */

/* หน้าหลัก */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* การ์ดเมนู */
.menu-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.menu-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

/* ตะกร้าสินค้า */
.cart-item {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
}

.cart-item:last-child {
    border-bottom: none;
}

/* สถานะคำสั่งซื้อ */
.status-badge {
    font-size: 0.8rem;
    padding: 5px 10px;
}

/* ฟอร์มสั่งอาหาร */
.order-form {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
}

/* การ์ดสถิติ */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
}

.stats-card h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* ปุ่มการดำเนินการ */
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ตารางรายการสั่งซื้อ */
.order-items {
    max-width: 300px;
}

.order-items .mb-1 {
    padding: 5px 0;
}

.order-items hr {
    margin: 5px 0;
    opacity: 0.3;
}

/* สถานะเมนูในรายการสั่งซื้อ */
.order-items .badge {
    font-size: 0.7rem;
    padding: 3px 6px;
}

.order-items .d-flex {
    align-items: flex-start;
}

/* Dropdown สถานะเมนู */
.status-dropdown {
    padding: 2px 6px;
    border: none;
    background: transparent;
}

.status-dropdown:focus {
    box-shadow: none;
}

.status-dropdown .badge {
    font-size: 0.7rem;
    padding: 3px 6px;
}

.dropdown-menu {
    min-width: 150px;
}

/* เพิ่ม z-index ให้กับ dropdown menu ที่เลือกโต๊ะ */
.navbar-nav .dropdown-menu {
    z-index: 9999 !important;
}

/* เพิ่ม CSS สำหรับ navbar dropdown โดยเฉพาะ */
.navbar .dropdown {
    position: relative;
}

.navbar .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    margin-top: 0 !important;
}

/* ให้แน่ใจว่า dropdown จะอยู่เหนือทุกอย่างรวมถึง sticky elements */
.navbar .dropdown-menu,
.dropdown-menu.show,
.dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

/* ตรวจสอบให้แน่ใจว่า dropdown จะแสดงอยู่บนสุด */
#tableDropdown + .dropdown-menu {
    z-index: 9999 !important;
}

.dropdown-item {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item .badge {
    font-size: 0.7rem;
}

/* ตะกร้าสินค้าในหน้าเมนู */
#cart-items {
    max-height: 400px;
    overflow-y: auto;
}

#cart-items .input-group {
    max-width: 120px;
}

#cart-items .form-control {
    text-align: center;
    font-size: 0.875rem;
}

/* Bulk actions */
#bulk-actions {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

#bulk-actions .form-select {
    min-width: 150px;
}

/* Checkbox styling */
.form-check-input {
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Table checkbox column */
.table th:first-child,
.table td:first-child {
    width: 40px;
    text-align: center;
}

/* Responsive bulk actions */
@media (max-width: 768px) {
    #bulk-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    #bulk-actions .d-flex {
        flex-wrap: wrap;
    }
    
    #bulk-actions .form-select {
        min-width: 120px;
    }
    
    /* ตะกร้าสินค้าในมือถือ */
    .col-lg-3 {
        margin-top: 20px;
    }
    
    #cart-items .input-group {
        max-width: 100px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alert notifications */
.alert {
    border-radius: 10px;
    border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Table improvements */
.table th {
    background-color: #f8f9fa;
    border-top: none;
    font-weight: 600;
    color: #495057;
}

.table td {
    vertical-align: middle;
}

/* Card improvements */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 15px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0 !important;
}

/* Button improvements */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Form improvements */
.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Badge improvements */
.badge {
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
}

/* Navigation improvements */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* Footer */
.footer {
    background-color: #343a40;
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .table {
        font-size: 12px;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Filter form styles */
.filter-form {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-form .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.filter-form .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-form .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.filter-form .btn {
    border-radius: 8px;
    font-weight: 500;
}

/* Filter badges */
.filter-badge {
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 0.875rem;
}

/* Responsive filter form */
@media (max-width: 768px) {
    .filter-form .col-md-2 {
        margin-bottom: 15px;
    }
    
    .filter-form .d-flex {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-form .btn {
        width: 100%;
    }
}

/* จัดการกับ sticky elements ที่อาจทับ dropdown */
.sticky-top {
    z-index: 1020;
}

/* Responsive design สำหรับ dropdown */
@media (max-width: 991.98px) {
    .navbar .dropdown-menu {
        position: static !important;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
    
    .navbar .dropdown-menu .dropdown-item {
        color: rgba(255, 255, 255, 0.75);
        padding: 0.5rem 1rem;
    }
    
    .navbar .dropdown-menu .dropdown-item:hover {
        color: rgba(255, 255, 255, 1);
        background-color: transparent;
    }
}

/* เพิ่ม CSS สำหรับ Bootstrap dropdown โดยเฉพาะ */
.dropdown-menu.show {
    z-index: 9999 !important;
}

/* ให้แน่ใจว่า dropdown จะอยู่เหนือทุกอย่าง */
.dropdown-menu {
    z-index: 9999 !important;
}

/* จัดการกับ Bootstrap navbar dropdown */
.navbar-nav .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

/* จัดการกับ sticky cart ให้มี z-index ต่ำกว่า dropdown */
.card.sticky-top {
    z-index: 1020 !important;
}

/* ให้แน่ใจว่า navbar จะอยู่เหนือ sticky cart */
.navbar {
    z-index: 1030 !important;
}

/* จัดการกับ dropdown ใน navbar ให้อยู่เหนือทุกอย่าง */
.navbar .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    margin-top: 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    background-color: white !important;
}

/* จัดการกับ navbar collapse */
.navbar-collapse {
    z-index: 1025 !important;
}

/* ให้แน่ใจว่า dropdown จะแสดงอยู่บนสุดเสมอ */
.navbar-nav .dropdown-menu,
.navbar .dropdown-menu,
.dropdown-menu.show,
.dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    margin-top: 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    background-color: white !important;
}

/* จัดการกับ dropdown ใน mobile view */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        position: static !important;
        z-index: auto !important;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
}

/* เพิ่ม CSS สำหรับ Bootstrap navbar โดยเฉพาะ */
.navbar {
    position: relative;
    z-index: 1030 !important;
}

.navbar-nav {
    position: relative;
}

.navbar-nav .dropdown {
    position: relative;
}

/* จัดการกับ dropdown ใน navbar ให้อยู่เหนือทุกอย่าง */
.navbar .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    margin-top: 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    background-color: white !important;
}

/* จัดการกับ dropdown ใน mobile view */
@media (max-width: 991.98px) {
    .navbar-nav .dropdown-menu {
        position: static !important;
        z-index: auto !important;
        float: none;
        width: auto;
        margin-top: 0;
        background-color: transparent;
        border: 0;
        box-shadow: none;
    }
}

/* จัดการกับ navbar collapse */
.navbar-collapse {
    z-index: 1025 !important;
}

/* ให้แน่ใจว่า dropdown จะแสดงอยู่บนสุดเสมอ */
.navbar-nav .dropdown-menu,
.navbar .dropdown-menu,
.dropdown-menu.show,
.dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    top: 100% !important;
    left: auto !important;
    right: 0 !important;
    margin-top: 0 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    background-color: white !important;
} 