* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2196F3;
    --success-color: #4CAF50;
    --warning-color: #FFC107;
    --danger-color: #F44336;
    --purple-color: #9C27B0;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #757575;
    --text-dark: #212121;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --border-radius: 8px;
    --bottom-nav-height: 70px;
    --header-height: 60px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-gray);
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 193, 7, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(33, 150, 243, 0.05) 0%, transparent 50%);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: var(--bottom-nav-height);
    min-height: 100vh;
}

/* Paper texture effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    z-index: -1;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,.1) 2px,
            rgba(0,0,0,.1) 4px
        );
}

/* Header */
.app-header {
    background: var(--white);
    padding: 15px 20px;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header h1 {
    color: var(--primary-color);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Main Content */
.app-main {
    padding-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

/* Sections */
.section {
    display: none;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section.active {
    display: block;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    color: var(--text-dark);
    font-size: 1.8rem;
    font-weight: 600;
}

/* Welcome Card */
.welcome-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 20px;
}

.welcome-card h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.welcome-card p {
    color: var(--dark-gray);
    margin-bottom: 25px;
    font-size: 1.1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

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

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

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
    background: var(--medium-gray);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: var(--dark-gray);
    color: var(--white);
}

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

.btn-success:hover {
    background: #388E3C;
}

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

.btn-danger:hover {
    background: #D32F2F;
}

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

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

/* Grids */
.menus-grid, .qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Menu Cards */
.menu-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.menu-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.menu-card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 5px;
}

.menu-card .restaurant-name {
    color: var(--dark-gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.menu-card .description {
    color: var(--dark-gray);
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.menu-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.menu-card-actions .btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.9rem;
    padding: 8px 12px;
}

/* QR Code Cards */
.qr-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.qr-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.qr-code-container {
    margin: 20px 0;
    padding: 15px;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.qr-code-container canvas {
    max-width: 100%;
    height: auto;
}

.qr-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    padding: 20px 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-gray);
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: var(--light-gray);
}

.modal-body {
    padding: 20px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Items Management */
.items-header {
    margin-bottom: 20px;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.item-card {
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.item-info {
    flex: 1;
}

.item-info h4 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.item-info .item-description {
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.item-info .item-price {
    font-weight: bold;
    color: var(--success-color);
}

.item-info .item-category {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-top: 5px;
}

.item-actions {
    display: flex;
    gap: 8px;
}

.item-actions .btn {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Analytics */
.analytics-dashboard {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.analytics-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.analytics-card {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.analytics-card h3 {
    color: var(--dark-gray);
    font-size: 1rem;
    margin-bottom: 10px;
}

.analytics-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.analytics-text {
    display: block;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--success-color);
}

.analytics-chart {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.analytics-chart h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.analytics-chart canvas {
    max-width: 100%;
    height: auto;
}

.recent-activity {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.recent-activity h3 {
    margin-bottom: 15px;
    color: var(--text-dark);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-item {
    padding: 10px;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.activity-time {
    color: var(--dark-gray);
    font-size: 0.8rem;
}

/* Settings */
.settings-groups {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.settings-group {
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.settings-group h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.settings-group select {
    max-width: 200px;
}

.theme-options {
    display: flex;
    gap: 15px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.data-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* FAQ */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: var(--light-gray);
}

.faq-question[aria-expanded="true"] {
    background: var(--primary-color);
    color: var(--white);
}

.faq-icon {
    font-size: 1.2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer.show {
    padding: 20px;
    max-height: 500px;
}

.faq-answer p {
    margin-bottom: 10px;
    color: var(--dark-gray);
}

/* Menu Viewer */
.menu-viewer-section {
    display: none;
    padding: 0;
}

.menu-viewer-section.active {
    display: block;
}

.menu-viewer-content {
    background: var(--white);
    min-height: calc(100vh - var(--header-height));
}

.menu-viewer-header {
    background: linear-gradient(135deg, var(--primary-color), var(--purple-color));
    color: var(--white);
    padding: 30px 20px;
    text-align: center;
}

.menu-viewer-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.menu-viewer-header .restaurant-name {
    font-size: 1.2rem;
    opacity: 0.9;
}

.menu-categories {
    padding: 20px;
}

.category-section {
    margin-bottom: 30px;
}

.category-title {
    background: var(--light-gray);
    padding: 15px 20px;
    margin: 0 -20px 15px -20px;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.menu-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--medium-gray);
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    object-fit: cover;
    flex-shrink: 0;
}

.menu-item-info {
    flex: 1;
}

.menu-item-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.menu-item-description {
    color: var(--dark-gray);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 8px;
}

.menu-item-price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--success-color);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    height: var(--bottom-nav-height);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--dark-gray);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    min-width: 60px;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.1);
}

.nav-item:hover {
    color: var(--primary-color);
    background: rgba(33, 150, 243, 0.05);
}

/* Footer */
footer {
    background: var(--white);
    padding: 20px;
    text-align: center;
    color: var(--dark-gray);
    font-size: 0.9rem;
    border-top: 1px solid var(--medium-gray);
    margin-top: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header h1 {
        font-size: 1.3rem;
    }
    
    .section {
        padding: 15px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .menus-grid, .qr-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .analytics-cards {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .menu-card-actions {
        flex-direction: column;
    }
    
    .menu-card-actions .btn {
        min-width: auto;
    }
    
    .data-actions {
        flex-direction: column;
    }
    
    .item-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .item-actions {
        justify-content: center;
        margin-top: 10px;
    }
    
    .nav-item span {
        font-size: 0.6rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .welcome-card {
        padding: 20px;
    }
    
    .welcome-card h2 {
        font-size: 1.3rem;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .faq-question {
        font-size: 1rem;
        padding: 15px;
    }
    
    .menu-viewer-header {
        padding: 20px 15px;
    }
    
    .menu-viewer-header h1 {
        font-size: 1.5rem;
    }
    
    .menu-categories {
        padding: 15px;
    }
    
    .category-title {
        margin: 0 -15px 15px -15px;
        font-size: 1.1rem;
    }
}

/* Loading States */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--dark-gray);
}

.loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--medium-gray);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--dark-gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 10px;
    color: var(--text-dark);
}

.empty-state p {
    margin-bottom: 20px;
}

/* Success/Error Messages */
.message {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.message.error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.message.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #F57C00;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* Dark theme support (future enhancement) */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1e1e1e;
        --light-gray: #2d2d2d;
        --medium-gray: #404040;
        --dark-gray: #b0b0b0;
        --text-dark: #ffffff;
    }
}
