/* AdresPos - Main Stylesheet */

:root {
    --primary-color: #3B82F6;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --dark-color: #1F2937;
    --light-color: #F9FAFB;
    --border-color: #E5E7EB;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #F3F4F6;
    color: #1F2937;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2563EB;
}

.btn-success {
    background-color: var(--secondary-color);
    color: white;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-secondary {
    background-color: #6B7280;
    color: white;
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    background-color: #F9FAFB;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #10B981;
}

.alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #EF4444;
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
    border: 1px solid #F59E0B;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 700;
}

.sidebar-menu {
    padding: 1rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: #6B7280;
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: #F3F4F6;
    color: var(--primary-color);
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
}

/* Topbar */
.topbar {
    position: fixed;
    top: 0;
    left: 260px;
    right: 0;
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1.25rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.875rem;
}

.user-role {
    font-size: 0.75rem;
    color: #6B7280;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 2rem;
}

.main-wrapper {
    margin-top: 70px;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tables Grid */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.table-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-card.occupied {
    border-color: var(--danger-color);
    background-color: #FEE2E2;
}

.table-card.available {
    border-color: var(--secondary-color);
    background-color: #D1FAE5;
}

.table-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.product-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
}

.product-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.product-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.125rem;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.category-tab {
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-tab:hover,
.category-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Kanban Board */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.kanban-column {
    background: #F9FAFB;
    border-radius: 0.5rem;
    padding: 1rem;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.kanban-column-title {
    font-weight: 700;
    font-size: 1rem;
}

.kanban-card {
    background: white;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.kanban-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* Payment System */
.payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.payment-method-btn {
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.payment-method-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.payment-method-btn.active {
    border-color: var(--primary-color);
    background: #EFF6FF;
}

.payment-method-btn i {
    font-size: 2rem;
    color: var(--primary-color);
}

.discount-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.discount-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.discount-btn:hover {
    background: var(--warning-color);
    color: white;
    border-color: var(--warning-color);
}

.amount-display {
    background: #F9FAFB;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.amount-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.amount-row:last-child {
    margin-bottom: 0;
    padding-top: 0.75rem;
    border-top: 2px solid var(--border-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-grid.full {
    grid-template-columns: 1fr;
}

/* Cart Section */
.cart-section {
    border-left: 2px solid var(--border-color);
    padding-left: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.cart-items {
    margin-bottom: 1.5rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #F9FAFB;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.cart-item-info {
    flex: 1;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-total {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Kitchen Screen */
.kitchen-board {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.kitchen-column {
    min-width: 350px;
    background: #F9FAFB;
    border-radius: 0.5rem;
    padding: 1rem;
}

.kitchen-card {
    background: white;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.order-timer {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #FEE2E2;
    color: #991B1B;
    border-radius: 0.25rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.order-timer.warning {
    background: #FEF3C7;
    color: #92400E;
}

.order-timer.danger {
    background: #FEE2E2;
    color: #991B1B;
}

/* Status Badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.status-badge.pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge.preparing {
    background: #DBEAFE;
    color: #1E40AF;
}

.status-badge.ready {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.completed {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge.cancelled {
    background: #FEE2E2;
    color: #991B1B;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }
.hidden { display: none; }

/* Responsive - Desktop */
@media (min-width: 769px) {
    .mobile-menu-btn {
        display: none !important;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* Responsive - Tablet & Mobile */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .topbar {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .payment-methods {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .cart-section {
        border-left: none;
        border-top: 2px solid var(--border-color);
        padding-left: 0;
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
