/* ============================================
   ARMADO DE PEDIDOS - KANBAN DESIGN
   ============================================ */

:root {
    /* Colores por estado */
    --pendiente-bg: #FFF3CD;
    --pendiente-border: #FFC107;
    --pendiente-text: #856404;

    --tardio-bg: #F8D7DA;
    --tardio-border: #DC3545;
    --tardio-text: #721C24;

    --enarmado-bg: #E7D4F5;
    --enarmado-border: #9B59B6;
    --enarmado-text: #5A2D6F;

    --listo-bg: #D4EDDA;
    --listo-border: #28A745;
    --listo-text: #155724;

    /* Neutrales */
    --bg-dark: #1E1F26;
    --bg-light: #F8F9FA;
    --border-light: #DEE2E6;
    --text-primary: #212529;
    --text-secondary: #6C757D;

    /* Espaciado */
    --card-spacing: 16px;
    --section-spacing: 24px;
}

/* ============================================
   HEADER OPERATIVO
   ============================================ */

.armado-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.armado-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.armado-clock {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.armado-clock-time {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    font-family: 'Courier New', monospace;
}

.armado-clock-date {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 4px;
}

.armado-title h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

.armado-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.armado-user-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ============================================
   PANEL DE ACCIONES RÁPIDAS
   ============================================ */

.actions-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.action-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.action-btn-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.action-btn-text {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

/* ============================================
   TABLERO KANBAN
   ============================================ */

.kanban-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--section-spacing);
    margin-bottom: 32px;
}

.kanban-column {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-height: 400px;
}

.kanban-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-light);
}

.kanban-column-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-column-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    background: var(--bg-light);
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    padding: 0 8px;
}

.kanban-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--card-spacing);
    max-height: calc(100vh - 240px);
    overflow-y: auto;
    padding-right: 8px;
}

/* Scrollbar personalizado */
.kanban-cards::-webkit-scrollbar {
    width: 6px;
}

.kanban-cards::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 3px;
}

.kanban-cards::-webkit-scrollbar-thumb {
    background: #CCC;
    border-radius: 3px;
}

.kanban-cards::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ============================================
   TARJETAS DE PEDIDO
   ============================================ */

.pedido-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.pedido-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Estados de tarjetas */
.pedido-card.pendiente {
    background: var(--pendiente-bg);
    border-left-color: var(--pendiente-border);
}

.pedido-card.tardio {
    background: var(--tardio-bg);
    border-left-color: var(--tardio-border);
    animation: pulse-tardio 2s ease-in-out infinite;
}

.pedido-card.enarmado {
    background: var(--enarmado-bg);
    border-left-color: var(--enarmado-border);
}

.pedido-card.listo {
    background: var(--listo-bg);
    border-left-color: var(--listo-border);
}

/* Animación pulso para tardíos */
@keyframes pulse-tardio {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

/* Animación highlight al asignar */
@keyframes highlight {
    0% { background: white; }
    50% { background: var(--enarmado-border); color: white; }
    100% { background: var(--enarmado-bg); }
}

.pedido-card.highlighting {
    animation: highlight 0.8s ease-out;
}

/* Checkbox en tarjetas */
.pedido-card-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Header de tarjeta */
.pedido-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    padding-right: 32px; /* Espacio para el checkbox */
}

.pedido-folio {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.pedido-hora {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tipo de pedido badge */
.pedido-tipo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.pedido-tipo.domicilio {
    background: #2196F3;
    color: white;
}

.pedido-tipo.recoger {
    background: #17A2B8;
    color: white;
}

/* Info del pedido */
.pedido-info {
    margin-bottom: 12px;
}

.pedido-cliente {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pedido-domicilio {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.pedido-telefono {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'Courier New', monospace;
}

/* Footer de tarjeta */
.pedido-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 12px;
}

.pedido-runner {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.pedido-tiempo {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.05);
}

.pedido-tiempo.normal {
    background: rgba(40, 167, 69, 0.1);
    color: #28A745;
}

.pedido-tiempo.alerta {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.pedido-tiempo.tardio {
    background: rgba(220, 53, 69, 0.2);
    color: #DC3545;
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================
   MODAL DE OPCIONES
   ============================================ */

.pedido-modal .modal-content {
    border-radius: 16px;
    border: none;
}

.pedido-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 20px 24px;
}

.pedido-modal .modal-title {
    font-size: 24px;
    font-weight: 700;
}

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

.pedido-modal .modal-body {
    padding: 24px;
}

.pedido-modal-info {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.pedido-modal-info-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.pedido-modal-info-item:last-child {
    margin-bottom: 0;
}

.pedido-modal-info-icon {
    font-size: 20px;
    color: #667eea;
    margin-top: 2px;
}

.pedido-modal-info-content {
    flex: 1;
}

.pedido-modal-info-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.pedido-modal-info-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.pedido-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.pedido-modal-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border: 2px solid var(--border-light);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pedido-modal-action-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: scale(1.02);
}

.pedido-modal-action-btn i {
    font-size: 28px;
    margin-bottom: 8px;
}

.pedido-modal-action-btn span {
    font-size: 13px;
    font-weight: 600;
}

/* ============================================
   ESTADOS VACÍOS
   ============================================ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 15px;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
    .kanban-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }

    .armado-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .pedido-folio {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pedido-modal-actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .armado-clock-time {
        font-size: 24px;
    }

    .armado-title h1 {
        font-size: 22px;
    }

    .pedido-folio {
        font-size: 20px;
    }

    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   UTILIDADES
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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