/* Анкета подбора хобби — палитра и радиусы как на dashboard (через переменные темы) */

:root {
    color-scheme: light only;
    --survey-primary: var(--primary-color, #794ff8);
    --survey-primary-light: var(--primary-color-light, #e6d5fa);
    --survey-primary-dark: var(--primary-color-dark, #5b21b6);
    --survey-secondary: var(--secondary-color, #e9d5ff);
    --survey-accent: var(--primary-color, #794ff8);
    --survey-success: #28a745;
    --survey-warning: #ffc107;
    --survey-danger: var(--danger-color, #FF4081);
    --survey-info: #17a2b8;

    --survey-bg-main: var(--bg-color, #f8fafc);
    --survey-bg-card: var(--card-bg, #ffffff);
    --survey-bg-gradient: linear-gradient(135deg, var(--primary-color, #794ff8) 0%, var(--primary-color-dark, #5b21b6) 100%);
    --survey-bg-gradient-light: linear-gradient(135deg, rgba(121, 79, 248, 0.08) 0%, var(--bg-color, #f8fafc) 100%);

    --survey-text-primary: var(--text-color, #1e1b4b);
    --survey-text-secondary: var(--muted-foreground, #64748b);
    --survey-text-light: #94a3b8;
    --survey-text-white: #ffffff;

    --survey-border: var(--border-color, #e2e8f0);
    --survey-border-light: var(--border-color, #e2e8f0);
    --survey-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --survey-shadow-hover: 0 8px 24px rgba(121, 79, 248, 0.12);
    --survey-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);

    --survey-radius: 0.75rem;
    --survey-radius-small: 0.5rem;
    --survey-radius-large: 1rem;

    --survey-spacing-xs: 4px;
    --survey-spacing-sm: 8px;
    --survey-spacing-md: 16px;
    --survey-spacing-lg: 24px;
    --survey-spacing-xl: 32px;
    --survey-spacing-xxl: 48px;
}

.hobby-survey-page {
    background: var(--survey-bg-main);
    min-height: 100vh;
    padding: var(--survey-spacing-md) 0;
}

/* Прогресс: полоса как на dashboard */
.survey-progress-container {
    margin-bottom: 0;
}

.survey-progress {
    height: 10px;
    background: var(--survey-border-light);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}

.survey-progress-bar {
    height: 100%;
    background: var(--survey-bg-gradient);
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.survey-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        45deg,
        rgba(255,255,255,0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255,255,255,0.2) 50%,
        rgba(255,255,255,0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progress-stripes 1s linear infinite;
}

@keyframes progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.progress-text {
    text-align: center;
    margin-top: var(--survey-spacing-sm);
    color: var(--survey-text-secondary);
    font-weight: 500;
}

/* Карточка вопросов — рамка как у dashboard-карточек */
.survey-card {
    background: var(--survey-bg-card);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.45s ease-out;
    margin-bottom: 5rem;
}

.survey-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--survey-bg-gradient);
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Вопросы */
.question-container {
    display: none;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* text-align: left; */
}

.question-container.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.question-header {
    margin-bottom: var(--survey-spacing-lg);
}

.question-title {
    font-family: var(--font-heading, var(--font-family, inherit));
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--survey-text-primary);
    margin-bottom: var(--survey-spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--survey-spacing-sm);
    flex-wrap: wrap;
}

.question-number {
    background: rgba(121, 79, 248, 0.12);
    color: var(--survey-primary);
    padding: var(--survey-spacing-xs) var(--survey-spacing-sm);
    border-radius: var(--survey-radius-small);
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid var(--survey-border);
}

.question-required {
    color: var(--survey-danger);
    font-weight: 700;
    margin-left: var(--survey-spacing-xs);
}

.question-text {
    font-size: 0.95rem;
    color: var(--survey-text-secondary);
    margin-bottom: 0;
    line-height: 1.55;
}

/* Варианты ответов */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: var(--survey-spacing-md);
}

.answer-card {
    display: block;
    cursor: pointer;
    border: 1px solid var(--survey-border);
    border-radius: 0.75rem;
    background: var(--survey-bg-card);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.answer-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--survey-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.answer-card:hover {
    border-color: rgba(121, 79, 248, 0.45);
    box-shadow: var(--survey-shadow-hover);
    transform: translateY(-1px);
}

.answer-card:hover::before {
    opacity: 0.04;
}

.answer-card input[type="radio"],
.answer-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.answer-card input[type="radio"]:checked + .answer-content,
.answer-card input[type="checkbox"]:checked + .answer-content {
    background: rgba(121, 79, 248, 0.1);
    color: var(--survey-text-primary);
    border: 1px solid var(--survey-primary);
    border-radius: 0.5rem;
    transform: none;
    box-shadow: 0 0 0 1px var(--survey-primary);
}

.answer-card input[type="radio"]:checked + .answer-content .answer-emoji,
.answer-card input[type="checkbox"]:checked + .answer-content .answer-emoji {
    transform: scale(1.2) rotate(5deg);
}

.answer-card input[type="radio"]:checked + .answer-content .answer-title,
.answer-card input[type="checkbox"]:checked + .answer-content .answer-title {
    font-weight: 700;
}

.answer-card input[type="radio"]:checked + .answer-content .answer-description,
.answer-card input[type="checkbox"]:checked + .answer-content .answer-description {
    opacity: 0.9;
}

.answer-content {
    display: flex;
    align-items: center;
    gap: var(--survey-spacing-lg);
    padding: var(--survey-spacing-lg);
    border-radius: var(--survey-radius-small);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
}

.answer-emoji {
    font-size: 2rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(121, 79, 248, 0.08);
    border-radius: 0.75rem;
    border: 1px solid var(--survey-border);
}

.answer-text {
    flex: 1;
}

.answer-title {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: var(--survey-spacing-xs);
    transition: color 0.2s ease;
}

.answer-description {
    font-size: 0.95rem;
    opacity: 0.8;
    line-height: 1.5;
    transition: all 0.3s ease;
}

/* Сетка для чекбоксов */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--survey-spacing-md);
}

.checkbox-card .answer-content {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: var(--survey-spacing-sm);
    padding: var(--survey-spacing-lg) var(--survey-spacing-md);
}

.checkbox-card .answer-emoji {
    width: 50px;
    height: 50px;
    font-size: 2rem;
}

.checkbox-card .answer-text {
    text-align: center;
}

.checkbox-card .answer-title {
    font-size: 1rem;
}

.checkbox-card .answer-description {
    font-size: 0.85rem;
}

/* Обычные радиокнопки и чекбоксы */
.form-check {
    margin-bottom: var(--survey-spacing-md);
    padding: var(--survey-spacing-md);
    border: 2px solid var(--survey-border-light);
    border-radius: var(--survey-radius);
    background: var(--survey-bg-card);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
}

.form-check:hover {
    border-color: var(--survey-primary);
    box-shadow: var(--survey-shadow-card);
}

.form-check-input {
    width: 20px;
    height: 20px;
    margin-right: var(--survey-spacing-md);
    accent-color: var(--survey-primary);
}

.form-check-input:checked {
    background-color: var(--survey-primary);
    border-color: var(--survey-primary);
}

.form-check-label {
    font-size: 1.1rem;
    color: var(--survey-text-secondary);
    cursor: pointer;
    margin: 0;
    font-weight: 500;
}

.form-check-input:checked + .form-check-label {
    color: var(--survey-primary);
    font-weight: 600;
}

/* Спиннер */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

@media (min-width: 769px) {
    .hobby-survey-page {
        padding: var(--survey-spacing-xl) 0;
    }

    .question-title {
        font-size: 1.35rem;
    }

    .answer-content {
        padding: var(--survey-spacing-xl);
    }

    .answer-emoji {
        width: 64px;
        height: 64px;
        font-size: 2.25rem;
    }

    .answer-title {
        font-size: 1.15rem;
    }

    .answer-description {
        font-size: 1rem;
    }

    .checkbox-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--survey-spacing-lg);
    }

    .checkbox-card .answer-content {
        padding: var(--survey-spacing-xl) var(--survey-spacing-lg);
    }

    .checkbox-card .answer-emoji {
        width: 56px;
        height: 56px;
        font-size: 2rem;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .hobby-survey-page {
        padding: var(--survey-spacing-sm) 0;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #content {
        padding-bottom: 6rem !important;
    }

    .question-title {
        font-size: 1.15rem;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--survey-spacing-xs);
    }

    .answer-content {
        gap: var(--survey-spacing-md);
        padding: var(--survey-spacing-md);
    }

    .answer-emoji {
        width: 48px;
        height: 48px;
        font-size: 1.75rem;
    }

    .answer-title {
        font-size: 1rem;
    }

    .answer-description {
        font-size: 0.9rem;
    }

    .checkbox-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--survey-spacing-sm);
    }

    .checkbox-card .answer-content {
        padding: var(--survey-spacing-md) var(--survey-spacing-sm);
    }

    .checkbox-card .answer-emoji {
        width: 44px;
        height: 44px;
        font-size: 1.65rem;
    }

    .nav-buttons .ms-auto {
        width: 100%;
        justify-content: stretch;
    }

    .nav-buttons .ms-auto .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hobby-survey-page {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .answer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--survey-spacing-sm);
    }
    
    .answer-emoji {
        width: 45px;
        height: 45px;
        font-size: 1.8rem;
    }
    
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    
    .form-check {
        padding: var(--survey-spacing-sm);
    }
    
    .form-check-label {
        font-size: 1rem;
    }
}

/* Анимации загрузки */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Дополнительные эффекты */
.answer-card:hover .answer-emoji {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* Темная тема отключена для корректной работы в Samsung Internet и других браузерах */
/* @media (prefers-color-scheme: dark) {
    :root {
        --survey-bg-main: #1a1a1a;
        --survey-bg-card: #2d2d2d;
        --survey-text-primary: #ffffff;
        --survey-text-secondary: #b0b0b0;
        --survey-border: #404040;
        --survey-border-light: #333333;
        --survey-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        --survey-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
        --survey-shadow-card: 0 2px 15px rgba(0, 0, 0, 0.2);
    }
} */

.row.justify-content-center {
    margin: auto;
    padding-bottom: 80px; /* Уменьшено для корректной прокрутки на мобильных устройствах */
}

/* Загрузчик для подбора хобби (как в коуче) */
.hobby-recommendation-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

#hobbyRecommendationLoader.hobby-recommendation-loader {
    display: block;
    padding: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, .3);
    z-index: 100000000;
}

#hobbyRecommendationLoader .hobby-recommendation-loader-content {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
    position: fixed;
    z-index: 1000000000;
    background: white;
    border-radius: 50px;
    max-width: 600px;
}

.hobby-loader-spinner {
    margin-bottom: 32px;
    text-align: center;
}

.hobby-loader-spinner .spinner {
    margin: auto;
    width: 64px;
    height: 64px;
    border: 4px solid var(--survey-border);
    border-top-color: var(--survey-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.hobby-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.hobby-loader-content .hobby-avatar {
    font-size: 3rem;
    margin-bottom: 0;
}

.hobby-loader-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--survey-text-primary);
    margin: 0;
}

.hobby-loader-message {
    font-size: 16px;
    color: var(--survey-text-secondary);
    margin: 0;
}

.hobby-loader-dots {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    text-align: center;
    width: auto;
}

.hobby-loader-dots span {
    width: 8px;
    height: 8px;
    background: var(--survey-primary);
    border-radius: 50%;
    animation: pulse 1.4s ease-in-out infinite;
}

.hobby-loader-dots span:nth-child(1) {
    animation-delay: 0s;
}

.hobby-loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.hobby-loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Кнопки анкеты: стиль и цвета как на dashboard */
.hobby-survey-page .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.hobby-survey-page .btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.hobby-survey-page .btn-primary:hover,
.hobby-survey-page .btn-primary:focus,
.hobby-survey-page .btn-primary:active {
    background: var(--primary-color-dark);
    border-color: var(--primary-color-dark);
    color: #fff;
}

.hobby-survey-page .btn-primary:disabled,
.hobby-survey-page .btn-primary.disabled {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.hobby-survey-page .btn-outline-secondary {
    background: var(--secondary-color);
    border-color: transparent;
    color: var(--primary-color);
}

.hobby-survey-page .btn-outline-secondary:hover,
.hobby-survey-page .btn-outline-secondary:focus,
.hobby-survey-page .btn-outline-secondary:active {
    background: var(--primary-color-light);
    border-color: transparent;
    color: var(--primary-color-dark);
}