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

:root {
    /* Modern cyan-inspired color palette */
    --background: hsl(189, 15%, 98%);
    --foreground: hsl(189, 15%, 15%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(189, 15%, 15%);
    --primary: hsl(189, 100%, 42%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(189, 100%, 35%);
    --secondary-foreground: hsl(0, 0%, 100%);
    --muted: hsl(189, 30%, 95%);
    --muted-foreground: hsl(189, 20%, 45%);
    --accent: hsl(9, 100%, 62%);
    --accent-foreground: hsl(0, 0%, 100%);
    --destructive: hsl(0, 84.2%, 60.2%);
    --destructive-foreground: hsl(210, 40%, 98%);
    --border: hsl(189, 30%, 82%);
    --input: hsl(189, 30%, 82%);
    --ring: hsl(189, 100%, 42%);
    --radius: 0.5rem;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary), var(--secondary));
    --gradient-warm: linear-gradient(135deg, var(--accent), hsl(25, 95%, 53%));
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-card: 0 8px 20px 0 rgba(0, 191, 215, 0.1);
    --shadow-warm: 0 8px 20px 0 rgba(255, 99, 71, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
}

/* Hero Section */
.hero {
    background: var(--gradient-primary);
    color: var(--primary-foreground);
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="2" fill="white" fill-opacity="0.1"/></svg>') repeat;
    background-size: 50px 50px;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-description {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--muted-foreground);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-button:hover:not(:disabled) {
    color: var(--foreground);
    background-color: var(--muted);
}

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

.tab-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tab Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--card-foreground);
    flex: 1;
}

.card-description {
    color: var(--muted-foreground);
    margin-top: 0.5rem;
    flex-basis: 100%;
}

.card-content {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--foreground);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

input, textarea, select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background: var(--background);
    color: var(--foreground);
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--ring);
    box-shadow: 0 0 0 2px rgba(0, 191, 215, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--primary-foreground);
    box-shadow: var(--shadow-warm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

.btn-secondary:hover:not(:disabled) {
    background: hsl(189, 100%, 30%);
}

.btn-outline {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
    background: var(--muted);
}

.btn-ghost {
    background: transparent;
    color: var(--muted-foreground);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--muted);
    color: var(--foreground);
}

/* Checkbox Styling */
.checkbox-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0 !important;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    opacity: 0;
    position: absolute;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Add Item Form */
.add-item-form {
    background: var(--muted);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.add-item-form.hidden {
    display: none;
}

/* Menu Items */
.menu-items-grid {
    display: grid;
    gap: 1rem;
}

.menu-category {
    margin-bottom: 2rem;
}

.category-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.menu-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.menu-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.menu-item-name {
    font-weight: 600;
    color: var(--foreground);
}

.menu-item-price {
    font-weight: 600;
    color: var(--primary);
}

.menu-item-description {
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.menu-item-badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-vegetarian {
    background: hsl(120, 50%, 90%);
    color: hsl(120, 50%, 30%);
}

.badge-spicy {
    background: hsl(0, 70%, 90%);
    color: hsl(0, 70%, 40%);
}

.menu-item-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted-foreground);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Menu Summary */
.menu-summary {
    background: var(--muted);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.summary-item {
    text-align: center;
}

.summary-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.summary-label {
    color: var(--muted-foreground);
    font-size: 0.875rem;
}

/* QR Code Result */
.qr-result {
    text-align: center;
    margin-top: 2rem;
}

.qr-result.hidden {
    display: none;
}

.qr-image-container {
    margin-bottom: 2rem;
    display: inline-block;
    padding: 2rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.qr-image-container img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

.qr-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 400px;
}

.toast {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toast.success {
    border-left: 4px solid hsl(120, 50%, 50%);
}

.toast.error {
    border-left: 4px solid var(--destructive);
}

.toast.info {
    border-left: 4px solid var(--primary);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .card-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        text-align: left;
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .tab-button.active {
        border-left-color: var(--primary);
        border-bottom-color: transparent;
    }
    
    .qr-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --background: hsl(189, 15%, 8%);
        --foreground: hsl(189, 15%, 95%);
        --card: hsl(189, 15%, 12%);
        --card-foreground: hsl(189, 15%, 95%);
        --muted: hsl(189, 15%, 18%);
        --muted-foreground: hsl(189, 20%, 65%);
        --border: hsl(189, 15%, 25%);
        --input: hsl(189, 15%, 25%);
    }
}