/**
 * استایل فرانت‌اند - نسخه 2
 *
 * @package WP_Warranty_System
 */

/* متغیرها */
.wpws-style-v2 {
    --wpws-primary: #FF7F00;
    --wpws-primary-light: #FF9F40;
    --wpws-primary-dark: #E67300;
    --wpws-secondary: #0062FF;
    --wpws-secondary-light: #3D8BFF;
    --wpws-secondary-dark: #0052D9;
    --wpws-success: #10B981;
    --wpws-warning: #F59E0B;
    --wpws-error: #EF4444;
    --wpws-bg: #FFFFFF;
    --wpws-bg-light: #F8F9FA;
    --wpws-text: #2C3E50;
    --wpws-text-light: #64748B;
    --wpws-border: #E2E8F0;
}

/* ========================================
   Container اصلی
======================================== */
.wpws-style-v2.wpws-warranty-check {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    direction: rtl;
    text-align: center;
    box-sizing: border-box;
}

.wpws-style-v2.wpws-warranty-check *,
.wpws-style-v2.wpws-warranty-check *::before,
.wpws-style-v2.wpws-warranty-check *::after {
    box-sizing: border-box;
}

/* ========================================
   عنوان و توضیحات
======================================== */
.wpws-style-v2 .wpws-form-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--wpws-text);
    text-align: center;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.wpws-style-v2 .wpws-form-description {
    font-size: 17px;
    color: var(--wpws-text-light);
    text-align: center;
    margin: 0 0 40px 0;
    line-height: 1.6;
}

/* ========================================
   فرم - Input و Button کنار هم
======================================== */
.wpws-style-v2 .wpws-warranty-form {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 0;
    background: none;
    box-shadow: none;
    border: none;
}

.wpws-style-v2 .wpws-input-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.wpws-style-v2 .wpws-input-group {
    flex: 1;
    max-width: 400px;
}

.wpws-style-v2 .wpws-input {
    width: 100%;
    padding: 18px 24px;
    font-size: 17px;
    color: var(--wpws-text);
    background: var(--wpws-bg);
    border: 2px solid var(--wpws-border);
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    outline: none;
}

.wpws-style-v2 .wpws-input:focus {
    border-color: var(--wpws-primary);
    box-shadow: 0 0 0 4px rgba(255, 127, 0, 0.15);
}

.wpws-style-v2 .wpws-input::placeholder {
    color: #A0AEC0;
}

/* ========================================
   دکمه - کنار Input
======================================== */
.wpws-style-v2 .wpws-button {
    flex-shrink: 0;
    padding: 18px 45px;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--wpws-primary), var(--wpws-primary-dark));
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(255, 127, 0, 0.3);
}

.wpws-style-v2 .wpws-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 127, 0, 0.4);
}

.wpws-style-v2 .wpws-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.wpws-style-v2 .wpws-button .wpws-btn-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wpws-style-v2 .wpws-button .wpws-btn-loading {
    display: none;
    align-items: center;
    gap: 8px;
}

.wpws-style-v2 .wpws-button.loading .wpws-btn-text {
    display: none;
}

.wpws-style-v2 .wpws-button.loading .wpws-btn-loading {
    display: inline-flex;
}

.wpws-style-v2 .wpws-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wpws-spin 0.8s linear infinite;
}

@keyframes wpws-spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   نتیجه
======================================== */
.wpws-style-v2 .wpws-result {
    max-width: 800px;
    margin: 40px auto 0;
    display: none;
}

.wpws-style-v2 .wpws-result-box {
    background: var(--wpws-bg);
    padding: 45px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--wpws-border);
    text-align: center;
}

/* آیکون */
.wpws-style-v2 .wpws-result-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.wpws-style-v2 .wpws-result-icon svg {
    width: 55px;
    height: 55px;
}

.wpws-style-v2 .wpws-icon-success {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: var(--wpws-success);
}

.wpws-style-v2 .wpws-icon-error {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: var(--wpws-error);
}

.wpws-style-v2 .wpws-icon-warning {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: var(--wpws-warning);
}

/* عنوان نتیجه */
.wpws-style-v2 .wpws-result-title {
    font-size: 28px;
    font-weight: 800;
    margin: 20px 0 30px;
    color: var(--wpws-text);
}

.wpws-style-v2 .wpws-result-active .wpws-result-title {
    color: var(--wpws-success);
}

.wpws-style-v2 .wpws-result-expired .wpws-result-title {
    color: var(--wpws-error);
}

.wpws-style-v2 .wpws-result-unused .wpws-result-title {
    color: var(--wpws-warning);
}

/* ========================================
   محصول
======================================== */
.wpws-style-v2 .wpws-result-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 30px;
    background: var(--wpws-bg-light);
    border-radius: 16px;
    border: 2px solid var(--wpws-border);
}

.wpws-style-v2 .wpws-result-product img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 16px;
    border: 3px solid var(--wpws-border);
}

.wpws-style-v2 .wpws-product-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.wpws-style-v2 .wpws-product-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--wpws-text);
}

.wpws-style-v2 .wpws-product-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--wpws-secondary), var(--wpws-secondary-dark));
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.wpws-style-v2 .wpws-product-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 98, 255, 0.35);
}

.wpws-style-v2 .wpws-product-link::after {
    content: '←';
}

/* ========================================
   جزئیات - دو ستونه
======================================== */
.wpws-style-v2 .wpws-result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 30px auto;
    max-width: 650px;
    text-align: right;
}

.wpws-style-v2 .wpws-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    background: var(--wpws-bg-light);
    border-radius: 12px;
    border: 1px solid var(--wpws-border);
}

.wpws-style-v2 .wpws-detail-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--wpws-text-light);
}

.wpws-style-v2 .wpws-detail-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--wpws-text);
}

.wpws-style-v2 .wpws-detail-value.wpws-highlight {
    color: var(--wpws-success);
}

.wpws-style-v2 .wpws-code-value {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #FFF5E6, #FFE8CC);
    padding: 6px 14px;
    border-radius: 8px;
    color: var(--wpws-primary);
    font-weight: 800;
    letter-spacing: 2px;
    border: 2px solid rgba(255, 127, 0, 0.25);
}

/* ========================================
   نوار پیشرفت
======================================== */
.wpws-style-v2 .wpws-progress-wrapper {
    margin: 30px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.wpws-style-v2 .wpws-progress-bar {
    height: 14px;
    background: var(--wpws-border);
    border-radius: 7px;
    overflow: hidden;
}

.wpws-style-v2 .wpws-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wpws-success), #34D399);
    border-radius: 7px;
    transition: width 1.5s ease;
}

.wpws-style-v2 .wpws-progress-text {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--wpws-text-light);
}

/* ========================================
   پیام
======================================== */
.wpws-style-v2 .wpws-result-message {
    padding: 18px 25px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin: 25px 0;
    line-height: 1.8;
}

.wpws-style-v2 .wpws-success-message {
    background: #D1FAE5;
    color: #065F46;
    border: 2px solid #6EE7B7;
}

.wpws-style-v2 .wpws-error-message {
    background: #FEE2E2;
    color: #991B1B;
    border: 2px solid #FCA5A5;
}

.wpws-style-v2 .wpws-warning-message {
    background: #FEF3C7;
    color: #92400E;
    border: 2px solid #FCD34D;
}

/* ========================================
   یادداشت
======================================== */
.wpws-style-v2 .wpws-result-notes {
    margin: 25px 0;
    padding: 22px 28px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 2px solid rgba(245, 158, 11, 0.3);
    border-radius: 14px;
    text-align: right;
}

.wpws-style-v2 .wpws-result-notes h4 {
    margin: 0 0 12px 0;
    color: var(--wpws-warning);
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpws-style-v2 .wpws-result-notes h4::before {
    content: '📝';
    font-size: 20px;
}

.wpws-style-v2 .wpws-result-notes p {
    margin: 0;
    color: var(--wpws-text);
    line-height: 1.9;
    font-size: 15px;
}

/* ========================================
   فرم ثبت گارانتی
======================================== */
.wpws-style-v2 .wpws-register-form {
    max-width: 500px;
    margin: 30px auto 0;
    padding: 30px;
    background: var(--wpws-bg-light);
    border-radius: 16px;
    border: 2px solid var(--wpws-border);
    text-align: right;
}

.wpws-style-v2 .wpws-register-form h4 {
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    margin: 0 0 25px 0;
    color: var(--wpws-text);
}

.wpws-style-v2 .wpws-register-form .wpws-form-group {
    margin-bottom: 18px;
}

.wpws-style-v2 .wpws-register-form label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--wpws-text);
    margin-bottom: 8px;
}

.wpws-style-v2 .wpws-register-form .wpws-input {
    text-align: right;
    letter-spacing: normal;
    font-family: inherit;
}

.wpws-style-v2 .wpws-register-form .wpws-button {
    width: 100%;
    margin-top: 10px;
}

.wpws-style-v2 .wpws-button-success {
    background: linear-gradient(135deg, var(--wpws-success), #059669);
}

.wpws-style-v2 .wpws-button-success:hover {
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

/* ========================================
   ریسپانسیو
======================================== */
@media screen and (max-width: 768px) {
    .wpws-style-v2.wpws-warranty-check {
        padding: 30px 15px;
    }
    
    .wpws-style-v2 .wpws-form-title {
        font-size: 26px;
    }
    
    .wpws-style-v2 .wpws-input-wrapper {
        flex-direction: column;
        gap: 12px;
    }
    
    .wpws-style-v2 .wpws-input-group {
        width: 100%;
        max-width: 100%;
    }
    
    .wpws-style-v2 .wpws-button {
        width: 100%;
    }
    
    .wpws-style-v2 .wpws-result-box {
        padding: 35px 25px;
    }
    
    .wpws-style-v2 .wpws-result-details {
        grid-template-columns: 1fr;
    }
    
    .wpws-style-v2 .wpws-result-product {
        padding: 25px 20px;
    }
    
    .wpws-style-v2 .wpws-result-product img {
        width: 85px;
        height: 85px;
    }
}

@media screen and (max-width: 480px) {
    .wpws-style-v2 .wpws-form-title {
        font-size: 22px;
    }
    
    .wpws-style-v2 .wpws-input {
        padding: 15px 20px;
        font-size: 15px;
    }
    
    .wpws-style-v2 .wpws-button {
        padding: 15px 30px;
        font-size: 15px;
    }
    
    .wpws-style-v2 .wpws-result-box {
        padding: 30px 18px;
    }
    
    .wpws-style-v2 .wpws-result-icon {
        width: 80px;
        height: 80px;
    }
    
    .wpws-style-v2 .wpws-result-icon svg {
        width: 45px;
        height: 45px;
    }
    
    .wpws-style-v2 .wpws-result-title {
        font-size: 22px;
    }
    
    .wpws-style-v2 .wpws-result-product img {
        width: 75px;
        height: 75px;
    }
    
    .wpws-style-v2 .wpws-product-name {
        font-size: 17px;
    }
    
    .wpws-style-v2 .wpws-detail-row {
        padding: 14px 16px;
    }
    
    .wpws-style-v2 .wpws-register-form {
        padding: 22px 18px;
    }
}