/*
 * Sistema POS Fast Food
 * Diseño Profesional UX/UI
 */

/* ============================================
   VARIABLES CSS - DESIGN SYSTEM
   ============================================ */
:root {
    /* Paleta de colores profesional */
    --primary-color: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #818CF8;
    --secondary-color: #64748B;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;

    /* Grises modernos */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Tipografía */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Bordes */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    background-attachment: fixed;
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   SIDEBAR - MENÚ LATERAL
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-brand i {
    font-size: 2.25rem;
    color: var(--primary-light);
    filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.4));
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.sidebar-brand:hover {
    transform: scale(1.02);
}

.sidebar-brand:hover i {
    transform: rotate(-10deg) scale(1.1);
}

.sidebar-logo {
    width: 180px;
    height: auto;
    object-fit: contain;
    filter: brightness(1.1) drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3));
    transition: all 0.3s ease;
}

.sidebar-brand:hover .sidebar-logo {
    filter: brightness(1.2) drop-shadow(0 4px 12px rgba(255, 255, 255, 0.5));
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-section {
    margin-bottom: 1.5rem;
}

.menu-section-title {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    padding: 1rem 1.5rem 0.5rem;
    margin-bottom: 0.25rem;
    position: relative;
}

.menu-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    right: 1.5rem;
    height: 1px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    opacity: 0.3;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-link i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding-left: 2rem;
}

.sidebar-link.active {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-left: 4px solid var(--primary-light);
}

.sidebar-link.active i {
    color: var(--primary-light);
}

/* ============================================
   TOP NAVBAR
   ============================================ */
.top-navbar {
    position: fixed;
    top: 0;
    left: 280px;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 999;
    transition: all 0.3s ease;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.navbar-right {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    display: none;
    background: var(--gray-100);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    color: var(--gray-700);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.navbar-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

/* User Menu in Top Navbar */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-radius: var(--radius-xl);
    border: 2px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.user-menu:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.user-info-top {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding-right: 0.75rem;
    border-right: 2px solid var(--gray-200);
}

.user-info-top i {
    font-size: 2.25rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.user-menu:hover .user-info-top i {
    color: var(--primary-dark);
    transform: scale(1.1);
}

.user-details-top {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-name-top {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-800);
    line-height: 1.2;
    letter-spacing: -0.2px;
}

.user-role-top {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.btn-logout-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--danger-color) 0%, #DC2626 100%);
    color: white;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-logout-top:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-logout-top:active {
    transform: translateY(0) scale(1);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: 280px;
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    transition: margin-left 0.3s ease;
}

.page-content {
    padding: 2rem;
}


/* ============================================
   CARDS - DISEÑO ELEGANTE
   ============================================ */
.card {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    overflow: hidden;
    border: 1px solid var(--gray-100);
}

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

.card-header {
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-bottom: 2px solid var(--gray-200);
    font-weight: 700;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    color: var(--gray-800);
}

.card-header i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Cards con colores */
.card.border-success {
    border-left: 4px solid var(--success-color) !important;
}

.card.border-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.card.border-danger {
    border-left: 4px solid var(--danger-color) !important;
}

.card.border-info {
    border-left: 4px solid var(--info-color) !important;
}

/* ============================================
   BOTONES - DISEÑO MODERNO
   ============================================ */
.btn {
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--shadow-sm);
    letter-spacing: 0.3px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white !important;
}

.btn-info {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.1rem;
}

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

/* ============================================
   TABLES - DISEÑO LIMPIO
   ============================================ */
.table {
    font-size: 0.9rem;
}

.table thead th {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--gray-700);
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table-hover tbody tr:hover {
    background: var(--gray-50);
    transform: scale(1.01);
    box-shadow: var(--shadow-sm);
}

.table tbody td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
}

.table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* ============================================
   BADGES - DISEÑO ATRACTIVO
   ============================================ */
.badge {
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-md);
    letter-spacing: 0.3px;
    font-size: 0.8rem;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    color: white !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%) !important;
}

/* ============================================
   FORMS - DISEÑO MODERNO
   ============================================ */
.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control,
.form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 0.65rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
    outline: none;
}

.input-group-text {
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-right: none;
    font-weight: 600;
    color: var(--gray-700);
}

.input-group .form-control {
    border-left: none;
}

/* ============================================
   ALERTS - DISEÑO ATRACTIVO
   ============================================ */
.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
}

.alert-success {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border-left-color: var(--success-color);
    color: #065F46;
}

.alert-danger {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border-left-color: var(--danger-color);
    color: #991B1B;
}

.alert-warning {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-left-color: var(--warning-color);
    color: #92400E;
}

.alert-info {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    border-left-color: var(--info-color);
    color: #1E40AF;
}

/* ============================================
   MODALS - DISEÑO ELEGANTE
   ============================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    background: var(--gray-50);
    border-top: 2px solid var(--gray-200);
}

.modal-header.bg-success,
.modal-header.bg-danger,
.modal-header.bg-warning,
.modal-header.bg-primary,
.modal-header.bg-info {
    color: white !important;
}

.btn-close-white {
    filter: brightness(0) invert(1);
}

/* ============================================
   POS - PUNTO DE VENTA
   ============================================ */
.pos-container {
    height: calc(100vh - 120px);
}

.productos-list {
    max-height: 500px;
    overflow-y: auto;
}

.productos-list::-webkit-scrollbar {
    width: 8px;
}

.productos-list::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: var(--radius-lg);
}

.productos-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-lg);
}

.producto-item {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: white;
}

.producto-item:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    border-color: var(--primary-color);
    color: white;
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.carrito-item {
    border-bottom: 2px solid var(--gray-200);
    padding: 1rem 0;
    transition: all 0.2s ease;
}

.carrito-item:hover {
    background: var(--gray-50);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius-md);
}

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

.total-section {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-50) 100%);
    padding: 1.5rem;
    border-radius: var(--radius-xl);
    margin-top: 1rem;
    border: 2px solid var(--gray-200);
}

.total-amount {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   TICKET - IMPRESIÓN
   ============================================ */
.ticket {
    width: 80mm;
    max-width: 100%;
    margin: 0 auto;
    background: white;
    padding: 10mm;
    font-family: var(--font-mono);
    font-size: 12px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
}

.ticket-header {
    text-align: center;
    border-bottom: 2px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.ticket-body {
    margin: 10px 0;
}

.ticket-footer {
    text-align: center;
    border-top: 2px dashed #000;
    padding-top: 10px;
    margin-top: 10px;
}

.ticket-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

/* ============================================
   DASHBOARD CARDS
   ============================================ */
.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: white !important;
}

.bg-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    color: white !important;
}

.bg-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
    color: white !important;
}

.bg-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    color: white !important;
}

.bg-info {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    color: white !important;
}

.bg-dark {
    background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%) !important;
    color: white !important;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.stock-alert {
    animation: pulse 2s infinite;
}

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

/* ============================================
   UTILIDADES
   ============================================ */
.cursor-pointer {
    cursor: pointer;
}

.hover-shadow:hover {
    box-shadow: var(--shadow-xl) !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    /* Sidebar Mobile */
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Top Navbar Mobile */
    .top-navbar {
        left: 0;
        padding: 0 1rem;
    }

    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .navbar-title {
        font-size: 1.1rem;
    }

    /* User Menu Mobile */
    .user-menu {
        padding: 0.375rem 0.75rem;
        gap: 0.5rem;
    }

    .user-details-top {
        display: none;
    }

    .user-info-top i {
        font-size: 1.75rem;
    }

    .btn-logout-top {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    /* Main Content Mobile */
    .main-content {
        margin-left: 0;
    }

    .page-content {
        padding: 1rem;
    }

    /* Cards Mobile */
    .pos-container {
        height: auto;
    }

    .productos-list {
        max-height: 45vh;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .table {
        font-size: 0.85rem;
    }

    /* Dashboard Cards Mobile */
    .col-md-3, .col-md-4, .col-md-6 {
        margin-bottom: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet adjustments */
    .sidebar {
        width: 260px;
    }

    .top-navbar {
        left: 260px;
        padding: 0 1.5rem;
    }

    .main-content {
        margin-left: 260px;
    }

    .page-content {
        padding: 1.5rem;
    }

    .navbar-title {
        font-size: 1.3rem;
    }

    .user-name-top {
        font-size: 0.85rem;
    }

    .user-role-top {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    /* Mobile pequeño */
    .top-navbar {
        height: 60px;
        padding: 0 0.75rem;
    }

    .main-content {
        margin-top: 60px;
    }

    .navbar-title {
        font-size: 1rem;
    }

    .user-info-top i {
        font-size: 1.5rem;
    }

    .btn-logout-top {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    .user-menu {
        padding: 0.25rem 0.5rem;
        gap: 0.375rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body * {
        visibility: hidden;
    }
    .ticket, .ticket * {
        visibility: visible;
    }
    .ticket {
        position: absolute;
        left: 0;
        top: 0;
        width: 80mm;
    }
    .no-print {
        display: none !important;
    }
}
