/**
 * Restaurant Dashboard Specific Styles
 * Extends dashboard.css with restaurant-specific components
 */

/* Restaurant Header Bar */
.restaurant-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(249, 115, 22, 0.1));
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    margin-bottom: 1rem;
}

.restaurant-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.restaurant-icon {
    font-size: 2rem;
}

.restaurant-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(90deg, #ef4444, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.restaurant-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.restaurant-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.restaurant-status-badge.active {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.restaurant-status-badge.idle {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Stats Row */
.restaurant-stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-surface, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--color-primary, #3b82f6);
}

.stat-card.highlight {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
}

.stat-card .stat-content {
    display: flex;
    flex-direction: column;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Restaurant Section */
.restaurant-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-surface, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

/* Orders Kanban */
.orders-kanban {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    min-height: 300px;
}

.kanban-column {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.column-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.column-header.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.column-header.preparing {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.column-header.ready {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.column-body {
    padding: 0.75rem;
    min-height: 200px;
}

.empty-column {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 2rem 1rem;
}

/* Order Cards */
.order-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.order-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.order-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.order-id {
    font-weight: 700;
    font-size: 0.9rem;
    color: #00d2ff;
}

.order-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-card-customer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-card-customer strong {
    color: var(--text-primary);
}

.order-fulfillment {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-card-items {
    margin-bottom: 0.5rem;
}

.order-card-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

.order-card-item .item-qty {
    color: #f59e0b;
    font-weight: 600;
    min-width: 24px;
}

.order-card-item .item-name {
    flex: 1;
    color: var(--text-secondary);
}

.order-card-item .item-price {
    color: var(--text-muted);
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.order-total {
    font-weight: 700;
    color: #22c55e;
    font-size: 0.9rem;
}

.order-card-footer button {
    padding: 0.4rem 0.75rem;
    border: none;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-start {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.btn-ready {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.btn-ready:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.btn-complete {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.btn-complete:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Tools Grid */
.restaurant-tools {
    margin-top: 2rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--color-surface, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.tool-card:hover {
    border-color: var(--color-primary, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tool-icon {
    font-size: 2rem;
}

.tool-content {
    display: flex;
    flex-direction: column;
}

.tool-name {
    font-weight: 600;
    font-size: 1rem;
}

.tool-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =============================================================================
   Tab Navigation for Menu/Kitchen switching
   ============================================================================= */

.restaurant-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--color-primary, #3b82f6);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.tab-icon {
    font-size: 1.25rem;
}

.tab-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.tab-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0.8;
}

.tab-btn.active .tab-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* =============================================================================
   Menu Grid Section
   ============================================================================= */

.menu-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    background: transparent;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    border-color: var(--color-primary, #3b82f6);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--color-primary, #3b82f6);
    border-color: var(--color-primary, #3b82f6);
    color: white;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.menu-item-card {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.2s;
}

.menu-item-card:hover {
    border-color: var(--color-primary, #3b82f6);
    transform: translateY(-2px);
}

.menu-item-card.unavailable {
    opacity: 0.5;
}

.menu-item-card .item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.menu-item-card .item-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.menu-item-card .item-price {
    font-weight: 700;
    color: #22c55e;
}

.menu-item-card .item-category {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.menu-item-card .item-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.menu-item-card .item-unavailable {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 0.7rem;
    border-radius: 4px;
    text-align: center;
}

/* =============================================================================
   Live Order Builder
   ============================================================================= */

.live-order-builder {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 10px;
}

.order-builder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.order-builder-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.order-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #22c55e;
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.order-item-name {
    flex: 1;
    font-weight: 500;
}

.order-item-qty {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.order-item-price {
    font-weight: 600;
    color: #22c55e;
}

.empty-order {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 1rem;
}

/* Loading and Error States */
.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.error-state {
    color: #ef4444;
}

/* =============================================================================
   Menu Popup Modal (Full Screen)
   ============================================================================= */

.menu-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.menu-popup-overlay.visible {
    display: flex;
}

.menu-popup {
    background: var(--color-bg-primary, #1a1a2e);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.menu-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(249, 115, 22, 0.15));
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.menu-popup-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.menu-popup-title-icon {
    font-size: 1.5rem;
}

.menu-popup-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-popup-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.menu-popup-message {
    padding: 0.75rem 1.5rem;
    background: rgba(34, 197, 94, 0.1);
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    font-size: 0.9rem;
    display: none;
}

.menu-popup-message.visible {
    display: block;
}

.menu-popup-categories {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    overflow-x: auto;
    flex-shrink: 0;
}

.menu-popup-category-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.menu-popup-category-btn:hover {
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--text-primary);
}

.menu-popup-category-btn.active {
    background: linear-gradient(135deg, #ef4444, #f97316);
    border-color: transparent;
    color: white;
}

.menu-popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.menu-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.menu-popup-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s;
}

.menu-popup-item:hover {
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.menu-popup-item.unavailable {
    opacity: 0.5;
    pointer-events: none;
}

.menu-popup-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.menu-popup-item-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.menu-popup-item-price {
    font-weight: 700;
    color: #22c55e;
    font-size: 1rem;
}

.menu-popup-item-category {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.menu-popup-item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.menu-popup-item-unavailable {
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-size: 0.7rem;
    border-radius: 4px;
    text-align: center;
}

/* =============================================================================
   Order Summary Popup
   ============================================================================= */

.order-summary-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.order-summary-overlay.visible {
    display: flex;
}

.order-summary-popup {
    background: var(--color-bg-primary, #1a1a2e);
    border: 2px solid rgba(34, 197, 94, 0.4);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(34, 197, 94, 0.3);
    position: relative;
}

.order-summary-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.order-summary-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.order-summary-header {
    text-align: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.2));
    border-bottom: 1px solid rgba(34, 197, 94, 0.3);
}

.order-summary-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.order-summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
    margin: 0;
}

.order-summary-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.order-summary-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.order-summary-section {
    margin-bottom: 1.5rem;
}

.order-summary-section:last-child {
    margin-bottom: 0;
}

.order-summary-section-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-summary-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.order-summary-item-name {
    font-weight: 500;
}

.order-summary-item-qty {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.order-summary-item-price {
    font-weight: 600;
    color: #22c55e;
}

.order-summary-customer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-summary-customer-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.order-summary-customer-label {
    color: var(--text-muted);
}

.order-summary-customer-value {
    font-weight: 500;
}

.order-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
    border-radius: 12px;
    margin-top: 1rem;
}

.order-summary-total-label {
    font-size: 1rem;
    font-weight: 600;
}

.order-summary-total-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
}

.order-summary-footer {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
}

.order-summary-closing {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.order-summary-countdown {
    font-weight: 600;
    color: #22c55e;
}

/* Responsive */
@media (max-width: 768px) {
    .restaurant-header-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .restaurant-stats-row {
        flex-direction: column;
    }

    .orders-kanban {
        grid-template-columns: 1fr;
    }

    .restaurant-tabs {
        flex-direction: column;
    }

    .menu-filters {
        justify-content: center;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile popup adjustments */
    .menu-popup {
        max-height: 95vh;
        border-radius: 12px;
    }

    .menu-popup-header {
        padding: 1rem;
    }

    .menu-popup-title {
        font-size: 1rem;
    }

    .menu-popup-content {
        padding: 1rem;
    }

    .menu-popup-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .menu-popup-item {
        padding: 0.875rem;
    }

    .order-summary-popup {
        max-height: 95vh;
        border-radius: 12px;
    }

    .order-summary-header {
        padding: 1rem;
    }

    .order-summary-icon {
        font-size: 2.5rem;
    }

    .order-summary-title {
        font-size: 1.25rem;
    }

    .order-summary-content {
        padding: 1rem;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}