﻿/* استایل‌های سفارشی برای Select2 */
.select2-container {
    width: 100% !important;
    direction: rtl !important;
}

.select2-container--default .select2-selection--single {
    border: none !important;
    background: transparent !important;
    height: auto !important;
    padding: 0 !important;
    outline: none !important;
}

    .select2-container--default .select2-selection--single .select2-selection__rendered {
        color: #374151 !important;
        line-height: 1.8 !important;
        padding-right: 0 !important;
        font-size: 16px !important;
        text-align: right !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__placeholder {
        color: #9CA3AF !important;
    }

    .select2-container--default .select2-selection--single .select2-selection__arrow {
        display: none !important;
    }

/* Dropdown styles - مهم: حذف استایل input اضافی */
.select2-dropdown {
    border: 1px solid #E5E7EB !important;
    border-radius: 12px !important;
    margin-top: 8px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    text-align: right !important;
    overflow: hidden;
}

.select2-container--default .select2-search--dropdown {
    padding: 8px !important;
    background: #f9fafb !important;
    border-bottom: 1px solid #e5e7eb !important;
}

    .select2-container--default .select2-search--dropdown .select2-search__field {
        border: 2px solid #E5E7EB !important;
        border-radius: 8px !important;
        padding: 10px 12px !important;
        margin: 0 !important;
        font-size: 16px !important;
        text-align: right !important;
        width: 100% !important;
        background: white !important;
    }

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #EFF6FF !important;
    color: #2563EB !important;
}

.select2-results__option {
    padding: 12px 16px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    transition: all 0.2s ease !important;
}

    .select2-results__option:last-child {
        border-bottom: none !important;
    }

.select2-results__option--selectable:hover {
    background-color: #f9fafb !important;
}

/* Animation for search box */
#search-container {
    transition: all 0.3s ease;
}

    #search-container:focus-within {
        transform: translateY(-1px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

/* Loading animation */
.select2-results__option--loading {
    text-align: center;
    padding: 20px !important;
    color: #6B7280 !important;
}

    .select2-results__option--loading::after {
        content: "🔍";
        animation: pulse 1.5s infinite;
        display: inline-block;
        margin-right: 8px;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

/* حذف استایل‌های اضافی که باعث نمایش input تکراری می‌شوند */
.select2-hidden-accessible {
    border: 0 !important;
    clip: rect(0 0 0 0) !important;
    height: 1px !important;
    margin: -1px !important;
    overflow: hidden !important;
    padding: 0 !important;
    position: absolute !important;
    width: 1px !important;
}



/* لینک استوک - نور گردان */
.stock-link {
    position: relative;
    background: linear-gradient(90deg, #fff, #f9fafb);
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
}

    .stock-link::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: conic-gradient(from 0deg, rgba(14, 165, 233, 0), rgba(14, 165, 233, 0.3), rgba(56, 189, 248, 0.8), rgba(14, 165, 233, 0.3), rgba(14, 165, 233, 0));
        animation: rotateLight 2s linear infinite;
        z-index: 0;
        pointer-events: none;
    }

@keyframes rotateLight {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.stock-link a {
    position: relative;
    z-index: 2;
    display: block;
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: #0c4a6e;
}

.stock-link:hover {
    background: linear-gradient(90deg, #f0f9ff, #e0f2fe);
    transform: scale(1.02);
}



/* ===== انیمیشن آتشین ترکیبی برای گارانتی ویژه ===== */
.warranty-link {
    position: relative;
    display: inline-block;
    font-weight: 700;
    padding: 0 8px;
}

    .warranty-link .warranty-text {
        background: linear-gradient(90deg, #FF6B35, #FF4500, #FF6B35, #FFD700, #FF6B35);
        background-size: 300% 100%;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
        animation: fireShine 3s ease-in-out infinite;
        display: inline-block;
    }

    .warranty-link .fire-emoji {
        display: inline-block;
        animation: fireDance 0.8s ease-in-out infinite alternate;
        -webkit-text-fill-color: initial;
    }

    .warranty-link::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        width: 100%;
        height: 2px;
        background: linear-gradient(90deg, transparent, #FF6B35, #FF4500, #FFD700, #FF6B35, transparent);
        background-size: 300% 100%;
        animation: fireLine 2s ease-in-out infinite;
        border-radius: 2px;
    }

    .warranty-link::before {
        content: '';
        position: absolute;
        top: -4px;
        left: 50%;
        transform: translateX(-50%);
        width: 30px;
        height: 30px;
        background: radial-gradient(circle, rgba(255, 107, 53, 0.15), transparent 70%);
        border-radius: 50%;
        animation: fireGlow 2s ease-in-out infinite;
        pointer-events: none;
    }

@keyframes fireShine {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes fireLine {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes fireDance {
    0% {
        transform: scale(1) rotate(0deg) translateY(0);
    }

    50% {
        transform: scale(1.2) rotate(-5deg) translateY(-3px);
    }

    100% {
        transform: scale(1) rotate(5deg) translateY(0);
    }
}

@keyframes fireGlow {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.5);
    }
}
