/* Restaurant POS Layout Styles */

:root {
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --primary-color: #0d6efd;
    --sidebar-bg: #1e293b;
    --sidebar-text: #cbd5e1;
    --sidebar-hover: #334155;
    --sidebar-active: #0ea5e9;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --sidebar-bg: #0f172a;
    --sidebar-text: #cbd5e1;
    --sidebar-hover: #1e293b;
    --sidebar-active: #ee8135;
}

/* Body and Main Layout */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

/* Dark Mode Body */
[data-theme="dark"] body {
    background-color: #0f172a;
    color: #f1f5f9;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .sidebar {
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.3);
    border-right: 1px solid #1e293b;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

[data-theme="dark"] .sidebar-header {
    border-bottom-color: #1e293b;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

.sidebar-logo i {
    font-size: 1.5rem;
    color: var(--sidebar-active);
}

[data-theme="dark"] .sidebar-logo i {
    color: #ee8135;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--sidebar-text);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    display: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

[data-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 0.25rem 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

[data-theme="dark"] .nav-link:hover {
    background: #1e293b;
    color: #ffffff;
}

.nav-link.active,
.nav-link:active {
    background: var(--sidebar-active);
    color: #fff;
}

[data-theme="dark"] .nav-link.active,
[data-theme="dark"] .nav-link:active {
    background: #ee8135;
    color: #ffffff;
}

.nav-link i {
    font-size: 1.125rem;
    width: 20px;
    text-align: center;
}

/* Submenu Styles */
.has-submenu > .nav-link {
    position: relative;
}

.submenu-chevron {
    margin-left: auto;
    font-size: 0.875rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.has-submenu.open > .nav-link .submenu-chevron {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 0;
}

.has-submenu.open .submenu {
    max-height: 500px;
    opacity: 1;
}

.submenu .nav-item {
    margin: 0.125rem 0;
}

.submenu .nav-link {
    padding: 0.625rem 1rem 0.625rem 2.75rem;
    font-size: 0.875rem;
}

.submenu .nav-link i {
    font-size: 1rem;
}

.submenu .nav-link:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--sidebar-active);
}

[data-theme="dark"] .submenu .nav-link:hover {
    background: rgba(238, 129, 53, 0.1);
    color: #ee8135;
}

/* Nav Divider */
.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0.75rem 1rem;
}

[data-theme="dark"] .nav-divider {
    background: rgba(255, 255, 255, 0.08);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar-footer {
    border-top-color: #1e293b;
}

.btn-logout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
    font-weight: 500;
}

.btn-logout:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

[data-theme="dark"] .btn-logout {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

[data-theme="dark"] .btn-logout:hover {
    background: #ef4444;
    color: #fff;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

[data-theme="dark"] .main-content {
    background: #0f172a;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

[data-theme="dark"] .topbar {
    background: #1e293b;
    border-bottom-color: #334155;
}

.sidebar-toggle-mobile {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    color: #64748b;
    display: none;
}

[data-theme="dark"] .sidebar-toggle-mobile {
    color: #cbd5e1;
}

.topbar-title {
    flex: 1;
}

.topbar-title h4 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

[data-theme="dark"] .topbar-title h4 {
    color: #f1f5f9;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f1f5f9;
    border-radius: 2rem;
    color: #475569;
}

[data-theme="dark"] .topbar-user {
    background: #334155;
    color: #cbd5e1;
}

.topbar-user i {
    font-size: 1.5rem;
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    padding: 1.5rem;
}

#contentContainer {
    max-width: 1400px;
    margin: 0 auto;
}

/* Footer */
.app-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

[data-theme="dark"] .app-footer {
    background: #1e293b;
    border-top-color: #334155;
}

[data-theme="dark"] .app-footer .text-muted {
    color: #94a3b8 !important;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-toggle-mobile {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .topbar {
        padding: 0 1rem;
    }

    .content-wrapper {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    .topbar-title h4 {
        font-size: 1rem;
    }

    .topbar-user span {
        display: none;
    }

    .content-wrapper {
        padding: 0.75rem;
    }
}

/* Active Link Highlighting */
.nav-link[href*="/Dashboard/Index"] {
    position: relative;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 70%;
    background: var(--sidebar-active);
    border-radius: 0 3px 3px 0;
}

[data-theme="dark"] .nav-link.active::before {
    background: #ee8135;
}
