/**
 * KaiAlert CSS - سیستم پاپ‌آپ جذاب فارسی
 * نسخه: 1.0.0
 */
@font-face {
    font-family: Vazir;
    src: url("../font/Vazir.ttf");
}
/* Overlay اصلی */
.kaialert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    direction: rtl;
    font-family: Vazir!important;
    backdrop-filter: blur(3px);
}

.kaialert-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* کانتینر اصلی پاپ‌آپ */
.kaialert-container {
    background: linear-gradient(145deg, #ffffff, #f8f9ff);
    border-radius: 25px;
    padding: 35px 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow:
            0 25px 80px rgba(0, 0, 0, 0.15),
            0 12px 30px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: scale(0.6) translateY(100px) rotateX(15deg);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.kaialert-overlay.show .kaialert-container {
    transform: scale(1) translateY(0) rotateX(0deg);
}

/* آیکون */
.kaialert-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
    font-weight: bold;
    animation: kaialert-icon-bounce 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    position: relative;
}

.kaialert-icon::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    background: inherit;
    filter: blur(10px);
    opacity: 0.3;
    z-index: -1;
}

.kaialert-icon.success {
    padding-top: 10px;
    background: linear-gradient(135deg, #4ffe8c 0%, #00fe6e 100%);
    color: white;
}

.kaialert-icon.error {
    padding-top: 10px;
    background: linear-gradient(135deg, #ff3e3e 0%, #ee3c24 100%);
    color: white;
}

.kaialert-icon.warning {
    background: linear-gradient(135deg, #feca57 0%, #ffe49f 100%);
    color: white;
}

.kaialert-icon.info {
    padding-top: 12px;
    background: linear-gradient(135deg, #667eea 0%, #4655a4 100%);
    color: white;
}

@keyframes kaialert-icon-bounce {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(0deg);
        opacity: 0.8;
    }
    80% {
        transform: scale(0.9) rotate(10deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* عنوان */
.kaialert-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 18px;
    color: #2c3e50;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

/* متن */
.kaialert-text {
    font-size: 16px;
    color: #546e7a;
    margin-bottom: 30px;
    line-height: 1.6;
    font-weight: 400;
}

/* دکمه بستن */
.kaialert-close {
    background: linear-gradient(145deg, #b1b8be, #aaaeb7);
    border: none;
    padding: 14px 35px;
    border-radius: 30px;
    cursor: pointer;
    font-family: Vazir;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    color: #192023;
    position: relative;
    overflow: hidden;
}

.kaialert-close::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.kaialert-close:hover::before {
    left: 100%;
}

.kaialert-close:hover {
    background: linear-gradient(145deg, #d8d9e1, #c9bebe);
    transform: translateY(-2px);
}

.kaialert-close:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* حالت Small - پاپ‌آپ کوچک */
.kaialert-container.small {
    max-width: 280px;
    padding: 20px;
    border-radius: 15px;
}

.kaialert-container.small .kaialert-icon {
    display: none;
}

.kaialert-container.small .kaialert-title {
    font-size: 18px;
    margin-bottom: 10px;
}

.kaialert-container.small .kaialert-text {
    font-size: 14px;
    margin-bottom: 15px;
}

.kaialert-container.small .kaialert-close {
    padding: 10px 25px;
    font-size: 13px;
}

/* مخفی کردن دکمه بستن */
.kaialert-close.hidden {
    display: none;
}

/* Progress Bar */
.kaialert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: kaialert-progress-shimmer 2s linear infinite;
    border-radius: 0 0 25px 25px;
    box-shadow: 0 -2px 10px rgba(102, 126, 234, 0.3);
}

@keyframes kaialert-progress-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* کاغذ رنگی - Confetti */
.kaialert-confetti {
    position: fixed;
    width: 12px;
    height: 12px;
    z-index: 100001;
    pointer-events: none;
    animation: kaialert-confetti-fall linear forwards;
    opacity: 0.9;
}

@keyframes kaialert-confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* اشکال پس‌زمینه */
.kaialert-container::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent 70%);
    border-radius: 50%;
    animation: kaialert-float-1 4s ease-in-out infinite;
}

.kaialert-container::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 70%);
    border-radius: 50%;
    animation: kaialert-float-2 3s ease-in-out infinite;
}

@keyframes kaialert-float-1 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(180deg); }
}

@keyframes kaialert-float-2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(-180deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .kaialert-container {
        width: 95%;
        padding: 30px 25px;
    }

    .kaialert-title {
        font-size: 24px;
    }

    .kaialert-text {
        font-size: 15px;
    }

    .kaialert-icon {
        width: 75px;
        height: 75px;
        font-size: 35px;
    }
}

/* حالت تاریک - فقط وقتی کلاس اضافه بشه */
.kaialert-dark-theme .kaialert-container {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.kaialert-dark-theme .kaialert-title {
    color: #ecf0f1;
}

.kaialert-dark-theme .kaialert-text {
    color: #bdc3c7;
}

.kaialert-dark-theme .kaialert-close {
    background: linear-gradient(145deg, #213036, #17232a);
    color: #ecf0f1;
}

.kaialert-dark-theme .kaialert-close:hover {
    background: linear-gradient(145deg, #3c5670, #2c3e50);
}