/**
 * 🔔 TINDA Notifications Styles
 * نظام الإشعارات المتقدم - الأنماط
 * 
 * Version: 1.0
 * Date: 2026-02-20
 */

/* ============================================
   NOTIFICATION CONTAINER
   ============================================ */
.tinda-notif-container {
    position: fixed;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.tinda-notif-container.top-right {
    top: 80px;
    right: 20px;
}

.tinda-notif-container.top-left {
    top: 80px;
    left: 20px;
}

.tinda-notif-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.tinda-notif-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.tinda-notif-container.top-center {
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
}

/* ============================================
   NOTIFICATION CARD
   ============================================ */
.tinda-notif {
    min-width: 320px;
    max-width: 420px;
    background: linear-gradient(
        135deg,
        rgba(26, 26, 26, 0.98) 0%,
        rgba(38, 38, 38, 0.95) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    pointer-events: all;
    opacity: 0;
    transform: translateX(120px);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
}

/* Glass morphism effect */
.tinda-notif::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: none;
}

/* Show animation */
.tinda-notif.tinda-notif-show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

/* Hide animation */
.tinda-notif.tinda-notif-hide {
    opacity: 0;
    transform: translateX(120px) scale(0.9);
    transition: all 0.25s cubic-bezier(0.4, 0, 1, 1);
}

/* Hover effect */
.tinda-notif:hover {
    transform: translateX(-4px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ============================================
   NOTIFICATION CONTENT
   ============================================ */
.tinda-notif-content {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    position: relative;
    z-index: 1;
}

/* Icon */
.tinda-notif-icon {
    font-size: 22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

/* Text */
.tinda-notif-text {
    flex: 1;
    min-width: 0;
}

.tinda-notif-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.tinda-notif-message {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    font-weight: 400;
}

/* ============================================
   CLOSE BUTTON
   ============================================ */
.tinda-notif-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.tinda-notif-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
}

.tinda-notif-close:active {
    transform: scale(0.95);
}

/* ============================================
   ACTION BUTTONS
   ============================================ */
.tinda-notif-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}

.tinda-notif-action-btn {
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
}

.tinda-notif-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.tinda-notif-action-btn:active {
    transform: translateY(0);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.tinda-notif-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.tinda-notif-progress-bar {
    height: 100%;
    width: 100%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
    transition: width linear;
}

/* ============================================
   TYPE-SPECIFIC STYLES
   ============================================ */

/* Info */
.tinda-notif-info {
    border-right: 4px solid #3b82f6;
    color: #60a5fa;
}

.tinda-notif-info .tinda-notif-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.tinda-notif-info .tinda-notif-progress-bar {
    background: #3b82f6;
}

/* Success */
.tinda-notif-success {
    border-right: 4px solid #22c55e;
    color: #4ade80;
}

.tinda-notif-success .tinda-notif-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.tinda-notif-success .tinda-notif-progress-bar {
    background: #22c55e;
}

/* Warning */
.tinda-notif-warning {
    border-right: 4px solid #f59e0b;
    color: #fbbf24;
}

.tinda-notif-warning .tinda-notif-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.tinda-notif-warning .tinda-notif-progress-bar {
    background: #f59e0b;
}

/* Error */
.tinda-notif-error {
    border-right: 4px solid #ef4444;
    color: #f87171;
}

.tinda-notif-error .tinda-notif-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.tinda-notif-error .tinda-notif-progress-bar {
    background: #ef4444;
}

/* Default (TINDA brand) */
.tinda-notif-default {
    border-right: 4px solid #DC143C;
    color: #ff4567;
}

.tinda-notif-default .tinda-notif-icon {
    background: rgba(220, 20, 60, 0.15);
    color: #ff4567;
}

.tinda-notif-default .tinda-notif-progress-bar {
    background: #DC143C;
}

/* ============================================
   RTL SUPPORT (للعربية)
   ============================================ */
[dir="rtl"] .tinda-notif,
html[dir="rtl"] .tinda-notif {
    transform: translateX(-120px);
}

[dir="rtl"] .tinda-notif.tinda-notif-show,
html[dir="rtl"] .tinda-notif.tinda-notif-show {
    transform: translateX(0) scale(1);
}

[dir="rtl"] .tinda-notif.tinda-notif-hide,
html[dir="rtl"] .tinda-notif.tinda-notif-hide {
    transform: translateX(-120px) scale(0.9);
}

[dir="rtl"] .tinda-notif:hover,
html[dir="rtl"] .tinda-notif:hover {
    transform: translateX(4px) scale(1.02);
}

[dir="rtl"] .tinda-notif-close,
html[dir="rtl"] .tinda-notif-close {
    left: 12px;
    right: auto;
}

/* RTL: Move border to left side */
[dir="rtl"] .tinda-notif-info,
[dir="rtl"] .tinda-notif-success,
[dir="rtl"] .tinda-notif-warning,
[dir="rtl"] .tinda-notif-error,
[dir="rtl"] .tinda-notif-default,
html[dir="rtl"] .tinda-notif-info,
html[dir="rtl"] .tinda-notif-success,
html[dir="rtl"] .tinda-notif-warning,
html[dir="rtl"] .tinda-notif-error,
html[dir="rtl"] .tinda-notif-default {
    border-right: none;
    border-left: 4px solid;
    border-left-color: inherit;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes tinda-notif-slide-in-right {
    from {
        opacity: 0;
        transform: translateX(120px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes tinda-notif-slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-120px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes tinda-notif-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .tinda-notif-container {
        left: 10px !important;
        right: 10px !important;
        top: 70px !important;
        transform: none !important;
        max-width: calc(100vw - 20px);
    }

    .tinda-notif {
        min-width: auto;
        max-width: none;
        width: 100%;
    }

    .tinda-notif-icon {
        font-size: 20px;
        width: 28px;
        height: 28px;
    }

    .tinda-notif-title {
        font-size: 0.9rem;
    }

    .tinda-notif-message {
        font-size: 0.825rem;
    }

    .tinda-notif-actions {
        flex-wrap: wrap;
    }

    .tinda-notif-action-btn {
        font-size: 0.8rem;
        padding: 7px 14px;
    }
}

/* ============================================
   DARK MODE (already dark, but for consistency)
   ============================================ */
@media (prefers-color-scheme: light) {
    .tinda-notif {
        background: linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(248, 248, 248, 0.95) 100%
        );
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    .tinda-notif-title {
        color: #1a1a1a;
    }

    .tinda-notif-message {
        color: rgba(0, 0, 0, 0.75);
    }

    .tinda-notif-close {
        background: rgba(0, 0, 0, 0.05);
        color: rgba(0, 0, 0, 0.5);
    }

    .tinda-notif-close:hover {
        background: rgba(0, 0, 0, 0.12);
        color: rgba(0, 0, 0, 0.8);
    }

    .tinda-notif-action-btn {
        border: 1px solid rgba(0, 0, 0, 0.15);
        background: rgba(0, 0, 0, 0.05);
        color: #1a1a1a;
    }

    .tinda-notif-action-btn:hover {
        background: rgba(0, 0, 0, 0.1);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.tinda-notif:focus-within {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.tinda-notif-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .tinda-notif,
    .tinda-notif-close,
    .tinda-notif-action-btn {
        transition: none;
    }

    .tinda-notif.tinda-notif-show {
        animation: none;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .tinda-notif-container {
        display: none !important;
    }
}
