/* frontend/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;700&display=swap');

html {
    height: 100%;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #2a1a3f 100%);
    background-attachment: fixed;
    color: #e0e6f0;
    margin: 0;
    line-height: 1.7;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 15px;
    box-sizing: border-box;
    overflow-x: hidden;
}

#quiz-container {
    background: rgba(20, 26, 48, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 30px 40px;
    padding-bottom: 50px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    position: relative;
    /* --- اصلاحیه: حذف محدودیت ارتفاع برای نمایش کامل محتوا --- */
    /* max-height: 90vh; */
    /* overflow: hidden; */
    transition: max-height 0.8s ease-in-out;
}

#quiz-container.expanded {
    max-height: none;
    overflow-y: auto;
}

#quiz-container::-webkit-scrollbar { display: none; }
#quiz-container { -ms-overflow-style: none; scrollbar-width: none; }

h1 { text-align: center; color: #ffffff; font-weight: 700; margin-bottom: 30px; text-shadow: 0 0 10px rgba(13, 110, 253, 0.5); }
.question-card { margin-bottom: 25px; padding: 20px 0; text-align: right; animation: fadeIn 0.5s ease-in-out; }
.question-card.fading-out { opacity: 0; transform: translateY(20px); transition: all 0.4s ease-in-out; }
.question-card p { font-size: 1.3em; font-weight: 500; margin-bottom: 25px; color: #f8f9fa; }
.options-container { display: flex; flex-direction: column; gap: 15px; }

.option { padding: 15px 20px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; cursor: pointer; transition: all 0.3s ease-in-out; text-align: right; background-color: rgba(255, 255, 255, 0.05); color: #d0d8e8; position: relative; }
.option:hover { border-color: #a370f7; color: #ffffff; transform: translateY(-3px) scale(1.02); box-shadow: 0 0 5px #a370f7, 0 0 15px #a370f7, 0 0 25px #a370f7, 0 0 40px #a370f7; }

.navigation-buttons { display: flex; justify-content: center; margin-top: 30px; }
#back-btn { font-family: 'Vazirmatn', sans-serif !important; font-size: 0.9rem !important; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.2); color: #a0aec0; padding: 8px 20px; border-radius: 20px; cursor: pointer; transition: all 0.3s ease; }
#back-btn:hover { background-color: rgba(255, 255, 255, 0.1); border-color: #a370f7; color: #fff; box-shadow: 0 0 10px rgba(163, 112, 247, 0.5); }

.final-result-container { text-align: right; animation: fadeIn 0.5s; position: relative; padding-bottom: 80px; }
.result-header { text-align: center; margin-bottom: 40px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); padding-bottom: 20px; }
.result-header .result-emoji { font-size: 4rem; margin-bottom: 10px; display: block; }
.result-header h1 { font-size: 2.2em; color: #a370f7; margin-bottom: 10px; }
.result-header p { font-size: 1.1em; color: #e0e6f0; max-width: 600px; margin: 10px auto 0; }
.result-section { margin-bottom: 30px; }
.result-section h2 { font-size: 1.5em; color: #87b2f3; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.features-list, .careers-list { list-style: none; padding: 0; }

.feature-item, .career-item, .soft-skill-item { background-color: rgba(255, 255, 255, 0.07); border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: background-color 0.3s; overflow: hidden; }
.feature-item:hover, .career-item:hover, .soft-skill-item:hover { background-color: rgba(163, 112, 247, 0.2); }

.item-title, .career-title { padding: 15px; font-weight: 700; font-size: 1.1em; display: flex; justify-content: space-between; align-items: center; color: #ffffff; }
.item-title::after, .career-title::after { content: '＋'; font-weight: bold; color: #a370f7; font-size: 1.4em; transition: transform 0.3s; }
.feature-item.open .item-title::after, .career-item.open .career-title::after, .soft-skill-item.open .item-title::after { transform: rotate(45deg); }

.item-details, .career-details { padding: 0 15px; max-height: 0; overflow: hidden; transition: max-height 0.5s ease-out, padding 0.5s ease-out; }
.feature-item.open .item-details, .career-item.open .career-details, .soft-skill-item.open .item-details { max-height: 200px; padding: 0 15px 15px 15px; }
.item-details p, .career-details p { margin: 5px 0 10px; font-size: 0.95em; color: #d1d5db; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 10px; }
.demand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; }
.demand-item { background-color: rgba(255, 255, 255, 0.05); padding: 15px; border-radius: 8px; border-left: 3px solid #589bff; }
.demand-item h3 { margin: 0 0 10px 0; color: #fff; font-size: 1.1em; }
.demand-item p { font-size: 0.9em; color: #d1d5db; }
.job-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}
.job-grid h3 { color: #c7d2fe; font-size: 1.1em; margin-bottom: 15px; text-align: right; }

.star { position: fixed; background-color: white; border-radius: 50%; animation: twinkle linear infinite; box-shadow: 0 0 5px #fff, 0 0 10px #fff; z-index: -1; pointer-events: none; }
@keyframes twinkle { 0%, 100% { opacity: 0.5; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.click-shooting-star {
    position: fixed;
    width: 3px;
    height: 3px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px #a370f7;
    animation: shoot 1s ease-out forwards;
    pointer-events: none;
    z-index: 9999;
}
.click-shooting-star::before {
    content: '';
    position: absolute;
    width: 200px;
    height: 2px;
    background: linear-gradient(to left, rgba(255, 255, 255, 0.5), transparent);
    transform: translateY(-50%) rotate(315deg);
    transform-origin: right center;
}
@keyframes shoot {
    0% { transform: translate(0, 0) scale(1); opacity: 1; }
    100% { transform: translate(-500px, 500px) scale(0); opacity: 0; }
}

#show-more-btn {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100px;
    background: linear-gradient(to bottom, transparent 0%, rgba(15, 23, 42, 1) 90%);
    border: none;
    cursor: pointer;
    transition: opacity 0.4s, visibility 0.4s;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 20px;
    z-index: 100;
}
#quiz-container.expanded #show-more-btn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.neon-arrow {
    width: 20px;
    height: 20px;
    border: solid #a370f7;
    border-width: 0 4px 4px 0;
    transform: rotate(45deg);
    animation: neon-pulse 1.5s infinite;
}
@keyframes neon-pulse {
    0%, 100% {
        box-shadow: 0 0 5px #a370f7, 0 0 10px #a370f7, 0 0 15px #c19cff;
        opacity: 0.7;
    }
    50% {
        box-shadow: 0 0 10px #a370f7, 0 0 20px #c19cff, 0 0 30px #c19cff;
        opacity: 1;
    }
}
.result-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.result-buttons .button {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 250px;
}
.result-buttons .workshop-button {
    background-color: #8b5cf6;
    color: #fff;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}
.result-buttons .card-button {
    background-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}
.result-buttons .button:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

@keyframes spin-stars {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.back-to-main-site-btn {
    display: inline-block;
    padding: 12px 28px;
    margin-top: 30px;
    border: 2px solid #a370f7;
    border-radius: 50px;
    color: #ffffff;
    background-color: rgba(163, 112, 247, 0.1);
    text-decoration: none;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.back-to-main-site-btn:hover {
    color: #fff;
    background-color: #a370f7;
    box-shadow: 0 0 10px #a370f7, 0 0 20px #a370f7, 0 0 40px #a370f7;
}
.back-to-main-site-btn::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background-image: 
        radial-gradient(circle, white 1px, transparent 1px),
        radial-gradient(circle, white 1px, transparent 1px);
    background-size: 50px 50px, 150px 150px;
    background-position: 0 0, 30px 30px;
    animation: spin-stars 40s linear infinite;
    opacity: 0.3;
}

#card-display img {
    max-height: 60vh;
    width: auto;
    max-width: 100%;
}

@media (max-width: 768px) {
    #quiz-container {
        /* اصلاحیه: برداشتن محدودیت ارتفاع در موبایل */
        max-height: none;
        overflow-y: auto;
    }
    .result-grid, .job-grid {
        grid-template-columns: 1fr;
    }
    .result-header h1 {
        font-size: 1.8em;
    }
    .final-result-container {
        padding-bottom: 20px;
    }
    .result-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .result-buttons .button {
        width: auto;
        min-width: unset;
    }
}