/**
 * TechFlix Frontend Toast System
 * Sistema de notificações toast para páginas do Page Builder
 *
 * @package TechFlix
 * @since 2.1.0
 */

/* ===== Toast Container ===== */
#techflix-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 400px;
}

/* Ajuste quando tem menu topo */
.has-topnav #techflix-toast-container,
body.has-top-menu #techflix-toast-container {
    top: 80px;
}

/* ===== Base Toast - Dark Theme ===== */
.techflix-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

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

.techflix-toast.hiding {
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* ===== Toast Icon ===== */
.techflix-toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.techflix-toast-icon svg {
    width: 22px;
    height: 22px;
}

/* ===== Toast Content ===== */
.techflix-toast-content {
    flex: 1;
    min-width: 0;
    padding-top: 2px;
}

.techflix-toast-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 4px;
    line-height: 1.4;
}

.techflix-toast-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

/* ===== Toast Close Button ===== */
.techflix-toast-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
    padding: 0;
    margin: -4px -4px -4px 0;
}

.techflix-toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.techflix-toast-close svg {
    width: 18px;
    height: 18px;
}

/* ===== Toast Progress Bar ===== */
.techflix-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.techflix-toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: toastProgress linear forwards;
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* ===== Toast Types ===== */

/* Success */
.techflix-toast.toast-success {
    border-color: rgba(16, 185, 129, 0.3);
}

.techflix-toast.toast-success .techflix-toast-icon {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.techflix-toast.toast-success .techflix-toast-progress-bar {
    background: #10b981;
}

/* Error */
.techflix-toast.toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.techflix-toast.toast-error .techflix-toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.techflix-toast.toast-error .techflix-toast-progress-bar {
    background: #ef4444;
}

/* Warning */
.techflix-toast.toast-warning {
    border-color: rgba(245, 158, 11, 0.3);
}

.techflix-toast.toast-warning .techflix-toast-icon {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.techflix-toast.toast-warning .techflix-toast-progress-bar {
    background: #f59e0b;
}

/* Info */
.techflix-toast.toast-info {
    border-color: rgba(59, 130, 246, 0.3);
}

.techflix-toast.toast-info .techflix-toast-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.techflix-toast.toast-info .techflix-toast-progress-bar {
    background: #3b82f6;
}

/* Brand (TechFlix Red) */
.techflix-toast.toast-brand {
    border-color: rgba(229, 9, 20, 0.3);
}

.techflix-toast.toast-brand .techflix-toast-icon {
    background: rgba(229, 9, 20, 0.2);
    color: #e50914;
}

.techflix-toast.toast-brand .techflix-toast-progress-bar {
    background: #e50914;
}

/* ===== Toast Actions (Optional) ===== */
.techflix-toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.techflix-toast-actions button {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.techflix-toast-actions .btn-primary {
    background: #e50914;
    color: #fff;
    border-color: #e50914;
}

.techflix-toast-actions .btn-primary:hover {
    background: #b20710;
    border-color: #b20710;
}

.techflix-toast-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.techflix-toast-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== Simple Toast (Compact Version) ===== */
.techflix-toast.toast-simple {
    padding: 14px 16px;
    align-items: center;
}

.techflix-toast.toast-simple .techflix-toast-icon {
    width: 28px;
    height: 28px;
    background: transparent;
}

.techflix-toast.toast-simple .techflix-toast-icon svg {
    width: 20px;
    height: 20px;
}

.techflix-toast.toast-simple .techflix-toast-content {
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    padding-left: 12px;
    margin-left: 4px;
    padding-top: 0;
}

.techflix-toast.toast-simple .techflix-toast-message {
    color: #ffffff;
    font-size: 14px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    #techflix-toast-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .techflix-toast {
        padding: 14px;
    }
}
