/**
 * WooCommerce Mobile Authentication CSS
 */

/* مودال احراز هویت موبایل */
.wc-mobile-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-mobile-auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.wc-mobile-auth-content {
    position: relative;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: wc-slideUp 0.3s ease-out;
}

@keyframes wc-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wc-mobile-auth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e1e5e9;
}

.wc-mobile-auth-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.wc-mobile-auth-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.wc-mobile-auth-close:hover {
    background: #f5f5f5;
    color: #333;
}

.wc-mobile-auth-body {
    padding: 25px;
}

.wc-mobile-auth-step {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wc-form-group {
    text-align: right;
}

.wc-form-group label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.wc-input-group {
    display: flex;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.wc-input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wc-country-code {
    background: #f8f9fa;
    padding: 12px 15px;
    color: #666;
    font-weight: 600;
    border-left: 1px solid #e1e5e9;
    font-size: 16px;
    display: flex;
    align-items: center;
}

.wc-input-group input {
    flex: 1;
    border: none;
    padding: 12px 15px;
    font-size: 16px;
    outline: none;
    background: white;
}

.wc-input-group input::placeholder {
    color: #999;
}

.wc-otp-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.wc-otp-digit {
    width: 45px;
    height: 45px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
}

.wc-otp-digit:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wc-otp-digit.filled {
    border-color: #667eea;
    background: #f8f9ff;
}

.wc-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    width: 100%;
}

.wc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wc-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.wc-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.wc-btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 2px solid #e1e5e9;
}

.wc-btn-secondary:hover:not(:disabled) {
    background: #e9ecef;
    border-color: #dee2e6;
}

.wc-btn-link {
    background: none;
    color: #667eea;
    padding: 5px 10px;
    font-size: 14px;
    text-decoration: underline;
    width: auto;
}

.wc-btn-link:hover:not(:disabled) {
    color: #5a6fd8;
}

.wc-resend-section {
    text-align: center;
    margin: 15px 0;
}

.wc-resend-section p {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.wc-error-message {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
    text-align: right;
    min-height: 16px;
    display: none;
}

.wc-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: wc-spin 1s ease-in-out infinite;
}

@keyframes wc-spin {
    to { transform: rotate(360deg); }
}

/* دکمه ورود با موبایل در فرم ورود */
.wc-mobile-auth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.wc-mobile-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e1e5e9;
}

.wc-mobile-auth-divider span {
    background: white;
    padding: 0 15px;
    color: #666;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

.wc-mobile-auth-login-btn {
    width: 100%;
    margin-top: 10px;
}

/* فیلد موبایل در فرم‌های ووکامرس */
.woocommerce-form-row input[type="tel"] {
    direction: ltr;
    text-align: left;
}

.woocommerce-form-row input[type="tel"]::placeholder {
    direction: rtl;
    text-align: right;
}

/* ریسپانسیو */
@media (max-width: 480px) {
    .wc-mobile-auth-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .wc-mobile-auth-header {
        padding: 15px 20px;
    }
    
    .wc-mobile-auth-body {
        padding: 20px;
    }
    
    .wc-mobile-auth-header h3 {
        font-size: 18px;
    }
    
    .wc-otp-digit {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .wc-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* پشتیبانی از RTL */
[dir="rtl"] .wc-input-group {
    flex-direction: row-reverse;
}

[dir="rtl"] .wc-country-code {
    border-left: none;
    border-right: 1px solid #e1e5e9;
}

[dir="rtl"] .wc-otp-inputs {
    flex-direction: row-reverse;
}

/* استایل‌های اضافی برای ووکامرس */
.woocommerce .wc-mobile-auth-modal {
    font-family: inherit;
}

.woocommerce .wc-mobile-auth-content {
    font-family: inherit;
}

.woocommerce .wc-mobile-auth-header h3 {
    font-family: inherit;
}

/* انیمیشن‌های اضافی */
.wc-mobile-auth-step {
    transition: all 0.3s ease;
}

.wc-mobile-auth-step:not(.active) {
    opacity: 0;
    transform: translateX(20px);
}

.wc-mobile-auth-step.active {
    opacity: 1;
    transform: translateX(0);
}

/* استایل‌های دکمه‌های ووکامرس */
.woocommerce .wc-btn {
    font-family: inherit;
    line-height: 1.4;
}

.woocommerce .wc-btn i {
    font-size: 14px;
}

/* بهبود ظاهر در حالت تاریک */
@media (prefers-color-scheme: dark) {
    .wc-mobile-auth-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .wc-mobile-auth-header {
        border-bottom-color: #4a5568;
    }
    
    .wc-mobile-auth-header h3 {
        color: #e2e8f0;
    }
    
    .wc-mobile-auth-close {
        color: #a0aec0;
    }
    
    .wc-mobile-auth-close:hover {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .wc-form-group label {
        color: #e2e8f0;
    }
    
    .wc-input-group {
        border-color: #4a5568;
        background: #4a5568;
    }
    
    .wc-input-group input {
        background: #4a5568;
        color: #e2e8f0;
    }
    
    .wc-country-code {
        background: #2d3748;
        color: #a0aec0;
        border-left-color: #4a5568;
    }
    
    .wc-otp-digit {
        background: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .wc-otp-digit:focus {
        border-color: #667eea;
        background: #4a5568;
    }
    
    .wc-otp-digit.filled {
        border-color: #667eea;
        background: #2d3748;
    }
}
