/* RESTOPRO Main Styles - Fully Responsive */
:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --secondary-color: #2196F3;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --success-color: #4CAF50;
    --info-color: #00BCD4;
    --dark-color: #333;
    --light-color: #f4f4f4;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    font-size: 16px;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
}

.sidebar-logo img {
    max-width: 120px;
    max-height: 80px;
    border-radius: 8px;
    object-fit: contain;
}

.sidebar-logo .logo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(76, 175, 80, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #4CAF50;
}

.sidebar-company-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
    margin: 5px 0;
    word-wrap: break-word;
    max-width: 100%;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    top: 15px;
    right: 15px;
    display: none;
    z-index: 1001;
    transition: all 0.3s;
    border-radius: 4px;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s;
    gap: 12px;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    border-left: 4px solid #fff;
}

.nav-item i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* Mobile Toggle Button */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 999;
    background: white;
    border: none;
    border-radius: 4px;
    padding: 10px 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
    transition: all 0.3s;
}

.mobile-toggle:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .mobile-toggle {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    .top-header {
        padding-left: 60px;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .sidebar-toggle {
        display: none;
    }
    
    .mobile-toggle {
        display: none;
    }
}

.user-info {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.user-name {
    font-weight: bold;
}

.user-role {
    font-size: 0.85rem;
    color: #bdc3c7;
    text-transform: capitalize;
}

.logout-btn {
    display: block;
    padding: 10px;
    background: var(--danger-color);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    width: calc(100% - var(--sidebar-width));
}

.top-header {
    height: var(--header-height);
    background: white;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 10px;
}

.top-header h1 {
    font-size: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-badge {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.content-wrapper {
    padding: 20px;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3 {
    font-size: 1.2rem;
}

.card-body {
    padding: 20px;
}

/* Grid System */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-5 {
    grid-template-columns: repeat(5, 1fr);
}

.grid-6 {
    grid-template-columns: repeat(6, 1fr);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #1976D2;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #e68900;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    white-space: nowrap;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* POS Styles */
.pos-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    height: calc(100vh - 140px);
    min-height: 500px;
}

.pos-products {
    overflow-y: auto;
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
}

.pos-cart {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.product-card {
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.product-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}

.product-card .product-name {
    font-weight: 500;
    margin-bottom: 5px;
}

.product-card .product-price {
    color: var(--primary-color);
    font-weight: bold;
}

/* Cart Items */
.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    min-height: 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    gap: 10px;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    color: #666;
    font-size: 0.9rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Table Management */
.table-layout {
    position: relative;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    min-height: 500px;
    padding: 20px;
    overflow: auto;
}

.restaurant-table {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    user-select: none;
    -webkit-user-select: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.restaurant-table:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.restaurant-table.available {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.restaurant-table.occupied {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

.restaurant-table.reserved {
    background: #fff3cd;
    border: 2px solid #ffc107;
    color: #856404;
}

.restaurant-table.cleaning {
    background: #d1ecf1;
    border: 2px solid #17a2b8;
    color: #0c5460;
}

/* Dashboard Stats */
.dashboard-stats {
    margin-bottom: 20px;
}

.stat-icon {
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    color: #4CAF50;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.login-logo p {
    color: #666;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.login-btn:hover {
    background: #388E3C;
}

.demo-credentials {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9rem;
}

.demo-credentials p {
    margin: 5px 0;
}

/* Print Styles */
@media print {
    .sidebar,
    .top-header,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        width: 100%;
    }
    
    .content-wrapper {
        padding: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    background: white;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #4CAF50;
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideIn 0.3s ease;
    max-width: 90%;
}

.toast-error {
    background: #f44336;
}

.toast-warning {
    background: #ff9800;
}

.toast-info {
    background: #2196F3;
}

/* Responsive Design - Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .grid-5,
    .grid-6 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .pos-container {
        grid-template-columns: 1fr 350px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

/* Responsive Design - Mobile Landscape (576px - 768px) */
@media (max-width: 768px) {
    /* Sidebar */
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    /* Main Content */
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    
    /* Mobile Header */
    .top-header {
        padding: 0 15px;
    }
    
    .top-header h1 {
        font-size: 1.2rem;
    }
    
    .company-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .content-wrapper {
        padding: 15px;
    }
    
    /* Grids */
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-5,
    .grid-6 {
        grid-template-columns: 1fr;
    }
    
    /* Cards */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-body {
        padding: 15px;
    }
    
    /* POS */
    .pos-container {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }
    
    .pos-products {
        max-height: 400px;
    }
    
    .pos-cart {
        max-height: 500px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    /* Tables */
    .table-layout {
        min-height: 400px;
    }
    
    .restaurant-table {
        width: 70px;
        height: 70px;
        font-size: 0.9rem;
    }
    
    /* Forms */
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .btn-sm {
        width: auto;
    }
    
    /* Modals */
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
    
    /* Tables */
    .table {
        min-width: 500px;
    }
}

/* Responsive Design - Mobile Portrait (up to 576px) */
@media (max-width: 576px) {
    body {
        font-size: 14px;
    }
    
    .top-header h1 {
        font-size: 1rem;
    }
    
    .content-wrapper {
        padding: 10px;
    }
    
    .card-body {
        padding: 10px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .product-card {
        padding: 10px;
    }
    
    .product-card img {
        width: 60px;
        height: 60px;
    }
    
    .restaurant-table {
        width: 60px;
        height: 60px;
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .login-card {
        padding: 20px;
    }
    
    .login-logo h1 {
        font-size: 2rem;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .quantity-control {
        width: 100%;
        justify-content: space-between;
    }
}

/* Responsive Design - Very Small Devices (up to 360px) */
@media (max-width: 360px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .restaurant-table {
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }
    
    .top-header {
        padding: 0 10px;
    }
    
    .content-wrapper {
        padding: 8px;
    }
}

/* Serial Number Badge - Developed by Majedul Islam */
.serial-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #e8f5e9;
    color: #4CAF50;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.serial-number-blue {
    background: #e3f2fd;
    color: #1565C0;
}

.serial-number-orange {
    background: #fff3e0;
    color: #e65100;
}

.serial-number-red {
    background: #ffebee;
    color: #c62828;
}

.table-serial-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #2c3e50;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.product-serial-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    background: #2196F3;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}