@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
    --bg-indigo: #1A365D;
    --bg-indigo-dark: #0f1f38;
    --accent-copper: #B87333;
    --text-bone: #FDFBF7;
    --danger-red: #8B0000;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: 12px;
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-bone);
    background: radial-gradient(circle at top right, var(--bg-indigo), var(--bg-indigo-dark));
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 80px; /* Espacio para el footer flotante */
}

/* --- EFECTO GLASSMORPHISM PREMIUM --- */
.glass-panel,
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* --- HEADER --- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-radius: 0 0 24px 24px;
    margin-bottom: 24px;
    border-top: none;
    border-left: none;
    border-right: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: #4CAF50; /* Verde brillante para OK */
    border-radius: 50%;
    display: inline-block;
}

/* --- CONTENIDO PRINCIPAL --- */
.app-main {
    padding: 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- FILTROS --- */
.filter-section {
    display: flex;
    justify-content: flex-start;
}

.filter-wrapper {
    padding: 8px 16px;
    border-radius: 24px;
    display: inline-flex;
}

.select-minimalist {
    background: transparent;
    border: none;
    color: var(--text-bone);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
}

.select-minimalist option {
    background: var(--bg-indigo-dark);
    color: var(--text-bone);
}

/* --- GRID DE MÉTRICAS --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.metric-card {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 8px;
    transition: transform 0.3s ease;
}

.metric-title {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.8;
}

.metric-value.text-accent {
    color: var(--accent-copper);
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
}

.metric-full-width {
    grid-column: 1 / -1;
    align-items: center;
    text-align: center;
}

/* --- COLA DE TRABAJO --- */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-left: 4px;
}

.queue-list {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.queue-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--glass-border);
}

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

.queue-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.client-name {
    font-weight: 700;
    font-size: 1rem;
}

.queue-item-body {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    opacity: 0.7;
}

.order-id {
    font-weight: 600;
}

/* --- FOOTER & BOTÓN --- */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(to top, var(--bg-indigo-dark) 40%, transparent);
    display: flex;
    justify-content: center;
    z-index: 100;
}

.btn-danger {
    background-color: var(--danger-red);
    color: var(--text-bone);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    max-width: 400px;
    padding: 16px;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 0, 0, 0.4);
    /* Transición suave para todos los cambios */
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

/* Micro-interacción: escala de reducción del 2% */
.scale-on-click:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(139, 0, 0, 0.3);
}

/* --- ANIMACIONES WOW --- */

/* 1. Pulso constante para Status: OK */
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(76, 175, 80, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.status-pulse {
    animation: pulse 2s infinite;
}

/* 2. Animación slide-up y fade-in */
@keyframes slideUpFade {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

.slide-up {
    /* Estado inicial invisible antes de animar */
    opacity: 0; 
    animation: slideUpFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 3. Animación simple fade-in */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

/* --- ESPACIADO Y DELAYS ESCALONADOS (STAGGER) --- */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }
.staggered-7 { animation-delay: 0.8s; } /* Para el footer */

/* --- RESPONSIVIDAD (Tablets en adelante) --- */
@media (min-width: 768px) {
    .metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .metric-full-width {
        grid-column: span 1; /* Ocupa un espacio normal en pantallas más grandes */
    }
    .app-main {
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
    }
}
