/* استایل پیام هشدار کد قرعه‌کشی */
.token-warning-message {
    position: relative;
    animation: warningMessageEntrance 0.6s ease-out;
    box-shadow: 
        0 4px 20px rgba(251, 191, 36, 0.2),
        0 0 30px rgba(251, 191, 36, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.token-warning-message:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 25px rgba(251, 191, 36, 0.3),
        0 0 40px rgba(251, 191, 36, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(251, 191, 36, 0.7);
}

.token-warning-message::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
    animation: warningGlowPulse 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

.token-warning-message > * {
    position: relative;
    z-index: 1;
}

@keyframes warningMessageEntrance {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes warningGlowPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* انیمیشن‌های پایه برای فیلدها */
.interactive-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
}

/* انیمیشن hover - حرکت موس روی فیلد */
.interactive-input:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: rgba(204, 110, 32, 0.5);
    box-shadow: 
        0 4px 20px rgba(204, 110, 32, 0.15),
        0 0 0 1px rgba(204, 110, 32, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
}

/* انیمیشن focus - کلیک روی فیلد */
.interactive-input:focus {
    transform: translateY(-3px) scale(1.02);
    border-color: rgba(204, 110, 32, 0.8);
    box-shadow: 
        0 8px 32px rgba(204, 110, 32, 0.25),
        0 0 0 3px rgba(204, 110, 32, 0.2),
        0 0 20px rgba(204, 110, 32, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(204, 110, 32, 0.15) 0%, rgba(15, 23, 42, 0.95) 100%);
    outline: none;
}

/* انیمیشن برای فیلدهای پر شده */
.interactive-input.filled {
    border-color: rgba(204, 110, 32, 0.6);
    box-shadow: 
        0 4px 16px rgba(204, 110, 32, 0.2),
        0 0 0 1px rgba(204, 110, 32, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(204, 110, 32, 0.1) 0%, rgba(15, 23, 42, 0.9) 100%);
    animation: filledPulse 0.6s ease-out;
}

/* انیمیشن پالس برای فیلدهای پر شده */
@keyframes filledPulse {
    0% {
        box-shadow: 
            0 4px 16px rgba(204, 110, 32, 0.2),
            0 0 0 1px rgba(204, 110, 32, 0.4);
    }
    50% {
        box-shadow: 
            0 6px 24px rgba(204, 110, 32, 0.35),
            0 0 0 2px rgba(204, 110, 32, 0.6),
            0 0 30px rgba(204, 110, 32, 0.2);
    }
    100% {
        box-shadow: 
            0 4px 16px rgba(204, 110, 32, 0.2),
            0 0 0 1px rgba(204, 110, 32, 0.4);
    }
}

/* انیمیشن برای label ها */
.form-label {
    transition: all 0.3s ease;
    display: block;
}

.form-label:hover {
    transform: translateX(-3px);
    color: rgba(255, 255, 255, 0.95);
}

/* انیمیشن برای دکمه */
.submit-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.submit-btn:hover::before {
    width: 300px;
    height: 300px;
}

.submit-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(204, 110, 32, 0.5),
        0 0 20px rgba(204, 110, 32, 0.4);
}

.submit-btn:active {
    transform: translateY(0) scale(0.98);
}

/* انیمیشن برای کارت فرم */
.form-card {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* افکت نور برای فیلدها */
.interactive-input::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s;
}

.interactive-input:hover::after {
    left: 100%;
}

/* انیمیشن برای select ها */
select.interactive-input {
    cursor: pointer;
}

select.interactive-input:hover {
    background-image: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
}

/* انیمیشن برای پیام‌های وضعیت */
.status-message-container {
    position: relative;
    margin-bottom: 1rem;
}

.status-message-content {
    position: relative;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow: hidden;
    animation: messageSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.success-message .status-message-content {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.15) 100%);
    border-color: rgba(34, 197, 94, 0.7);
    box-shadow: 
        0 4px 20px rgba(16, 185, 129, 0.3),
        0 0 30px rgba(16, 185, 129, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: successMessageEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.error-message .status-message-content {
    animation: errorMessageEntrance 0.5s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes successMessageEntrance {
    0% {
        opacity: 0;
        transform: translateY(-40px) scale(0.8) rotate(-5deg);
    }
    50% {
        transform: translateY(5px) scale(1.05) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes errorMessageEntrance {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* آیکون موفقیت */
.success-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.checkmark {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #22c55e;
    stroke-miterlimit: 10;
    animation: checkmarkScale 0.6s ease-in-out 0.4s both;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #22c55e;
    fill: rgba(16, 185, 129, 0.15);
    animation: checkmarkCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #22c55e;
    animation: checkmarkCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes checkmarkCircle {
    0% {
        stroke-dashoffset: 166;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes checkmarkCheck {
    0% {
        stroke-dashoffset: 48;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

@keyframes checkmarkScale {
    0%, 100% {
        transform: none;
    }
    50% {
        transform: scale3d(1.1, 1.1, 1);
    }
}

/* آیکون خطا */
.error-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f87171;
    animation: errorIconShake 0.5s ease-in-out;
}

.error-icon svg {
    width: 32px;
    height: 32px;
}

@keyframes errorIconShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* متن پیام */
.status-text {
    flex: 1;
    position: relative;
    z-index: 1;
}

/* استایل کد ۵ رقمی در پیام موفقیت */
.token-highlight {
    display: inline-block;
    font-weight: 900;
    font-size: 1.1em;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(16, 185, 129, 0.3) 100%);
    padding: 4px 12px;
    border-radius: 8px;
    border: 2px solid rgba(34, 197, 94, 0.6);
    box-shadow: 
        0 0 15px rgba(34, 197, 94, 0.5),
        0 0 30px rgba(16, 185, 129, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 2px 8px rgba(34, 197, 94, 0.6);
    letter-spacing: 2px;
    margin: 0 4px;
    animation: tokenPulse 2s ease-in-out infinite;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes tokenPulse {
    0%, 100% {
        transform: scale(1) translateZ(0);
        box-shadow: 
            0 0 15px rgba(34, 197, 94, 0.5),
            0 0 30px rgba(16, 185, 129, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: scale(1.05) translateZ(0);
        box-shadow: 
            0 0 25px rgba(34, 197, 94, 0.7),
            0 0 45px rgba(16, 185, 129, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

.status-text p {
    margin: 0;
    line-height: 1.6;
}

/* ذرات موفقیت */
.success-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    border-radius: 0.75rem;
}

.success-particles::before,
.success-particles::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #cc6e20;
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 2s ease-out infinite;
}

.success-particles::before {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
    box-shadow: 
        0 0 10px rgba(204, 110, 32, 0.8),
        0 0 20px rgba(204, 110, 32, 0.6),
        0 0 30px rgba(204, 110, 32, 0.4);
}

.success-particles::after {
    top: 60%;
    right: 20%;
    animation-delay: 0.5s;
    box-shadow: 
        0 0 10px rgba(204, 110, 32, 0.8),
        0 0 20px rgba(204, 110, 32, 0.6),
        0 0 30px rgba(204, 110, 32, 0.4);
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(0.5);
    }
}

/* افکت glow برای پیام موفقیت */
.success-message .status-message-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
    animation: glowPulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* انیمیشن pulse برای پیام موفقیت */
.success-message .status-message-content {
    animation: successMessageEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1),
               successPulse 2s ease-in-out 1s infinite;
}

@keyframes successPulse {
    0%, 100% {
        box-shadow: 
            0 4px 20px rgba(204, 110, 32, 0.3),
            0 0 30px rgba(204, 110, 32, 0.15);
    }
    50% {
        box-shadow: 
            0 6px 30px rgba(204, 110, 32, 0.4),
            0 0 40px rgba(204, 110, 32, 0.25);
    }
}

/* افکت شناور برای هدر */
.header-section {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}


/* انیمیشن برای badge های اجباری */
.required-badge {
    transition: all 0.3s ease;
    display: inline-block;
}

.required-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(204, 110, 32, 0.5);
}

/* انیمیشن ripple برای دکمه */
@keyframes ripple {
    to {
        transform: translate(-50%, -50%) scale(20);
        opacity: 0;
    }
}

.ripple-effect {
    animation: ripple 0.6s ease-out;
}

/* انیمیشن برای فیلدهای فوکوس شده */
.field-focused {
    animation: fieldFocus 0.3s ease-out;
}

@keyframes fieldFocus {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* انیمیشن برای کارت فرم هنگام لود */
@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.form-card {
    animation: cardEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* انیمیشن برای هدر */
@keyframes headerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header-section h1 {
    animation: headerFadeIn 1s ease-out;
}

/* انیمیشن برای select ها */
select.interactive-input option {
    background: #1e293b;
    color: #e2e8f0;
}

/* افکت glow برای فیلدهای فعال */
.interactive-input:focus-visible {
    outline: none;
}

/* انیمیشن برای پیام‌های خطا */
.field-validation-error {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* انیمیشن shake برای فیلدهای دارای خطا */
.error-shake {
    animation: inputShake 0.5s ease-in-out;
    border-color: rgba(239, 68, 68, 0.8) !important;
    box-shadow: 
        0 4px 16px rgba(239, 68, 68, 0.2),
        0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0) translateY(-2px) scale(1.01); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px) translateY(-2px) scale(1.01); }
    20%, 40%, 60%, 80% { transform: translateX(3px) translateY(-2px) scale(1.01); }
}

/* افکت موج‌دار برای حرکت موس */
.mouse-wave-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.mouse-wave {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}

.mouse-wave-1 {
    width: 300px;
    height: 300px;
    border: 2px solid rgba(204, 110, 32, 0.3);
    background: radial-gradient(circle, rgba(204, 110, 32, 0.1) 0%, transparent 70%);
    animation: waveExpand1 2s ease-out forwards;
}

.mouse-wave-2 {
    width: 300px;
    height: 300px;
    border: 2px solid rgba(204, 110, 32, 0.25);
    background: radial-gradient(circle, rgba(204, 110, 32, 0.08) 0%, transparent 70%);
    animation: waveExpand2 2.5s ease-out forwards;
}

.mouse-wave-3 {
    width: 300px;
    height: 300px;
    border: 2px solid rgba(204, 110, 32, 0.2);
    background: radial-gradient(circle, rgba(204, 110, 32, 0.06) 0%, transparent 70%);
    animation: waveExpand3 3s ease-out forwards;
}

@keyframes waveExpand1 {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.6;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

@keyframes waveExpand2 {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.5;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        transform: translate(-50%, -50%) scale(3.5);
        opacity: 0;
    }
}

@keyframes waveExpand3 {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.4;
    }
    50% {
        opacity: 0.25;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

/* افکت نور برای موقعیت موس */
.mouse-cursor-glow {
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(204, 110, 32, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

/* اطمینان از اینکه محتوا بالای افکت موج باشد */
section {
    position: relative;
    z-index: 1;
}

body {
    position: relative;
}

/* انیمیشن‌های اضافی برای موج موفقیت و confetti */
@keyframes successWave {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

@keyframes confettiFall {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x), var(--y)) rotate(720deg);
        opacity: 0;
    }
}

/* بهینه‌سازی عملکرد برای موبایل - جلوگیری از لرزش */
@media (max-width: 768px) {
    /* غیرفعال کردن انیمیشن‌های infinite در موبایل */
    .token-warning-message::before {
        animation: none !important;
        opacity: 0.2 !important;
    }
    
    .token-warning-message:hover {
        transform: none;
    }
    
    /* کاهش انیمیشن‌های hover در موبایل */
    .interactive-input:hover {
        transform: none;
    }
    
    .interactive-input:focus {
        transform: translateY(-1px) scale(1.01);
    }
    
    /* بهینه‌سازی GPU */
    .interactive-input {
        will-change: transform, border-color;
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    
    /* کاهش shadow برای عملکرد بهتر */
    .interactive-input:focus {
        box-shadow: 
            0 4px 16px rgba(204, 110, 32, 0.2),
            0 0 0 2px rgba(204, 110, 32, 0.15),
            0 0 10px rgba(204, 110, 32, 0.1);
    }
    
    /* غیرفعال کردن افکت mouse wave و cursor glow در موبایل */
    .mouse-wave {
        display: none !important;
    }
    
    .mouse-cursor-glow {
        display: none !important;
    }
    
    /* بهینه‌سازی body و html */
    html, body {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    /* کاهش انیمیشن‌های transition */
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* بهینه‌سازی برای المان‌های دارای انیمیشن */
    section {
        will-change: auto;
    }
    
    /* بهینه‌سازی پیغام موفقیت در موبایل */
    .success-message .status-message-content {
        /* ساده‌سازی انیمیشن ورود - حذف rotate و scale پیچیده */
        animation: messageSlideIn 0.4s ease-out !important;
        will-change: transform, opacity;
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    
    /* غیرفعال کردن انیمیشن glow pulse در موبایل */
    .success-message .status-message-content::before {
        animation: none !important;
        opacity: 0.2 !important;
    }
    
    /* بهینه‌سازی checkmark */
    .checkmark {
        will-change: transform;
        transform: translateZ(0);
    }
    
    .checkmark-circle {
        animation: checkmarkCircle 0.4s cubic-bezier(0.65, 0, 0.45, 1) forwards;
    }
    
    .checkmark-check {
        animation: checkmarkCheck 0.2s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
    }
    
    /* غیرفعال کردن انیمیشن scale checkmark در موبایل */
    .checkmark {
        animation: none !important;
    }
    
    /* غیرفعال کردن انیمیشن particles در موبایل */
    .success-particles::before,
    .success-particles::after {
        animation: none !important;
        opacity: 0 !important;
    }
    
    /* کاهش shadow برای عملکرد بهتر */
    .success-message .status-message-content {
        box-shadow: 
            0 2px 10px rgba(16, 185, 129, 0.2),
            0 0 15px rgba(16, 185, 129, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    
    /* بهینه‌سازی error message */
    .error-message .status-message-content {
        animation: messageSlideIn 0.4s ease-out !important;
        will-change: transform, opacity;
        transform: translateZ(0);
    }
    
    .error-icon {
        animation: none !important;
    }
}

