/* پارفیُمو - تست رایحه شخصی - استایل‌های فرانت‌اند */

/* فونت‌های فارسی */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

/* متغیرهای CSS */
:root {
    --pft-primary: #8B4A6B;
    --pft-primary-dark: #6B3A4F;
    --pft-secondary: #D4A574;
    --pft-accent: #F5E6D3;
    --pft-text: #2C2C2C;
    --pft-text-light: #666;
    --pft-border: #E1E1E1;
    --pft-success: #27AE60;
    --pft-error: #E74C3C;
    --pft-warning: #F39C12;
    --pft-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --pft-radius: 12px;
    --pft-transition: all 0.3s ease;
}

/* استایل‌های عمومی */
.pft-container {
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    direction: rtl;
    color: var(--pft-text);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.pft-container * {
    box-sizing: border-box;
}

/* دکمه‌ها */
.pft-btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--pft-radius);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: var(--pft-transition);
    min-width: 120px;
}

.pft-btn-primary {
    background: linear-gradient(135deg, var(--pft-primary), var(--pft-primary-dark));
    color: white;
}

.pft-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--pft-shadow);
}

.pft-btn-secondary {
    background: var(--pft-secondary);
    color: white;
}

.pft-btn-outline {
    background: transparent;
    border: 2px solid var(--pft-primary);
    color: var(--pft-primary);
}

.pft-btn-outline:hover {
    background: var(--pft-primary);
    color: white;
}

.pft-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.pft-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* مقدمه */
.pft-intro {
    text-align: center;
    background: linear-gradient(135deg, var(--pft-accent), #FFF);
    border-radius: var(--pft-radius);
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--pft-shadow);
}

.pft-intro h2 {
    color: var(--pft-primary);
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
}

.pft-intro-subtitle {
    font-size: 18px;
    color: var(--pft-text-light);
    margin-bottom: 30px;
}

.pft-intro-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.pft-feature {
    background: white;
    padding: 20px;
    border-radius: var(--pft-radius);
    box-shadow: var(--pft-shadow);
}

.pft-feature-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.pft-feature h4 {
    color: var(--pft-primary);
    font-size: 16px;
    margin-bottom: 8px;
}

.pft-feature p {
    font-size: 14px;
    color: var(--pft-text-light);
    margin: 0;
}

/* احراز هویت */
.pft-auth-required {
    background: var(--pft-accent);
    border-radius: var(--pft-radius);
    padding: 30px;
    margin-top: 20px;
}

.pft-start-section {
    background: var(--pft-accent);
    border-radius: var(--pft-radius);
    padding: 30px;
    margin-top: 20px;
}

.pft-welcome {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--pft-primary);
}

/* مودال */
.pft-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pft-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--pft-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10001;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.pft-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--pft-border);
}

.pft-modal-header h3 {
    margin: 0;
    color: var(--pft-primary);
}

.pft-modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--pft-text-light);
}

.pft-modal-close:hover {
    color: var(--pft-error);
}

.pft-modal-body {
    padding: 20px;
}

/* تب‌ها */
.pft-auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--pft-border);
}

.pft-tab-btn {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 16px;
    cursor: pointer;
    color: var(--pft-text-light);
    border-bottom: 2px solid transparent;
    transition: var(--pft-transition);
}

.pft-tab-btn.active {
    color: var(--pft-primary);
    border-bottom-color: var(--pft-primary);
}

.pft-tab-content {
    display: none;
}

.pft-tab-content.active {
    display: block;
}

/* فرم‌ها */
.pft-form-group {
    margin-bottom: 20px;
}

.pft-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--pft-text);
}

.pft-form-group input[type="text"],
.pft-form-group input[type="email"],
.pft-form-group input[type="tel"],
.pft-form-group input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--pft-border);
    border-radius: var(--pft-radius);
    font-family: inherit;
    font-size: 16px;
    transition: var(--pft-transition);
}

.pft-form-group input:focus {
    outline: none;
    border-color: var(--pft-primary);
}

.pft-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    font-weight: normal !important;
}

.pft-checkbox-label input[type="checkbox"] {
    margin: 0;
}

.pft-error-message {
    color: var(--pft-error);
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.pft-form-group.error input {
    border-color: var(--pft-error);
}

.pft-form-group.error .pft-error-message {
    display: block;
}

.pft-forgot-password {
    text-align: center;
    margin-top: 15px;
}

.pft-forgot-password a {
    color: var(--pft-primary);
    text-decoration: none;
    font-size: 14px;
}

/* تست */
.pft-test-section {
    background: white;
    border-radius: var(--pft-radius);
    box-shadow: var(--pft-shadow);
    overflow: hidden;
}

.pft-test-header {
    background: var(--pft-primary);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pft-progress {
    flex: 1;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    height: 8px;
    margin-left: 20px;
    overflow: hidden;
}

.pft-progress-bar {
    height: 100%;
    background: white;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.pft-question-counter {
    font-weight: 500;
    white-space: nowrap;
}

.pft-test-content {
    padding: 40px;
}

.pft-question {
    text-align: center;
}

.pft-question-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--pft-primary);
    margin-bottom: 15px;
    line-height: 1.4;
}

.pft-question-description {
    font-size: 16px;
    color: var(--pft-text-light);
    margin-bottom: 30px;
    line-height: 1.6;
}

.pft-question-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.pft-option {
    background: white;
    border: 2px solid var(--pft-border);
    border-radius: var(--pft-radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--pft-transition);
    text-align: right;
}

.pft-option:hover {
    border-color: var(--pft-primary);
    transform: translateY(-2px);
    box-shadow: var(--pft-shadow);
}

.pft-option.selected {
    background: var(--pft-accent);
    border-color: var(--pft-primary);
}

.pft-option h4 {
    color: var(--pft-primary);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.pft-option p {
    color: var(--pft-text-light);
    font-size: 14px;
    margin: 0;
}

.pft-test-navigation {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    background: var(--pft-accent);
}

/* نتایج */
.pft-results {
    background: white;
    border-radius: var(--pft-radius);
    box-shadow: var(--pft-shadow);
    overflow: hidden;
}

.pft-results-header {
    background: linear-gradient(135deg, var(--pft-primary), var(--pft-primary-dark));
    color: white;
    padding: 30px;
    text-align: center;
}

.pft-results-header h2 {
    margin-bottom: 15px;
    font-size: 28px;
}

.pft-fragrance-code {
    background: rgba(255,255,255,0.2);
    border-radius: var(--pft-radius);
    padding: 15px;
    margin-top: 20px;
}

.pft-fragrance-code .code {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--pft-secondary);
}

.pft-profile-summary {
    padding: 30px;
    text-align: center;
}

.pft-profile-summary h3 {
    color: var(--pft-primary);
    font-size: 24px;
    margin-bottom: 15px;
}

.pft-fragrance-notes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.note-section {
    background: var(--pft-accent);
    border-radius: var(--pft-radius);
    padding: 20px;
    text-align: right;
}

.note-section h4 {
    color: var(--pft-primary);
    margin-bottom: 10px;
}

.note-section p {
    color: var(--pft-text-light);
    font-size: 14px;
    margin: 0;
}

.pft-recommendations-section {
    padding: 30px;
    background: #FAFAFA;
}

.pft-recommendations-section h3 {
    color: var(--pft-primary);
    text-align: center;
    margin-bottom: 30px;
}

.pft-recommendation-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.pft-pack-recommendation,
.pft-shop-recommendation {
    background: white;
    border-radius: var(--pft-radius);
    padding: 25px;
    box-shadow: var(--pft-shadow);
    text-align: center;
}

.pft-pack-recommendation h4,
.pft-shop-recommendation h4 {
    color: var(--pft-primary);
    margin-bottom: 15px;
}

#pft-pack-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: var(--pft-text-light);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--pft-border);
    border-top: 2px solid var(--pft-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* پک پیشنهادی */
.pft-pack {
    margin-top: 20px;
}

.pft-pack-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.pft-pack-product {
    background: var(--pft-accent);
    border-radius: var(--pft-radius);
    padding: 15px;
    text-align: center;
}

.pft-pack-product img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.pft-pack-product h5 {
    font-size: 14px;
    margin-bottom: 5px;
    color: var(--pft-text);
}

.pft-pack-product .price {
    font-size: 12px;
    color: var(--pft-text-light);
}

.pft-pack-summary {
    background: var(--pft-primary);
    color: white;
    border-radius: var(--pft-radius);
    padding: 20px;
    margin: 20px 0;
}

.pft-pack-pricing {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pft-original-price {
    text-decoration: line-through;
    opacity: 0.7;
}

.pft-discount-price {
    font-size: 20px;
    font-weight: 700;
}

.pft-discount-badge {
    background: var(--pft-success);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* اشتراک‌گذاری */
.pft-share-section {
    padding: 30px;
    background: var(--pft-accent);
    text-align: center;
}

.pft-share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.pft-share-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--pft-radius);
    background: var(--pft-primary);
    color: white;
    cursor: pointer;
    transition: var(--pft-transition);
}

.pft-share-btn:hover {
    background: var(--pft-primary-dark);
}

/* لودینگ */
.pft-loading {
    background: rgba(255,255,255,0.9);
    /* نمایش flex از کلاس .pft-overlay می‌آید؛ حذف display قبلی برای جلوگیری از نمایش دائمی */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.pft-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--pft-border);
    border-top: 4px solid var(--pft-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .pft-container {
        padding: 15px;
    }
    
    .pft-intro {
        padding: 25px;
    }
    
    .pft-intro h2 {
        font-size: 24px;
    }
    
    .pft-intro-features {
        grid-template-columns: 1fr;
    }
    
    .pft-modal {
        width: 95%;
    }
    
    .pft-question-options {
        grid-template-columns: 1fr;
    }
    
    .pft-recommendation-options {
        grid-template-columns: 1fr;
    }
    
    .pft-pack-products {
        grid-template-columns: 1fr;
    }
    
    .pft-test-content {
        padding: 20px;
    }
    
    .pft-test-navigation {
        padding: 15px 20px;
    }
    
    .pft-share-buttons {
        flex-direction: column;
    }
}

/* انیمیشن‌ها */
.pft-fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.pft-slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* پیام‌های وضعیت */
.pft-message {
    padding: 15px;
    border-radius: var(--pft-radius);
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pft-message-success {
    background: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
}

.pft-message-error {
    background: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
}

.pft-message-warning {
    background: #FFF3CD;
    color: #856404;
    border: 1px solid #FFEAA7;
}

/* سازگاری محصول */
.pft-compatibility-notice {
    background: white;
    border-radius: var(--pft-radius);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--pft-shadow);
}

.pft-compatibility-score {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
}

.pft-compatibility-score .score {
    font-size: 24px;
    font-weight: 700;
    color: var(--pft-primary);
}

.pft-compatibility-excellent .score { color: var(--pft-success); }
.pft-compatibility-good .score { color: var(--pft-warning); }
.pft-compatibility-fair .score { color: #FF9500; }
.pft-compatibility-low .score { color: var(--pft-error); }
