/* ========================================
   QUINTAL BURGERS - PDV SYSTEM
   Menu & Dashboard Styles
   ======================================== */

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, var(--secondary) 0%, var(--bg-dark) 100%);
    background: -webkit-linear-gradient(180deg, var(--secondary) 0%, var(--bg-dark) 100%);
    border-right: 1px solid var(--border-color);
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    z-index: 100;
    -webkit-transition: width var(--transition-normal);
    transition: width var(--transition-normal);
    -webkit-overflow-scrolling: touch;
}

/* Brand */
.brand {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
    gap: 8px;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 100%;
    max-width: 180px;
    height: auto;
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    -webkit-justify-content: center;
    justify-content: center;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

/* Logo Image com Animação */
.brand-logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    border-radius: var(--radius-lg);
    -webkit-border-radius: var(--radius-lg);
    object-fit: contain;
    -webkit-animation: logoGlow 3s ease-in-out infinite;
    animation: logoGlow 3s ease-in-out infinite;
    -webkit-filter: drop-shadow(0 0 8px rgba(232, 93, 4, 0.5));
    filter: drop-shadow(0 0 8px rgba(232, 93, 4, 0.5));
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

/* Animação Glow Pulsante */
@-webkit-keyframes logoGlow {
    0%, 100% {
        -webkit-filter: drop-shadow(0 0 5px rgba(232, 93, 4, 0.4));
        filter: drop-shadow(0 0 5px rgba(232, 93, 4, 0.4));
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        -webkit-filter: drop-shadow(0 0 15px rgba(232, 93, 4, 0.8)) drop-shadow(0 0 25px rgba(232, 93, 4, 0.3));
        filter: drop-shadow(0 0 15px rgba(232, 93, 4, 0.8)) drop-shadow(0 0 25px rgba(232, 93, 4, 0.3));
        -webkit-transform: scale(1.02);
        transform: scale(1.02);
    }
}

@keyframes logoGlow {
    0%, 100% {
        -webkit-filter: drop-shadow(0 0 5px rgba(232, 93, 4, 0.4));
        filter: drop-shadow(0 0 5px rgba(232, 93, 4, 0.4));
        -webkit-transform: scale(1);
        transform: scale(1);
    }
    50% {
        -webkit-filter: drop-shadow(0 0 15px rgba(232, 93, 4, 0.8)) drop-shadow(0 0 25px rgba(232, 93, 4, 0.3));
        filter: drop-shadow(0 0 15px rgba(232, 93, 4, 0.8)) drop-shadow(0 0 25px rgba(232, 93, 4, 0.3));
        -webkit-transform: scale(1.02);
        transform: scale(1.02);
    }
}

/* Efeito hover na logo */
.brand-logo:hover {
    -webkit-animation: logoBounce 0.6s ease;
    animation: logoBounce 0.6s ease;
    cursor: pointer;
}

@-webkit-keyframes logoBounce {
    0%, 100% { -webkit-transform: scale(1) rotate(0deg); transform: scale(1) rotate(0deg); }
    25% { -webkit-transform: scale(1.1) rotate(-3deg); transform: scale(1.1) rotate(-3deg); }
    50% { -webkit-transform: scale(0.95) rotate(3deg); transform: scale(0.95) rotate(3deg); }
    75% { -webkit-transform: scale(1.05) rotate(-1deg); transform: scale(1.05) rotate(-1deg); }
}

@keyframes logoBounce {
    0%, 100% { -webkit-transform: scale(1) rotate(0deg); transform: scale(1) rotate(0deg); }
    25% { -webkit-transform: scale(1.1) rotate(-3deg); transform: scale(1.1) rotate(-3deg); }
    50% { -webkit-transform: scale(0.95) rotate(3deg); transform: scale(0.95) rotate(3deg); }
    75% { -webkit-transform: scale(1.05) rotate(-1deg); transform: scale(1.05) rotate(-1deg); }
}

.brand-text {
    display: none; /* Ocultar texto, só logo */
}

.brand-name {
    display: none;
}

.brand-sub {
    display: none;
}

.firebase-status {
    font-size: 0.65rem;
    color: #ff9800;
    margin-top: 3px;
}

/* Navigation */
.nav-menu {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: var(--radius-sm);
    transition: height var(--transition-fast);
}

.nav-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-item:hover::before {
    height: 60%;
}

.nav-item.active {
    background: rgba(232, 93, 4, 0.15);
    color: var(--primary);
}

.nav-item.active::before {
    height: 70%;
}

.nav-icon {
    width: 24px;
    font-size: 1.2rem;
    text-align: center;
}

.nav-text {
    font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.clock {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--text-primary);
}

.date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title h1 {
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.page-title p {
    font-size: 0.9rem;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-input);
    border-radius: var(--radius-xl);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-indicator.online .status-dot {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

/* Dashboard Content */
.dashboard-content {
    padding: var(--spacing-xl);
    flex: 1;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    border-radius: var(--radius-lg);
}

.stat-vendas .stat-icon {
    background: rgba(39, 174, 96, 0.15);
}

.stat-pedidos .stat-icon {
    background: rgba(52, 152, 219, 0.15);
}

.stat-comandas .stat-icon {
    background: rgba(243, 156, 18, 0.15);
}

.stat-ticket .stat-icon {
    background: rgba(232, 93, 4, 0.15);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Section Title */
.section-title {
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
}

/* Quick Actions */
.quick-actions {
    margin-bottom: var(--spacing-xl);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.action-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.action-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.action-card:hover::before {
    transform: scaleX(1);
}

.action-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.action-info {
    flex: 1;
}

.action-info h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.action-info p {
    font-size: 0.85rem;
}

.action-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.action-card:hover .action-arrow {
    color: var(--primary);
    transform: translateX(5px);
}

/* Recent Activity */
.activity-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    transition: background var(--transition-fast);
}

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

.activity-item:hover {
    background: var(--bg-card-hover);
}

.activity-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--bg-input);
    border-radius: var(--radius-md);
}

.activity-info {
    flex: 1;
}

.activity-info strong {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
}

.activity-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.activity-empty {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
}

.activity-empty .empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid,
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .brand-text {
        display: none;
    }
    
    .brand {
        justify-content: center;
        padding: var(--spacing-sm);
    }
    
    .brand-icon {
        max-width: 60px;
    }
    
    .brand-logo {
        max-width: 60px;
    }
    
    .nav-text {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
    
    .stats-grid,
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
}

/* ========================================
   MOBILE OVERRIDE - Esconder sidebar completamente
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        position: absolute !important;
        left: -9999px !important;
        top: -9999px !important;
        pointer-events: none !important;
        overflow: hidden !important;
        z-index: -1 !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .app-container {
        display: block !important;
        grid-template-columns: 1fr !important;
    }
}

/* ========================================
   TEMA CLARO - SOBRESCREVER GRADIENTES
   ======================================== */
html.light-theme .sidebar,
body.light-theme .sidebar,
.light-theme .sidebar,
[data-theme="light"] .sidebar {
    background: #FFFFFF !important;
    background-image: none !important;
}

html.light-theme .brand,
body.light-theme .brand,
.light-theme .brand,
[data-theme="light"] .brand {
    background: #E85D04 !important;
    background-image: none !important;
}

html.light-theme .brand-name,
body.light-theme .brand-name,
.light-theme .brand-name,
[data-theme="light"] .brand-name {
    color: #FFFFFF !important;
}

html.light-theme .brand-sub,
body.light-theme .brand-sub,
.light-theme .brand-sub,
[data-theme="light"] .brand-sub {
    color: rgba(255, 255, 255, 0.9) !important;
}

html.light-theme .sidebar-footer,
body.light-theme .sidebar-footer,
.light-theme .sidebar-footer,
[data-theme="light"] .sidebar-footer {
    background: #FFFFFF !important;
}

html.light-theme .nav-item,
body.light-theme .nav-item,
.light-theme .nav-item,
[data-theme="light"] .nav-item {
    color: #4B5563 !important;
}

html.light-theme .nav-item:hover,
body.light-theme .nav-item:hover,
.light-theme .nav-item:hover,
[data-theme="light"] .nav-item:hover {
    background: #F3F4F6 !important;
    color: #E85D04 !important;
}

html.light-theme .nav-item.active,
body.light-theme .nav-item.active,
.light-theme .nav-item.active,
[data-theme="light"] .nav-item.active {
    background: #E85D04 !important;
    color: #FFFFFF !important;
}

html.light-theme .nav-item i,
body.light-theme .nav-item i,
.light-theme .nav-item i,
[data-theme="light"] .nav-item i {
    color: #6B7280 !important;
}

html.light-theme .nav-item:hover i,
body.light-theme .nav-item:hover i,
.light-theme .nav-item:hover i,
[data-theme="light"] .nav-item:hover i {
    color: #E85D04 !important;
}

html.light-theme .nav-item.active i,
body.light-theme .nav-item.active i,
.light-theme .nav-item.active i,
[data-theme="light"] .nav-item.active i {
    color: #FFFFFF !important;
}

html.light-theme .clock,
body.light-theme .clock,
.light-theme .clock,
[data-theme="light"] .clock {
    color: #1F2937 !important;
    background: #F3F4F6 !important;
}

/* Logo invertida no tema claro (fundo laranja) */
html.light-theme .brand-logo,
body.light-theme .brand-logo,
.light-theme .brand-logo,
[data-theme="light"] .brand-logo {
    filter: brightness(0) invert(1) !important;
}
