/**
 * AI Domain Assistant Stylesheet
 * 
 * استایل‌های مخصوص دستیار هوشمند انتخاب دامنه
 * سازگار با قالب TeslaServer
 * 
 * @package WHMCS TeslaServer Template
 * @subpackage AI Domain Assistant
 */

/* =====================================
   ایکن روبات AI کنار باکس جستجو
   ===================================== */

.domain-checker-container {
    position: relative;
}

.ai-robot-trigger {
    position: absolute;
    right: auto;
    left: -96px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #1e90ff 0%, #0066cc 100%);
    border: 3px solid #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(30, 144, 255, 0.6), 0 0 40px rgba(30, 144, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    animation: robotGlow 3s ease-in-out infinite;
}

@keyframes robotGlow {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(30, 144, 255, 0.6), 0 0 40px rgba(30, 144, 255, 0.3);
    }
    50% {
        box-shadow: 0 8px 30px rgba(30, 144, 255, 0.8), 0 0 60px rgba(30, 144, 255, 0.5);
    }
}

.ai-robot-trigger:hover {
    transform: translateY(-50%) scale(1.15) rotate(5deg);
    box-shadow: 0 12px 35px rgba(30, 144, 255, 0.8), 0 0 80px rgba(30, 144, 255, 0.6);
    background: linear-gradient(135deg, #0066cc 0%, #1e90ff 100%);
    border-color: #fff;
}

.ai-robot-trigger:active {
    transform: translateY(-50%) scale(1.05) rotate(-5deg);
}

.ai-robot-trigger i {
    font-size: 36px;
    color: #ffffff;
    animation: robotPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes robotPulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.15) rotate(-8deg);
    }
    50% {
        transform: scale(1.05) rotate(0deg);
    }
    75% {
        transform: scale(1.15) rotate(8deg);
    }
}

.ai-robot-trigger:hover i {
    animation: robotBounce 0.6s ease-in-out infinite;
}

@keyframes robotBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(-10deg);
    }
    75% {
        transform: translateY(-8px) rotate(10deg);
    }
}

/* Badge برای نشان دادن تعداد درخواست‌های باقیمانده */
.ai-robot-trigger .ai-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 15px;
    min-width: 24px;
    text-align: center;
    border: 2px solid white;
    box-shadow: 0 3px 12px rgba(255, 71, 87, 0.6);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        box-shadow: 0 4px 16px rgba(255, 71, 87, 0.8);
    }
}

/* Tooltip سفارشی */
.ai-robot-trigger[data-toggle="tooltip"] {
    position: relative;
}

/* تنظیم موقعیت در صفحات مختلف */
.domain-checker-bg {
    position: relative;
}

/* استایل اضافی برای input در domain checker با پس‌زمینه آبی */
.domain-checker-bg .form-control {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.domain-checker-bg .form-control:focus {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.15);
}

/* دکمه جستجو با استایل بهتر */
.domain-checker-bg .btn-primary {
    background: linear-gradient(135deg, #0066cc 0%, #004c99 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.domain-checker-bg .btn-primary:hover {
    background: linear-gradient(135deg, #004c99 0%, #0066cc 100%);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

/* برای موبایل - دکمه در موقعیت مشخص */
@media (max-width: 768px) {
    .ai-robot-trigger {
        position: absolute;
        right: auto;
        left: 11px;
        top: 91%;
        transform: translateY(-50%);
        width: 60px;
        height: 60px;
    }
    
    .ai-robot-trigger i {
        font-size: 30px;
    }
    
    .ai-robot-trigger .ai-badge {
        font-size: 12px;
        padding: 3px 6px;
        top: 2px;
        right: 2px;
    }
}

/* =====================================
   افکت‌های ویژه برای مودال
   ===================================== */

#aiDomainSuggestionModal .modal-dialog {
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#aiDomainSuggestionModal .modal-content {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

#aiDomainSuggestionModal .modal-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-bottom: none;
    padding: 20px 30px;
}

#aiDomainSuggestionModal .modal-title {
    font-weight: 600;
    font-size: 22px;
    display: flex;
    align-items: center;
}

#aiDomainSuggestionModal .modal-title i {
    font-size: 28px;
    margin-left: 10px;
    animation: robotRotate 4s linear infinite;
}

@keyframes robotRotate {
    0% {
        transform: rotate(0deg);
    }
    10% {
        transform: rotate(15deg);
    }
    20% {
        transform: rotate(-15deg);
    }
    30% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

#aiDomainSuggestionModal .modal-body {
    padding: 30px;
    background: #f8f9fa;
}

#aiDomainSuggestionModal .modal-footer {
    border-top: 1px solid #e0e0e0;
    background: #ffffff;
}

/* =====================================
   بخش فرم ورودی
   ===================================== */

#aiUserPrompt {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    font-size: 15px;
    transition: all 0.3s ease;
    resize: vertical;
}

#aiUserPrompt:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

#charCount {
    font-weight: 600;
    color: #007bff;
}

#aiSubmitBtn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#aiSubmitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

#aiSubmitBtn:active {
    transform: translateY(0);
}

#aiSubmitBtn::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;
}

#aiSubmitBtn:hover::before {
    width: 300px;
    height: 300px;
}

/* =====================================
   بخش لودینگ
   ===================================== */

#aiLoadingSection {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.ai-loader i {
    animation: robotWave 2s ease-in-out infinite;
    color: #007bff !important;
}

@keyframes robotWave {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-10deg);
    }
    75% {
        transform: rotate(10deg);
    }
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* =====================================
   بخش نتایج
   ===================================== */

#aiResultsSection {
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-domains-list {
    max-height: 500px;
    overflow-y: auto;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
}

.ai-domain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    margin-bottom: 8px;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    transition: all 0.3s ease;
    animation: domainItemSlide 0.5s ease-out backwards;
}

.ai-domain-item:nth-child(1) { animation-delay: 0.05s; }
.ai-domain-item:nth-child(2) { animation-delay: 0.1s; }
.ai-domain-item:nth-child(3) { animation-delay: 0.15s; }
.ai-domain-item:nth-child(4) { animation-delay: 0.2s; }
.ai-domain-item:nth-child(5) { animation-delay: 0.25s; }
.ai-domain-item:nth-child(6) { animation-delay: 0.3s; }
.ai-domain-item:nth-child(7) { animation-delay: 0.35s; }
.ai-domain-item:nth-child(8) { animation-delay: 0.4s; }
.ai-domain-item:nth-child(9) { animation-delay: 0.45s; }
.ai-domain-item:nth-child(10) { animation-delay: 0.5s; }

@keyframes domainItemSlide {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ai-domain-item:hover {
    border-color: #007bff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
    transform: translateX(-5px);
}

.ai-domain-item:last-child {
    margin-bottom: 0;
}

.ai-domain-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ai-domain-name {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-domain-name i {
    color: #007bff;
    font-size: 18px;
    flex-shrink: 0;
}

.domain-text {
    margin-right: 8px;
    direction: ltr;
    text-align: left;
}

.domain-explanation {
    font-size: 10px;
    line-height: 1.3;
    color: #6c757d;
    font-weight: 400;
    margin-top: 3px;
    margin-right: 0;
    padding-right: 26px;
    font-style: italic;
    opacity: 0.85;
    text-align: right;
    direction: rtl;
}

.ai-domain-action {
    margin-right: 15px;
}

.ai-check-domain-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    padding: 8px 20px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ai-check-domain-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

.ai-check-domain-btn:active {
    transform: translateY(0);
}

/* Scrollbar سفارشی */
.ai-domains-list::-webkit-scrollbar {
    width: 10px;
}

.ai-domains-list::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 10px;
}

.ai-domains-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #007bff 0%, #0056b3 100%);
    border-radius: 10px;
}

.ai-domains-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0056b3 0%, #007bff 100%);
}

/* =====================================
   دکمه‌های اکشن
   ===================================== */

#aiMoreSuggestionsBtn,
#aiNewSearchBtn {
    font-weight: 600;
    padding: 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

#aiMoreSuggestionsBtn {
    border: 2px solid #007bff;
    color: #007bff;
}

#aiMoreSuggestionsBtn:hover {
    background: #007bff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

#aiNewSearchBtn {
    border: 2px solid #95a5a6;
    color: #95a5a6;
}

#aiNewSearchBtn:hover {
    background: #95a5a6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* =====================================
   بخش خطا
   ===================================== */

#aiErrorSection {
    border-radius: 10px;
    border: 2px solid #ff4757;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

#aiRetryBtn {
    margin-top: 10px;
}

/* =====================================
   Alert های سفارشی
   ===================================== */

.alert {
    border-radius: 10px;
    border: none;
    padding: 15px 20px;
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-right: 4px solid #2196f3;
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-right: 4px solid #4caf50;
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-right: 4px solid #f44336;
}

/* =====================================
   Rate Limit Info
   ===================================== */

#aiRateLimitInfo {
    padding: 10px;
    background: #fff3cd;
    border-radius: 8px;
    display: inline-block;
}

#remainingRequests {
    color: #007bff;
    font-size: 16px;
}

/* =====================================
   Responsive Design
   ===================================== */

@media (max-width: 992px) {
    #aiDomainSuggestionModal .modal-lg {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    #aiDomainSuggestionModal .modal-body {
        padding: 20px;
    }
    
    .ai-domain-item {
        flex-direction: column;
        text-align: center;
        padding: 12px 15px;
    }
    
    .ai-domain-content {
        width: 100%;
        align-items: center;
    }
    
    .ai-domain-name {
        justify-content: center;
        margin-bottom: 4px;
    }
    
    .domain-explanation {
        text-align: right;
        margin-right: 0;
        padding-right: 0;
        margin-bottom: 8px;
        max-width: 100%;
        font-size: 9px;
        direction: rtl;
    }
    
    .ai-domain-action {
        margin-right: 0;
        width: 100%;
    }
    
    .ai-check-domain-btn {
        width: 100%;
    }
    
    #aiSubmitBtn {
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .ai-robot-trigger {
        width: 55px;
        height: 55px;
        position: absolute;
        right: auto;
        left: 11px;
        top: 91%;
        transform: translateY(-50%);
    }
    
    .ai-robot-trigger i {
        font-size: 26px;
    }
    
    .ai-robot-trigger .ai-badge {
        font-size: 11px;
        padding: 2px 5px;
    }
    
    #aiDomainSuggestionModal .modal-title {
        font-size: 18px;
    }
    
    #aiDomainSuggestionModal .modal-title i {
        font-size: 22px;
    }
}

/* =====================================
   RTL Support
   ===================================== */

[dir="rtl"] .ai-robot-trigger {
    right: auto;
    left: -96px;
}

[dir="rtl"] .ai-domain-item:hover {
    transform: translateX(5px);
}

[dir="rtl"] .ai-domain-name i {
    margin-left: 0;
    margin-right: 12px;
}

/* =====================================
   Dark Mode Support (اختیاری)
   ===================================== */

@media (prefers-color-scheme: dark) {
    #aiDomainSuggestionModal .modal-content {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    #aiDomainSuggestionModal .modal-body {
        background: #34495e;
    }
    
    .ai-domains-list {
        background: #2c3e50;
        border-color: #34495e;
    }
    
    .ai-domain-item {
        background: #34495e;
        border-color: #4a5f7f;
        color: #ecf0f1;
    }
    
    #aiUserPrompt {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5f7f;
    }
}

/* =====================================
   Print Styles
   ===================================== */

@media print {
    .ai-robot-trigger,
    #aiDomainSuggestionModal {
        display: none !important;
    }
}

/* =====================================
   Accessibility Improvements
   ===================================== */

.ai-robot-trigger:focus,
.ai-check-domain-btn:focus,
#aiSubmitBtn:focus {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* برای کاربران که موشن کاهش یافته را ترجیح می‌دهند */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

