/**
 * checkout-notifications.css
 * Estilos para notificações de late checkout
 * Modal, Toast, Pusher
 */

/* ==================== MODAL CHECKOUT ==================== */

.checkout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.checkout-modal-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.checkout-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.checkout-modal-wrapper {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 95%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.checkout-modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checkout-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

#checkout-modal-counter {
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    font-weight: normal;
}

.checkout-modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.checkout-modal-close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.checkout-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
}

.checkout-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.checkout-urgencia-alta {
    padding: 12px;
    background: #fee;
    border-left: 4px solid #e74c3c;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

.checkout-urgencia-media {
    padding: 12px;
    background: #ffeaa7;
    border-left: 4px solid #f39c12;
    border-radius: 4px;
}

.checkout-urgencia-baja {
    padding: 12px;
    background: #e8f8f5;
    border-left: 4px solid #27ae60;
    border-radius: 4px;
}

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

.checkout-urgencia-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.checkout-info {
    flex: 1;
}

.checkout-titulo {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.checkout-detalhes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.checkout-detalhe {
    font-size: 14px;
    color: #555;
    display: flex;
    gap: 8px;
}

.checkout-tempo {
    font-weight: 600;
    color: #e74c3c;
}

.checkout-proximo-aviso {
    background: #ffebee;
    padding: 8px 12px;
    border-radius: 4px;
    color: #c62828 !important;
    font-weight: 600;
}

.checkout-mensagem {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.checkout-timestamp {
    font-size: 12px;
    color: #999;
    text-align: right;
}

.checkout-modal-footer {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
}

.checkout-modal-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.checkout-action-btn {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
}

.checkout-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.checkout-action-btn.btn-secondary {
    background: #e8e8e8;
    color: #333;
}

.checkout-action-btn.btn-secondary:hover:not(:disabled) {
    background: #d0d0d0;
}

.checkout-action-btn.btn-primary {
    background: #27ae60;
    color: white;
}

.checkout-action-btn.btn-primary:hover:not(:disabled) {
    background: #229954;
}

.checkout-action-btn.loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.btn-icon {
    font-size: 16px;
}

.btn-text {
    font-weight: 600;
}

.checkout-modal-error {
    padding: 12px;
    background: #ffebee;
    border: 1px solid #e57373;
    border-radius: 4px;
    color: #c62828;
    display: none;
}

.checkout-modal-error.hidden {
    display: none;
}

.checkout-modal-error:not(.hidden) {
    display: block;
    animation: slideDown 0.3s ease;
}

.checkout-error-content {
    font-size: 14px;
}

.checkout-error-content strong {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

.checkout-error-content p {
    margin: 0;
    font-size: 13px;
}

.checkout-modal-nav {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e0e0e0;
}

.checkout-nav-prev,
.checkout-nav-next {
    flex: 1;
    padding: 8px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.checkout-nav-prev:hover:not(:disabled),
.checkout-nav-next:hover:not(:disabled) {
    background: #ddd;
}

.checkout-nav-prev:disabled,
.checkout-nav-next:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkout-success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: #27ae60;
    color: white;
    padding: 16px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

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

/* ==================== TOAST CHECKOUT ==================== */

.checkout-toast-container {
    position: fixed;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.checkout-toast-top-right {
    top: 20px;
    right: 20px;
}

.checkout-toast-top-left {
    top: 20px;
    left: 20px;
}

.checkout-toast-bottom-right {
    bottom: 20px;
    right: 20px;
}

.checkout-toast-bottom-left {
    bottom: 20px;
    left: 20px;
}

.checkout-toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 350px;
    width: 100%;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.checkout-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.checkout-toast.removing {
    opacity: 0;
    transform: translateX(400px);
}

.checkout-toast.success {
    background: #27ae60;
    color: white;
}

.checkout-toast[data-urgencia="alta"] {
    border-left: 4px solid #e74c3c;
}

.checkout-toast[data-urgencia="media"] {
    border-left: 4px solid #f39c12;
}

.checkout-toast[data-urgencia="baja"] {
    border-left: 4px solid #27ae60;
}

.checkout-toast-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-weight: 600;
}

.checkout-toast-emoji {
    font-size: 20px;
}

.checkout-toast-titulo {
    flex: 1;
    font-size: 15px;
}

.checkout-toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkout-toast-close:hover {
    color: #333;
}

.checkout-toast-body {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.checkout-toast-quarto {
    margin-bottom: 6px;
}

.checkout-toast-tempo {
    margin-bottom: 6px;
}

.checkout-toast-aviso {
    background: #fee;
    padding: 8px;
    border-radius: 4px;
    color: #c62828;
    font-weight: 600;
    margin-top: 8px;
}

.checkout-toast-actions {
    display: flex;
    gap: 8px;
}

.checkout-toast-btn {
    flex: 1;
    padding: 8px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.checkout-toast-btn:hover:not(:disabled) {
    background: #e0e0e0;
}

.checkout-toast-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.checkout-toast-btn.loading {
    background: #27ae60;
    color: white;
}

.checkout-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
}

.checkout-toast-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    width: 100%;
}

.checkout-toast-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #e57373;
}

.checkout-toast-error-standalone {
    border-left: 4px solid #e74c3c;
}

.checkout-toast-success {
    background: #27ae60;
    color: white;
}

.checkout-toast-success-toast {
    text-align: center;
    font-weight: 600;
}

/* ==================== PUSHER CHECKOUT ==================== */

.checkout-pusher-container {
    position: fixed;
    right: 20px;
    top: 80px;
    z-index: 9997;
    max-width: 450px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-pusher-notification {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px;
    opacity: 0;
    transform: translateX(500px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.checkout-pusher-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.checkout-pusher-notification.removing {
    opacity: 0;
    transform: translateX(500px);
}

.checkout-urgencia-alta {
    border-left: 4px solid #e74c3c;
}

.checkout-urgencia-media {
    border-left: 4px solid #f39c12;
}

.checkout-urgencia-baja {
    border-left: 4px solid #27ae60;
}

.checkout-pusher-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.checkout-pusher-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    max-width: 70%;
}

.checkout-pusher-status-badge {
    font-size: 12px;
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.checkout-pusher-details {
    margin: 12px 0;
    font-size: 13px;
    color: #666;
}

.checkout-pusher-line {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.checkout-pusher-label {
    font-weight: 600;
    color: #999;
    min-width: 60px;
}

.checkout-pusher-value {
    flex: 1;
    color: #333;
}

.checkout-pusher-warning {
    background: #ffebee;
    padding: 8px 12px;
    border-radius: 4px;
    color: #c62828;
    font-weight: 600;
    margin-top: 8px;
}

.checkout-pusher-message {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin: 12px 0;
}

.checkout-pusher-actions {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.checkout-pusher-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.checkout-pusher-btn:hover:not(:disabled) {
    background: #229954;
}

.checkout-pusher-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.checkout-pusher-btn-close {
    background: #f0f0f0;
    color: #999;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.checkout-pusher-btn-close:hover {
    background: #e0e0e0;
    color: #333;
}

.checkout-pusher-sem-cobranca {
    background: #95a5a6;
}

.checkout-pusher-sem-cobranca:hover:not(:disabled) {
    background: #7f8c8d;
}

.checkout-pusher-gerar-diaria {
    background: #3498db;
}

.checkout-pusher-gerar-diaria:hover:not(:disabled) {
    background: #2980b9;
}

.checkout-pusher-sync-info {
    font-size: 11px;
    color: #999;
    text-align: right;
    padding-top: 8px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.checkout-pusher-sync-icon {
    animation: rotate 1s linear infinite;
}

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

.checkout-info-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkout-info-toast.show {
    opacity: 1;
}

.checkout-info-toast.checkout-toast-success {
    background: #27ae60;
    color: white;
}

.checkout-info-toast.checkout-toast-error {
    background: #e74c3c;
    color: white;
}

.checkout-info-toast.checkout-toast-info {
    background: #3498db;
    color: white;
}

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

@media (max-width: 768px) {
    .checkout-modal-wrapper {
        max-width: 95vw;
        width: 95vw;
        max-height: 90vh;
    }
    
    .checkout-toast-container {
        right: 10px;
        left: 10px;
        top: 60px;
    }
    
    .checkout-toast {
        max-width: 100%;
    }
    
    .checkout-pusher-container {
        right: 10px;
        top: 60px;
        width: calc(100% - 20px);
    }
    
    .checkout-pusher-notification {
        max-width: 100%;
    }
    
    .checkout-modal-actions {
        flex-direction: column;
    }
    
    .checkout-action-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .checkout-modal-wrapper {
        border-radius: 12px 12px 0 0;
        max-height: 95vh;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        animation: slideUp 0.3s ease;
    }
    
    .checkout-modal-content {
        padding: 20px 16px;
    }
    
    .checkout-titulo {
        font-size: 18px;
    }
    
    .checkout-toast {
        max-width: calc(100vw - 20px);
    }
}
