/* Custom Styles for Restaurant Order System */

/* Color Scheme (NO PURPLE) */
:root {
    /* Light Mode Colors */
    --color-primary: #3b82f6; /* blue-500 */
    --color-primary-dark: #2563eb; /* blue-600 */
    --color-success: #10b981; /* green-500 */
    --color-warning: #f59e0b; /* amber-500 */
    --color-danger: #ef4444; /* red-500 */
    --color-info: #06b6d4; /* cyan-500 */
    --color-orange: #fcb700; /* cyan-500 */
    --color-purple: #422ad5; /* cyan-500 */

    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6; /* gray-100 */
    --text-primary: #111827; /* gray-900 */
    --text-secondary: #6b7280; /* gray-500 */
    --border-color: #e5e7eb; /* gray-200 */
}

/* Dark Mode Colors */
.dark {
    --color-primary: #60a5fa; /* blue-400 */
    --color-primary-dark: #3b82f6; /* blue-500 */
    --color-success: #34d399; /* green-400 */
    --color-warning: #fbbf24; /* amber-400 */
    --color-danger: #f87171; /* red-400 */
    --color-info: #22d3ee; /* cyan-400 */
    --color-orange: #fcb700; /* cyan-500 */
    --color-purple: #422ad5; /* cyan-500 */

    --bg-primary: #111827; /* gray-900 */
    --bg-secondary: #1f2937; /* gray-800 */
    --text-primary: #f9fafb; /* gray-50 */
    --text-secondary: #9ca3af; /* gray-400 */
    --border-color: #374151; /* gray-700 */
}

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Utility Classes */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.text-dark {
    color: #111827 !important;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

.btn-success {
    background-color: var(--color-success);
    color: white;
}

.btn-warning {
    background-color: var(--color-warning);
    color: white;
}

.btn-purple {
    background-color: var(--color-purple);
    color: white;
}

.btn-orange {
    background-color: var(--color-orange);
    color: white;
}

.btn-danger {
    background-color: var(--color-danger);
    color: white;
}

/* Card */
.card {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.875rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .card {
        border-radius: 1rem;
        padding: 1rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success { border-left: 4px solid var(--color-success); }
.toast.error { border-left: 4px solid var(--color-danger); }
.toast.warning { border-left: 4px solid var(--color-warning); }
.toast.info { border-left: 4px solid var(--color-info); }

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background-color: var(--color-primary); color: white; }
.badge-success { background-color: var(--color-success); color: white; }
.badge-warning { background-color: var(--color-warning); color: white; }
.badge-danger { background-color: var(--color-danger); color: white; }

/* Menu Item Card */
.menu-item-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.menu-item-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

.menu-item-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 0.75rem;
    background-color: var(--bg-secondary);
}

@media (min-width: 768px) {
    .menu-item-image {
        height: 180px;
    }
}

@media (min-width: 1024px) {
    .menu-item-image {
        height: 200px;
    }
}

/* Floating Cart Button */
.floating-cart {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 0;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.floating-cart:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.5);
}

.floating-cart:active {
    transform: scale(0.95);
}

.floating-cart .badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border: 3px solid white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@media (min-width: 768px) {
    .floating-cart {
        bottom: 20px;
        right: 20px;
        width: 64px;
        height: 64px;
    }

    .floating-cart .badge-count {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 0.75rem;
    animation: fadeIn 0.2s ease-out;
}

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

.modal-overlay:not(.hidden) {
    display: flex;
}

.modal-content {
    background-color: var(--bg-primary);
    border-radius: 1rem;
    max-width: 600px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (min-width: 768px) {
    .modal-overlay {
        padding: 1rem;
    }

    .modal-content {
        border-radius: 1.5rem;
        max-height: 90vh;
    }
}

/* Table */
.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: var(--bg-secondary);
}

/* Sidebar */
.sidebar {
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-color);
}

.sidebar-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--bg-secondary);
    color: var(--color-primary);
}

.sidebar-link.active {
    background-color: #3b82f6;
    color: white;
    font-weight: 600;
    border-left-color: #1e40af;
}

.dark .sidebar-link.active {
    background-color: #2563eb;
    border-left-color: #60a5fa;
}

/* Additional Button Styles */
.btn-secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: var(--bg-secondary);
}

/* Form Input */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    ring: 2px;
    ring-color: var(--color-primary);
}

/* Tab Button */
.tab-btn {
    padding: 0.5rem 1.5rem;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Status Badges */
.status-pending { background-color: #fbbf24; color: #78350f; }
.status-confirmed { background-color: #34d399; color: #064e3b; }
.status-completed { background-color: #60a5fa; color: #1e3a8a; }
.status-cancelled { background-color: #f87171; color: #7f1d1d; }
.status-unpaid { background-color: #fbbf24; color: #78350f; }
.status-paid { background-color: #34d399; color: #064e3b; }

/* Dark mode status badges */
.dark .status-pending { background-color: #92400e; color: #fef3c7; }
.dark .status-confirmed { background-color: #065f46; color: #d1fae5; }
.dark .status-completed { background-color: #1e40af; color: #dbeafe; }
.dark .status-cancelled { background-color: #991b1b; color: #fee2e2; }
.dark .status-unpaid { background-color: #92400e; color: #fef3c7; }
.dark .status-paid { background-color: #065f46; color: #d1fae5; }

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .no-print {
        display: none !important;
    }

    .card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* Scrollbar Styling */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
}

.dark .scrollbar-thin {
    scrollbar-color: #475569 transparent;
}

.dark .scrollbar-thin::-webkit-scrollbar-thumb {
    background-color: #475569;
}

/* Line Clamp Utilities */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.5rem;
    }

    /* Improve touch targets on mobile */
    button {
        min-height: 44px;
    }

    /* Better spacing for mobile */
    body {
        font-size: 14px;
    }
}

/* Enhanced button hover effects */
button {
    -webkit-tap-highlight-color: transparent;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Smooth Transitions */
* {
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* Only apply background transition to specific elements, not buttons with gradients */
body, .card, .sidebar, .modal-content, .form-input {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
