/* quiz-style.css */
:root {
    /* צבעים */
    --color-primary: #2d1810;
    --color-primary-hover: #3d251c;
    --color-bg: #eeeff1;
    --color-bg-light: #ffffff;
    --color-text: #2d1810;
    --color-text-secondary: #666;
    --color-border: #e0d5cc;
    --color-stars: #d4a373;
    --color-error: #dc3545;
    
    /* צללי */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-hover: 0 5px 15px rgba(0,0,0,0.15);
    
    /* עיגולי פינה */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 25px;
    
    /* רוחב מקסימלי */
    --max-width-xl: 1400px;
    --max-width-lg: 1000px;
    --max-width-md: 600px;
    --max-width-sm: 500px;
    --max-width-xs: 400px;
}

/* איפו גלובלי */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

/* הגדרות בסיס */
.quiz-container {
    display: flex;
    background-color: var(--color-bg);
    max-width: var(--max-width-xl);
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius-lg);  /* מוסיף פינות מעוגלות */
    overflow: hidden;  /* חשוב! מוודא שהתמונות לא יוצאות מהפינות */
}

/* Intro Screen Override - Step 0 Specific */
.quiz-step.step-0 .quiz-container {
    display: flex;
    height: 100vh;
    max-height: 600px;
    margin: 0;
    border-radius: 0;  /* ← שנה את זה ל: */
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.quiz-step.step-0 .content-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 60px;
    background-color: var(--color-bg);
}

/* קיבוץ הכותרות יחד */
.quiz-step.step-0 .content-section h2 {
    margin-top: auto;
    margin-bottom: 5px; /* מרחק קטן בין הכותרות */
}

.quiz-step.step-0 .content-section .subtitle {
    margin-bottom: auto;
    margin-top: 0; /* מבטל רווח עלין */
}

.quiz-step.step-0 .next-button {
    margin-top: auto;
    margin-bottom: 0;
}

.quiz-step.step-0 .image-section {
    flex: 1;
    height: 100%;
}

.quiz-step.step-0 .image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Remove default quiz-step padding for intro */
.quiz-step.step-0 {
    padding: 0 !important;
    max-width: 100% !important;
    background: transparent;
}

/* Quiz Steps */
.quiz-step {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
    max-width: var(--max-width-lg);
    margin: 0 auto;
    padding: 40px 20px;
    background-color: var(--color-bg);
    flex-direction: column;
    align-items: center;
}

.quiz-step.active {
    display: flex;
    opacity: 1;
    transform: translateX(0);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    max-width: var(--max-width-md);
    text-align: center;
}

.progress-text {
    margin-bottom: 10px;
    color: var(--color-text);
    font-size: 0.9rem;
}

.progress-line {
    height: 6px;
    background-color: var(--color-border);
    border-radius: 3px;
}

.progress-line-inner {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* טיפוגרפיה */
h2 {
    color: var(--color-text);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--color-text-secondary);
    font-size: 1rem;
    margin-bottom: 20px;
}

/* Content Sections */
.content-section {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--color-bg);
}

.image-section {
    flex: 1;
    overflow: hidden;
}

.image-section img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Buttons */
.next-button,
.continue-button {
    background-color: var(--color-primary);
    color: var(--color-bg-light);
    padding: 15px 40px;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.next-button:hover,
.continue-button:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.back-button {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    padding: 10px 30px;
    border-radius: var(--radius-xl);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: var(--color-primary);
    color: var(--color-bg-light);
}

/* Options Grid */
.options-grid {
    display: grid;
    gap: 20px;
    width: 100%;
    margin-bottom: 40px;
}

.step-1 .options-grid {
    grid-template-columns: repeat(4, 1fr);
    max-width: var(--max-width-xl);
}

.step-2 .options-grid {
    grid-template-columns: repeat(3, minmax(200px, 250px));
    justify-content: center;
}

/* Option Cards */
.option-card {
    background: var(--color-bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.option-card.selected {
    border: 2px solid var(--color-primary);
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

.option-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.option-label {
    padding: 15px;
    text-align: center;
    color: var(--color-text);
    font-size: 1.1rem;
}

/* Style Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: var(--max-width-xs);
    margin-bottom: 40px;
}

.option-button {
    background-color: var(--color-bg-light);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--color-text);
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.option-button:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.option-button.selected {
    border-color: var(--color-primary);
    background-color: var(--color-primary);
    color: var(--color-bg-light);
}

/* Form */
.form-container {
    width: 100%;
    max-width: var(--max-width-sm);
    text-align: center;
}

.email-input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    direction: ltr;
    background-color: var(--color-bg-light);
    transition: border-color 0.3s ease;
    margin-bottom: 15px;
}

.email-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.email-input.error {
    border-color: var(--color-error);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    justify-content: center;
}

.checkbox-input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Terms */
.terms-text {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin: 15px 0;
    text-align: center;
}

.terms-text a {
    color: var(--color-text);
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* Results */
.results-container {
    max-width: var(--max-width-lg);
    margin: 0 auto;
    padding: 40px 20px;
    background-color: var(--color-bg);
    text-align: center;
}

.discount-code {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.code {
    color: var(--color-text);
    font-weight: bold;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--color-bg-light);
    border-radius: var(--radius-md);
    padding: 15px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.product-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    margin-bottom: 10px;
}

.product-name {
    color: var(--color-text);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.product-duration {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.stars {
    color: var(--color-stars);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.reviews {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.view-details {
    background-color: var(--color-primary);
    color: var(--color-bg-light);
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.view-details:hover {
    background-color: var(--color-primary-hover);
}

/* Take Quiz Again Button */
.take-quiz-again {
    background-color: var(--color-primary);
    color: var(--color-bg-light);
    padding: 12px 30px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.take-quiz-again:hover {
    background-color: var(--color-primary-hover);
}

/* Loading States */
.loading .option-image {
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { opacity: 0.5; }
}

/* Error States */
.quiz-error {
    color: var(--color-error);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

.option-card:focus-visible,
.option-button:focus-visible,
.next-button:focus-visible,
.back-button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Media Queries */
@media (max-width: 1024px) {
    .step-1 .options-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 20px;
    }
    
    .step-2 .options-grid {
        grid-template-columns: repeat(2, minmax(180px, 220px));
        gap: 12px;
        padding: 0 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .quiz-container {
        flex-direction: column-reverse;
    }
    
    .content-section,
    .image-section {
        flex: none;
    }
    
    .image-section {
        max-height: 300px;
    }
    
    .quiz-step.step-0 .quiz-container {
        flex-direction: column-reverse;
        height: auto;
        max-height: none;
    }
    
       .quiz-step.step-0 .content-section {
        padding: 40px 20px;
        justify-content: center; /* מרכ את התוכן במובייל */
    }
    
    .quiz-step.step-0 .content-section h2,
    .quiz-step.step-0 .content-section .subtitle {
        margin: 0; /* מבטל את ה-auto margins */
    }
    
    .quiz-step.step-0 .content-section .subtitle {
        margin-bottom: 40px; /* רווח בין הטסט לכפתור */
    }
    
    .quiz-step.step-0 .next-button {
        margin-top: 0; /* מבטל את ה-auto */
    }
}

@media (max-width: 480px) {
    .quiz-container {
        min-height: unset;
        box-shadow: none;
    }
    
    .image-section {
        height: 250px;
    }
    
    .quiz-step {
        padding: 20px 15px;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .step-1 .options-grid,
    .step-2 .options-grid,
    .products-grid {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
    
    .option-button {
        padding: 15px;
        font-size: 1rem;
    }
    
    .quiz-step.step-0 .image-section {
        height: 250px;
    }
}

/* Print Styles */
@media print {
    .quiz-step:not(.active) {
        display: none !important;
    }
    
    .back-button,
    .next-button {
        display: none !important;
    }
}