/* AUTO TESTER - Toast Notifications Styles */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    pointer-events: none;
}

.toast-container.top-left {
    top: 20px;
    left: 20px;
    right: auto;
}

.toast-container.top-center {
    top: 20px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
}

.toast-container.top-right {
    top: 20px;
    right: 20px;
    left: auto;
}

.toast-container.bottom-left {
    bottom: 20px;
    left: 20px;
    right: auto;
    top: auto;
}

.toast-container.bottom-center {
    bottom: 20px;
    left: 50%;
    right: auto;
    top: auto;
    transform: translateX(-50%);
}

.toast-container.bottom-right {
    bottom: 20px;
    right: 20px;
    left: auto;
    top: auto;
}

/* Toast Element */
.toast {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    margin-bottom: 15px;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
    position: relative;
    overflow: hidden;
}

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

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

/* Toast Types */
.toast-success {
    border-left: 4px solid #16a34a;
}

.toast-error {
    border-left: 4px solid #dc2626;
}

.toast-warning {
    border-left: 4px solid #f59e0b;
}

.toast-info {
    border-left: 4px solid #0ea5e9;
}

.toast-loading {
    border-left: 4px solid #6366f1;
}

/* Toast Content */
.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.toast-success .toast-icon {
    color: #16a34a;
}

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

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-info .toast-icon {
    color: #0ea5e9;
}

.toast-loading .toast-icon {
    color: #6366f1;
}

.toast-message {
    flex: 1;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
    color: #1e293b;
    word-wrap: break-word;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.toast-close:hover {
    background: #f1f5f9;
    color: #475569;
}

.toast-close:focus {
    outline: 2px solid #cbd5e1;
    outline-offset: 1px;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
}

.toast-progress-bar {
    height: 100%;
    background: currentColor;
    width: 0;
}

.toast-success .toast-progress-bar {
    background: #16a34a;
}

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

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

.toast-info .toast-progress-bar {
    background: #0ea5e9;
}

.toast-loading .toast-progress-bar {
    background: #6366f1;
}

/* RTL Support */
html[dir="rtl"] .toast-container {
    left: 20px;
    right: auto;
}

html[dir="rtl"] .toast-container.top-right {
    left: 20px;
    right: auto;
}

html[dir="rtl"] .toast-container.bottom-right {
    left: 20px;
    right: auto;
}

html[dir="rtl"] .toast {
    transform: translateX(-100%);
}

html[dir="rtl"] .toast.show {
    transform: translateX(0);
}

html[dir="rtl"] .toast.hide {
    transform: translateX(-100%);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
        bottom: auto;
    }
    
    .toast-container.bottom-left,
    .toast-container.bottom-center,
    .toast-container.bottom-right {
        bottom: 10px;
        top: auto;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
    
    .toast-content {
        padding: 14px;
    }
    
    .toast-message {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .toast-container {
        left: 5px;
        right: 5px;
        top: 5px;
        bottom: auto;
    }
    
    .toast-container.bottom-left,
    .toast-container.bottom-center,
    .toast-container.bottom-right {
        bottom: 5px;
        top: auto;
    }
    
    .toast {
        margin-bottom: 10px;
    }
    
    .toast-content {
        padding: 12px;
        gap: 10px;
    }
    
    .toast-icon {
        width: 20px;
        height: 20px;
        font-size: 0.9rem;
    }
    
    .toast-message {
        font-size: 0.85rem;
    }
    
    .toast-close {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .toast {
        background: #1e293b;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    }
    
    .toast-message {
        color: #f1f5f9;
    }
    
    .toast-close {
        color: #94a3b8;
    }
    
    .toast-close:hover {
        background: #334155;
        color: #cbd5e1;
    }
    
    .toast-close:focus {
        outline-color: #475569;
    }
    
    .toast-progress {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .toast {
        border: 2px solid #000;
        box-shadow: none;
    }
    
    .toast-success {
        border-color: #16a34a;
        background: #fff;
    }
    
    .toast-error {
        border-color: #dc2626;
        background: #fff;
    }
    
    .toast-warning {
        border-color: #f59e0b;
        background: #fff;
    }
    
    .toast-info {
        border-color: #0ea5e9;
        background: #fff;
    }
    
    .toast-loading {
        border-color: #6366f1;
        background: #fff;
    }
    
    .toast-message {
        color: #000;
        font-weight: 600;
    }
    
    .toast-close {
        border: 1px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast-content,
    .toast-close,
    .toast-progress-bar {
        transition: none;
    }
    
    .toast-icon i.fa-spin {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .toast-container {
        display: none !important;
    }
}

/* Focus Styles for Accessibility */
.toast:focus {
    outline: 2px solid #ffd700;
    outline-offset: 2px;
}

.toast:focus:not(:focus-visible) {
    outline: none;
}

/* Animation Variations */
.toast.slide-in {
    animation: slideIn 0.3s ease-out;
}

.toast.slide-out {
    animation: slideOut 0.3s ease-in;
}

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

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

/* RTL Animation Variations */
html[dir="rtl"] .toast {
    animation: slideInRTL 0.3s ease-out;
}

html[dir="rtl"] .toast.hide {
    animation: slideOutRTL 0.3s ease-in;
}

@keyframes slideInRTL {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRTL {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* Compact Mode */
.toast.compact {
    min-width: 250px;
    max-width: 300px;
}

.toast.compact .toast-content {
    padding: 12px;
}

.toast.compact .toast-message {
    font-size: 0.85rem;
}

/* Large Mode */
.toast.large {
    min-width: 400px;
    max-width: 500px;
}

.toast.large .toast-content {
    padding: 20px;
}

.toast.large .toast-message {
    font-size: 1.1rem;
}

.toast.large .toast-icon {
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
}

/* Stacking Animation */
.toast:nth-child(1) { z-index: 10005; }
.toast:nth-child(2) { z-index: 10004; }
.toast:nth-child(3) { z-index: 10003; }
.toast:nth-child(4) { z-index: 10002; }
.toast:nth-child(5) { z-index: 10001; }

/* Custom Positions */
.toast-container.center {
    top: 50%;
    right: 50%;
    bottom: auto;
    left: auto;
    transform: translate(50%, -50%);
}

.toast-container.center .toast {
    transform: translateX(0) scale(0.8);
    opacity: 0;
}

.toast-container.center .toast.show {
    transform: translateX(0) scale(1);
    opacity: 1;
}

.toast-container.center .toast.hide {
    transform: translateX(0) scale(0.8);
    opacity: 0;
}

/* Grouped Toasts */
.toast-container.grouped .toast {
    margin-bottom: 5px;
}

.toast-container.grouped .toast:first-child {
    border-radius: 12px 12px 0 0;
}

.toast-container.grouped .toast:last-child {
    border-radius: 0 0 12px 12px;
    margin-bottom: 15px;
}

.toast-container.grouped .toast:only-child {
    border-radius: 12px;
}

/* Status Indicators */
.toast-status {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.toast-success .toast-status {
    background: #16a34a;
}

.toast-error .toast-status {
    background: #dc2626;
}

.toast-warning .toast-status {
    background: #f59e0b;
}

.toast-info .toast-status {
    background: #0ea5e9;
}

.toast-loading .toast-status {
    background: #6366f1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
