/**
 * TechFlix Admin Toast System
 * Sistema de notificações toast padronizado para todas as páginas admin
 *
 * @package TechFlix
 * @since 2.1.0
 */

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

/* ===== Base Toast ===== */
.techflix-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    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%;
}

.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: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

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

.techflix-toast-icon .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
}

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

.techflix-toast-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 2px;
    line-height: 1.4;
}

.techflix-toast-message {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

/* ===== Toast Close Button ===== */
.techflix-toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #9ca3af;
    transition: all 0.2s ease;
    padding: 0;
    margin: -4px -4px -4px 0;
}

.techflix-toast-close:hover {
    background: #f3f4f6;
    color: #374151;
}

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

/* ===== Toast Progress Bar ===== */
.techflix-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 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: #d1fae5;
}

.techflix-toast.toast-success .techflix-toast-icon {
    background: #ecfdf5;
    color: #059669;
}

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

/* Error */
.techflix-toast.toast-error {
    border-color: #fee2e2;
}

.techflix-toast.toast-error .techflix-toast-icon {
    background: #fef2f2;
    color: #dc2626;
}

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

/* Warning */
.techflix-toast.toast-warning {
    border-color: #fef3c7;
}

.techflix-toast.toast-warning .techflix-toast-icon {
    background: #fffbeb;
    color: #d97706;
}

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

/* Info */
.techflix-toast.toast-info {
    border-color: #dbeafe;
}

.techflix-toast.toast-info .techflix-toast-icon {
    background: #eff6ff;
    color: #2563eb;
}

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

/* Brand (TechFlix Red) */
.techflix-toast.toast-brand {
    border-color: #fee2e2;
}

.techflix-toast.toast-brand .techflix-toast-icon {
    background: #fff5f5;
    color: #e61919;
}

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

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

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

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

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

.techflix-toast-actions .btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.techflix-toast-actions .btn-secondary:hover {
    background: #e5e7eb;
}

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

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

.techflix-toast.toast-simple .techflix-toast-icon svg,
.techflix-toast.toast-simple .techflix-toast-icon .dashicons {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.techflix-toast.toast-simple .techflix-toast-content {
    border-left: 1px solid #e5e7eb;
    padding-left: 12px;
    margin-left: 4px;
}

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

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

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

/* =============================================
   DARK MODE - TechSites Dashboard WP
   Dual selector: body.tsdwp-theme-dark e body.tsdwp-active.tsdwp-theme-dark
   ============================================= */

/* Base Toast Dark Mode */
body.tsdwp-theme-dark .techflix-toast,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

body.tsdwp-theme-dark .techflix-toast-title,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast-title {
    color: #f1f5f9;
}

body.tsdwp-theme-dark .techflix-toast-message,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast-message {
    color: #94a3b8;
}

body.tsdwp-theme-dark .techflix-toast-close,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast-close {
    color: #64748b;
}

body.tsdwp-theme-dark .techflix-toast-close:hover,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast-close:hover {
    background: #334155;
    color: #e2e8f0;
}

body.tsdwp-theme-dark .techflix-toast-progress,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast-progress {
    background: rgba(255, 255, 255, 0.1);
}

/* Simple Toast Dark Mode */
body.tsdwp-theme-dark .techflix-toast.toast-simple .techflix-toast-content,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-simple .techflix-toast-content {
    border-left-color: #334155;
}

body.tsdwp-theme-dark .techflix-toast.toast-simple .techflix-toast-message,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-simple .techflix-toast-message {
    color: #e2e8f0;
}

/* Toast Types Dark Mode */

/* Success */
body.tsdwp-theme-dark .techflix-toast.toast-success,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-success {
    border-color: #064e3b;
}

body.tsdwp-theme-dark .techflix-toast.toast-success .techflix-toast-icon,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-success .techflix-toast-icon {
    background: #064e3b;
    color: #34d399;
}

/* Error */
body.tsdwp-theme-dark .techflix-toast.toast-error,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-error {
    border-color: #7f1d1d;
}

body.tsdwp-theme-dark .techflix-toast.toast-error .techflix-toast-icon,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-error .techflix-toast-icon {
    background: #7f1d1d;
    color: #f87171;
}

/* Warning */
body.tsdwp-theme-dark .techflix-toast.toast-warning,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-warning {
    border-color: #78350f;
}

body.tsdwp-theme-dark .techflix-toast.toast-warning .techflix-toast-icon,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-warning .techflix-toast-icon {
    background: #78350f;
    color: #fbbf24;
}

/* Info */
body.tsdwp-theme-dark .techflix-toast.toast-info,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-info {
    border-color: #1e3a8a;
}

body.tsdwp-theme-dark .techflix-toast.toast-info .techflix-toast-icon,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-info .techflix-toast-icon {
    background: #1e3a8a;
    color: #60a5fa;
}

/* Brand (TechFlix Red) */
body.tsdwp-theme-dark .techflix-toast.toast-brand,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-brand {
    border-color: #450a0a;
}

body.tsdwp-theme-dark .techflix-toast.toast-brand .techflix-toast-icon,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast.toast-brand .techflix-toast-icon {
    background: #450a0a;
    color: #f87171;
}

/* Toast Actions Dark Mode */
body.tsdwp-theme-dark .techflix-toast-actions .btn-primary,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast-actions .btn-primary {
    background: #e61919;
    border-color: #e61919;
    color: #fff;
}

body.tsdwp-theme-dark .techflix-toast-actions .btn-primary:hover,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast-actions .btn-primary:hover {
    background: #cc0000;
    border-color: #cc0000;
}

body.tsdwp-theme-dark .techflix-toast-actions .btn-secondary,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast-actions .btn-secondary {
    background: #334155;
    color: #e2e8f0;
    border-color: #475569;
}

body.tsdwp-theme-dark .techflix-toast-actions .btn-secondary:hover,
body.tsdwp-active.tsdwp-theme-dark .techflix-toast-actions .btn-secondary:hover {
    background: #475569;
    border-color: #64748b;
}

/* =============================================
   TSDWP Toolbar Offset - Toast Positioning
   Ajusta posição do toast quando TechSites Dashboard WP está ativo
   ============================================= */

body.tsdwp-custom-admin #techflix-toast-container,
body.tsdwp-active #techflix-toast-container {
    top: 80px !important;
}
