/* Bootstrap 5 Theme Specs */
:root {
    --primary: #4F46E5;        /* Indigo */
    --primary-dark: #3730A3;
    --success: #16A34A;        /* Green */
    --warning: #F59E0B;        /* Amber */
    --danger: #DC2626;         /* Red */
    --light-bg: #F3F4F6;       /* Gray-100 */
    --text-default: #1F2937;   /* Gray-800 #1F2937*/
    --text-muted: #6B7280;     /* Gray-500 */
    --nav-bg: #e9e9e9;
}

/* Utility Classes */
.primary-bg { background: var(--primary) !important; }
.primary-dark-bg { background: var(--primary-dark) !important; }
.success-bg { background: var(--success) !important; }
.warning-bg { background: var(--warning) !important; }
.danger-bg { background: var(--danger) !important; }
.light-bg { background: var(--light-bg) !important; }

.text-default { color: var(--text-default) !important; }
.text-muted { color: var(--text-muted) !important; }

.rounded-xl {
    border-radius: 1rem !important;
}

.navbar-light-custom {
    background-color: var(--nav-bg) !important;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden;
}

/* Card Styles */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #E5E7EB;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.primary-bg:hover {
    background: var(--primary-dark) !important;
}

.success-bg:hover {
    background: #15803D !important;
}

.warning-bg:hover {
    background: #D97706 !important;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls .btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0.375rem;
}

/* Navbar Styles */
.navbar-brand {
    letter-spacing: -0.025em;
}

/* Order Items Styles */
#order-items {
    min-height: 200px;
}

.border {
    border-color: #E5E7EB !important;
}

.border-start {
    border-left: 1px solid #E5E7EB !important;
}

/* Custom Scrollbar */
.overflow-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-auto::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.overflow-auto::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.overflow-auto::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ========== MOBILE RESPONSIVE FIXES ========== */

/* General mobile fixes */
@media (max-width: 768px) {
    body {
        padding: 0 !important;
        margin: 0 !important;
        background: #454242 !important;
    }
    
    /* Main container */
    .d-flex.flex-column.vh-100.bg-custom.m-3.border.rounded-4.custom-border {
        margin: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        height: 100vh !important;
        min-height: 100vh;
        overflow: hidden;
    }
    
    /* Navbar fixes for mobile */
    .navbar {
        padding: 0.5rem 0 !important;
    }
    
    .navbar .container-fluid {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0.5rem 1rem !important;
    }
    
    .navbar-brand {
        text-align: center;
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 1.5rem !important;
    }
    
    /* Navigation links */
    .navbar .d-flex.gap-4 {
        width: 100%;
        justify-content: center !important;
        gap: 1rem !important;
        margin: 0.5rem 0;
        flex-wrap: wrap;
    }
    
    .top-nav-link {
        font-size: 14px !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* User info and logout */
    .navbar .d-flex.align-items-center {
        width: 100%;
        justify-content: center !important;
        margin-top: 0.5rem;
    }
    
    /* Menu section layout */
    #menu-section .layout-container {
        flex-direction: column !important;
        height: calc(100vh - 150px) !important;
        overflow: auto;
    }
    
    #menu-section main {
        flex: 0 0 60% !important;
        width: 100% !important;
        overflow-y: auto;
        padding: 1rem !important;
    }
    
    #menu-section aside {
        flex: 0 0 40% !important;
        width: 100% !important;
        border-left: none !important;
        border-top: 1px solid #ddd;
        max-height: 40vh !important;
        position: relative;
    }
    
    /* Menu cards grid */
    .menu-card {
        margin-bottom: 1rem;
    }
    
    .col-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* Category bar */
    .category-bar {
        flex-wrap: wrap;
        justify-content: center;
        padding: 0.5rem !important;
        gap: 0.75rem !important;
    }
    
    .category-link {
        font-size: 14px !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Orders, Tables, Payments sections */
    .content-section {
        padding: 1rem !important;
        overflow-y: auto;
        height: calc(100vh - 150px) !important;
    }
    
    .content-section .row.g-4 {
        margin-bottom: 0;
    }
    
    .content-section .row.g-4 > div {
        margin-bottom: 1rem;
    }
    
    /* Cards in other sections */
    .col-md-6, .col-lg-4, .col-lg-3, .col-md-3 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Table responsive */
    .table-responsive {
        font-size: 0.8rem;
        margin-bottom: 2rem !important;
    }
    
    /* Add bottom margin to last elements */
    .content-section > .p-4:last-child {
        padding-bottom: 3rem !important;
    }
    
    .table-responsive:last-child {
        margin-bottom: 3rem !important;
    }
    
    .row.mt-4:last-child {
        margin-bottom: 3rem !important;
    }
    
    /* Quantity controls mobile */
    .quantity-controls {
        transform: scale(0.9);
    }
}

/* Small phones */
@media (max-width: 480px) {
    .navbar-brand {
        font-size: 1.25rem !important;
    }
    
    .top-nav-link {
        font-size: 12px !important;
        padding: 0.2rem 0.4rem !important;
    }
    
    .category-link {
        font-size: 12px !important;
    }
    
    .menu-title {
        font-size: 15px !important;
    }
    
    .menu-price {
        font-size: 13px !important;
    }
    
    .menu-add-btn {
        width: 32px !important;
        height: 32px !important;
    }
}

/* Tablets and larger phones */
@media (min-width: 769px) and (max-width: 1024px) {
    #menu-section .layout-container {
        height: calc(100vh - 120px) !important;
    }
    
    #menu-section main {
        flex: 0 0 70% !important;
    }
    
    #menu-section aside {
        flex: 0 0 30% !important;
    }
    
    .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .col-lg-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
}

/* Disabled State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Typography */
.fw-semibold {
    font-weight: 600;
}

.fs-6 {
    font-size: 1rem !important;
}

.fs-7 {
    font-size: 0.875rem !important;
}

/* MINE FROM HERE */
.custom-border {
    border-width: 15px !important;
    border-color: #454242 !important; 
    background-color: var(--nav-bg) !important;
    overflow: hidden;
    background-clip: padding-box;
}

.custom-border main {
    background-color: var(--light-bg) !important;
}

.btn-outline-light {
    color: var(--text-default)!important; 
    border-color: var(--text-default) !important; 
}

.btn-outline-light:hover {
    background-color: var(--nav-bg) !important; /* filled chocolate on hover */
    color: var(--text-default) !important; /*white text on hover */
}

.menu-card {
    border-radius: 18px;
    border: 1px solid #eee;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform 0.15s ease-in-out;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.menu-card:hover {
    transform: translateY(-4px);
}

.menu-card img {
    width: 100%;
    height: 160px;
    object-fit: cover; /* cleaner and more natural than fill */
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.menu-card .p-3 {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem !important;
}

.content-sections {
    flex: 1;
    overflow: hidden;
    background-color: var(--light-bg);
}

/* Menu section specific fixes */
#menu-section {
    height: 100%;
    overflow: hidden;
}

#menu-section > .layout-container {
    height: 100% !important;
}

.menu-title {
    font-size: 17px;
    font-weight: 600;
}

.menu-price {
    font-size: 15px;
    color: #444;
}

.menu-add-btn {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #ccc;
    line-height: 0 !important;
    padding: 0 !important;
    background: #fff;
    font-family: Arial, sans-serif !important;
    position: relative;
    top: 0;
    cursor: pointer;
    user-select: none;
}

.menu-add-btn:hover {
    background: #eee;
}

.custom-border > nav.navbar {
    margin-top: 0 !important;
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
}

.custom-border > nav.navbar.border {
    border-top: none !important;
}

/* Layout */
.d-flex.flex-column.vh-100.bg-custom.m-3.border.rounded-4.custom-border {
    height: 100vh !important;
    max-height: 100vh;
    overflow: hidden;
}

.layout-container {
    display: flex;
    height: calc(100vh - 80px) !important;
    overflow: hidden;
}

.layout-container main {
    flex: 0 0 75%; /* main gets 70% */
    overflow-y: auto;
    max-height: 100%;
    padding-bottom: 20px; /* Add some bottom padding */
}

#menu-section main {
    width: 100%;
    flex: 0 0 75%;
    overflow-y: auto;
}

#menu-section aside {
    flex: 0 0 25%;
    border-left: 1px solid #ddd;
    background: #fff;
    overflow-y: auto;
}

.layout-container aside {
    flex: 0 0 25%; /* aside gets 30% */
    border-left: 1px solid #ddd;
    background: #fff;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.layout-container aside .flex-grow-1 {
    flex: 1;
    min-height: 0; /* Important for flex scrolling */
    overflow-y: auto;
}

.layout-container aside .border-top {
    flex-shrink: 0; /* Prevent buttons from being pushed out */
    margin-top: auto; /* Push to bottom */
}

.col-12 {
    height: auto !important;
}

.row.g-3 {
    margin-bottom: 20px;
}

.top-nav-link {
    font-size: 16px;
    color: #444;
    font-weight: 500;
}

.top-nav-link:hover {
    color: #000;
}

.logout-btn {
    border-color: #5a3e36 !important;
    color: #5a3e36 !important;
}

.category-bar {
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.category-link {
    font-size: 18px;
    color: #666;
    text-decoration: none;
    padding-bottom: 6px;
    white-space: nowrap;
}

.category-link:hover {
    color: #111;
}

.active-category {
    color: #000;
    border-bottom: 3px solid #000;
    font-weight: 600;
}

/* categories transitions */
.category-section {
    transition: all 0.3s ease;
    overflow: hidden;
}

.hidden-category {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    transform: fade-in;
    transform-origin: center;
}

/* end category transitions */

.bg-custom {
    background-color:  #454242 !important;
}

.cart-wrapper {
    overflow: hidden; /* ensures borders align cleanly */
}

/* Optional: adjust border color */
.cart-item {
    border-color: #e5e7eb; /* light grey like Tailwind/Apple UI */
}

/* Order Items Container */
#order-items {
    background-color: var(--light-bg);
    border: 1px solid #E5E7EB;
    border-radius: 1rem;
}

.order-item {
    transition: background-color 0.2s ease;
}

.order-item:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* Bottom border dividers */
.order-item.border-bottom {
    border-bottom: 1px solid #D1D5DB !important;
}

/* Remove border from last item */
.order-item:last-child {
    border-bottom: none !important;
}

/* Quantity controls styling */
.quantity-controls {
    background-color: white;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    padding: 2px;
    display: inline-flex;
    align-items: center;
}

.quantity-controls .btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0.375rem;
    border: none;
    color: var(--text-default);
}

.quantity-controls .btn:hover {
    background-color: var(--light-bg);
}

.quantity-controls span {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: var(--text-default);
}

/* MENUS ENHANCEMENTS */
/* Navigation Active State */
.top-nav-link.active-section {
    color: #000 !important;
    font-weight: 600;
    border-bottom: 3px solid #000;
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.content-section.active-section {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Table Cards */
.table-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem !important;
}

.table-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.table-number {
    padding: 15px 0;
}

.table-number .display-6 {
    font-size: 3.5rem;
    color: var(--text-default);
}

.table-actions .btn {
    border-radius: 8px;
    font-weight: 500;
}

/* Payment Cards */
.card {
    border: none;
    border-radius: 12px;
    margin-bottom: 1.5rem !important;
}

.card-body {
    padding: 1.5rem;
}

/* Statistics Cards */
.card .display-6 {
    font-size: 2.5rem;
}

/* Table Styling */
.table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem !important;
}

.table thead th {
    background-color: var(--light-bg);
    border-bottom: 2px solid #E5E7EB;
    font-weight: 600;
    color: var(--text-default);
}

.table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.05);
}

.table td, .table th {
    padding: 1rem;
    vertical-align: middle;
}

/* Badge Styles */
.badge {
    padding: 0.5em 1em;
    font-weight: 500;
    border-radius: 20px;
}

/* Button Groups */
.btn-group .btn {
    margin-right: 0.25rem;
}

.btn-group .btn:last-child {
    margin-right: 0;
}

/* Quick Actions */
.d-grid .btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem !important;
}

.d-grid .btn i {
    font-size: 1.1em;
}

/* Status Colors */
.bg-occupied { background-color: #FEE2E2 !important; color: #991B1B !important; }
.bg-available { background-color: #D1FAE5 !important; color: #065F46 !important; }
.bg-reserved { background-color: #FEF3C7 !important; color: #92400E !important; }

/* Section heights */
#orders-section,
#tables-section,
#payments-section {
    height: calc(100vh - 80px);
    overflow-y: auto;
    background-color: var(--light-bg);
}

#menu-section .layout-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Add bottom padding/margin to prevent overlapping */
.content-section .p-4 {
    padding-bottom: 3rem !important;
}

.row:last-child {
    margin-bottom: 3rem !important;
}

.table-responsive:last-child {
    margin-bottom: 3rem !important;
}

/* Mobile menu cards - force single column */
@media (max-width: 768px) {
    .menu-card {
        width: 100% !important;
        margin-bottom: 1rem;
    }
    
    .row.g-3 > .col-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* Ensure no horizontal overflow */
    .container-fluid, .p-4, .content-section {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        max-width: 100vw;
        overflow-x: hidden;
    }
}

/* Prevent text overflow on small screens */
@media (max-width: 480px) {
    .menu-title, .fw-semibold, .text-default {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .btn {
        padding: 0.375rem 0.75rem !important;
        font-size: 0.875rem !important;
    }
}

/* FOR POPUP MODAL*/
.grid-template-3 {
  grid-template-columns: repeat(3, 1fr);
}

#itemMetaModal .btn {
  padding: 14px;
  font-size: 1.1rem;
}
.grid-template-10 {
  grid-template-columns: repeat(10, 1fr);
}
.grid-template-9 {
  grid-template-columns: repeat(9, 1fr);
}

.grid-template-7 {
  grid-template-columns: repeat(7, 1fr);
}

#alpha-keyboard .btn {
  padding: 10px;
  font-size: 0.95rem;
}

/* LOGIN PAGE STYLES */
.login-layout {
  display: flex;
  height: 100vh;
  background: #f7f7f7;
}

/* LEFT */
.login-left {
  flex: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

.login-box {
  width: 320px;
  text-align: center;
}

.app-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.pin-input {
  width: 100%;
  font-size: 2rem;
  text-align: center;
  padding: 10px;
  letter-spacing: 12px;
  border: 2px solid #ddd;
  border-radius: 12px;
  margin-bottom: 20px;
}

/* NUM PAD */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.numpad button {
  padding: 16px;
  font-size: 1.2rem;
  border-radius: 12px;
  border: none;
  background: #f0f0f0;
  cursor: pointer;
}

.numpad button:active {
  background: #ddd;
}

.numpad .enter {
  background: #198754;
  color: #fff;
}

.numpad .clear {
  background: #dc3545;
  color: #fff;
}

/* RIGHT */
.login-right {
  flex: 3;
  padding: 30px;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e0e0e0;
}

.config-card {
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .login-right {
    display: none;
  }
}

