/* ========================================
   QUINTAL BURGERS - PDV SYSTEM
   Toast Notifications & Print Fixes
   ======================================== */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none; /* CRÍTICO: Não bloquear cliques na área */
}

/* Toast Notification */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: toastSlideIn 0.3s ease;
    min-width: 300px;
    pointer-events: auto; /* Apenas o toast em si é clicável */
}

.toast.toast-exit {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
    white-space: pre-line;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* Toast Types */
.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-info .toast-icon {
    color: var(--info);
}

/* Confirm Modal */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* CRÍTICO: Não bloquear cliques quando invisível */
    transition: all 0.2s ease;
}

.confirm-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* CRÍTICO: Permitir cliques quando visível */
}

.confirm-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 30px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.confirm-overlay.active .confirm-modal {
    transform: scale(1);
}

.confirm-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.confirm-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.confirm-message {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-buttons .btn {
    min-width: 120px;
}

/* Input Modal */
.input-modal .confirm-modal {
    text-align: left;
}

.input-modal .confirm-title {
    text-align: center;
}

.input-modal .form-group {
    margin: 20px 0;
}

.input-modal .confirm-buttons {
    margin-top: 20px;
}

/* Print Styles - Fixed */
@media print {
    /* Hide everything */
    body * {
        visibility: hidden !important;
    }
    
    /* Show only print area */
    #printArea,
    #printArea * {
        visibility: visible !important;
    }
    
    #printArea {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 80mm !important;
        background: white !important;
        color: black !important;
        font-family: 'Courier New', Courier, monospace !important;
        font-size: 12px !important;
        line-height: 1.4 !important;
        padding: 5mm !important;
        margin: 0 !important;
    }
    
    /* Page settings */
    @page {
        size: 80mm auto;
        margin: 0;
    }
    
    /* Hide sidebar and other elements */
    .sidebar,
    .top-bar,
    .toast-container,
    .modal-overlay,
    .confirm-overlay {
        display: none !important;
    }
}

/* Print Area (hidden on screen) */
#printArea {
    display: none;
}
