/* Современный фирменный дизайн для анкеты подбора хобби */

:root {
    color-scheme: light only;
    --survey-primary: #48038c;
    --survey-primary-light: #e1bbe6;
    --survey-primary-dark: #360279;
    --survey-secondary: #86059C;
    --survey-accent: #8A2BE2;
    --survey-success: #28a745;
    --survey-warning: #ffc107;
    --survey-danger: #FF4081;
    --survey-info: #17a2b8;
    
    --survey-bg-main: #fcfcfc;
    --survey-bg-card: #ffffff;
    --survey-bg-gradient: linear-gradient(135deg, #48038c 0%, #86059C 50%, #8A2BE2 100%);
    --survey-bg-gradient-light: linear-gradient(135deg, #e1bbe6 0%, #f0d4f3 50%, #f5e8ff 100%);
    
    --survey-text-primary: #4A148C;
    --survey-text-secondary: #6B606B;
    --survey-text-light: #9e9e9e;
    --survey-text-white: #ffffff;
    
    --survey-border: #D1C4E9;
    --survey-border-light: #e3e3e3;
    --survey-shadow: 0 4px 20px rgba(72, 3, 140, 0.1);
    --survey-shadow-hover: 0 8px 30px rgba(72, 3, 140, 0.2);
    --survey-shadow-card: 0 2px 15px rgba(0, 0, 0, 0.08);
    
    --survey-radius: 16px;
    --survey-radius-small: 8px;
    --survey-radius-large: 24px;
    
    --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-gradient-light);
    min-height: 100vh;
    padding: var(--survey-spacing-md) 0;
}

/* Заголовок анкеты */
.survey-header {
    background: var(--survey-bg-gradient);
    border-radius: var(--survey-radius-large);
    padding: var(--survey-spacing-xl);
    margin-bottom: var(--survey-spacing-xl);
    color: var(--survey-text-white);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--survey-shadow);
}

.survey-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-20px, -20px) rotate(180deg); }
}

.survey-header-content {
    position: relative;
    z-index: 2;
}

.survey-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--survey-spacing-sm);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.survey-description {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
}

.survey-icon {
    font-size: 3rem;
    margin-bottom: var(--survey-spacing-md);
    display: block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Прогресс бар */
.survey-progress-container {
    background: var(--survey-bg-card);
    border-radius: var(--survey-radius);
    padding: var(--survey-spacing-lg);
    margin-bottom: var(--survey-spacing-xl);
    box-shadow: var(--survey-shadow-card);
}

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

.survey-progress-bar {
    height: 100%;
    background: var(--survey-bg-gradient);
    border-radius: 10px;
    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;
}

/* Контейнер вопросов */
.survey-card {
    background: var(--survey-bg-card);
    border-radius: var(--survey-radius-large);
    padding: var(--survey-spacing-xl);
    box-shadow: var(--survey-shadow);
    border: 1px solid var(--survey-border-light);
    position: relative;
    overflow: hidden;
}

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

/* Вопросы */
.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-size: 1.5rem;
    font-weight: 600;
    color: var(--survey-text-primary);
    margin-bottom: var(--survey-spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--survey-spacing-sm);
}

.question-number {
    background: var(--survey-bg-gradient);
    color: var(--survey-text-white);
    padding: var(--survey-spacing-xs) var(--survey-spacing-sm);
    border-radius: var(--survey-radius-small);
    font-size: 0.9rem;
    font-weight: 700;
}

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

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

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

.answer-card {
    display: block;
    cursor: pointer;
    border: 2px solid var(--survey-border);
    border-radius: var(--survey-radius);
    background: var(--survey-bg-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.answer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--survey-bg-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.answer-card:hover {
    border-color: var(--survey-primary);
    box-shadow: var(--survey-shadow-hover);
    transform: translateY(-2px);
}

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

.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: var(--survey-bg-gradient);
    color: var(--survey-text-white);
    transform: scale(1.02);
}

.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: 2.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--survey-bg-gradient-light);
    border-radius: 50%;
    filter: drop-shadow(0 2px 8px rgba(72, 3, 140, 0.1));
}

.answer-text {
    flex: 1;
}

.answer-title {
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: var(--survey-spacing-xs);
    transition: all 0.3s 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;
}

/* Кнопки навигации */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--survey-spacing-xl);
    gap: var(--survey-spacing-md);
}

.survey-btn {
    padding: var(--survey-spacing-md) var(--survey-spacing-xl);
    border-radius: var(--survey-radius);
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: var(--survey-spacing-sm);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.survey-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.survey-btn:hover::before {
    left: 100%;
}

.survey-btn-primary {
    background: var(--survey-bg-gradient);
    color: var(--survey-text-white);
    box-shadow: var(--survey-shadow);
}

.survey-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--survey-shadow-hover);
}

.survey-btn-secondary {
    background: var(--survey-bg-card);
    color: var(--survey-text-secondary);
    border: 2px solid var(--survey-border);
}

.survey-btn-secondary:hover {
    background: var(--survey-primary-light);
    border-color: var(--survey-primary);
    color: var(--survey-primary);
}

.survey-btn-success {
    background: linear-gradient(135deg, var(--survey-success) 0%, #20c997 100%);
    color: var(--survey-text-white);
    box-shadow: var(--survey-shadow);
}

.survey-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(40, 167, 69, 0.3);
}

.survey-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

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

/* Адаптация для ПК */
@media (min-width: 769px) {
    .hobby-survey-page {
        padding: var(--survey-spacing-xl) 0;
    }
    
    .row.justify-content-center {
        max-width: 900px;
        margin: 0 auto;
    }
    
    .survey-header {
        padding: var(--survey-spacing-xxl);
    }
    
    .survey-title {
        font-size: 2.5rem;
    }
    
    .survey-description {
        font-size: 1.2rem;
    }
    
    .survey-card {
        padding: var(--survey-spacing-xxl);
    }
    
    .question-title {
        font-size: 1.7rem;
    }
    
    .answer-content {
        padding: var(--survey-spacing-xl);
    }
    
    .answer-emoji {
        width: 70px;
        height: 70px;
        font-size: 3rem;
    }
    
    .answer-title {
        font-size: 1.3rem;
    }
    
    .answer-description {
        font-size: 1.05rem;
    }
    
    .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: 60px;
        height: 60px;
        font-size: 2.5rem;
    }
    
    .nav-buttons {
        gap: var(--survey-spacing-lg);
    }
    
    .survey-btn {
        padding: var(--survey-spacing-lg) var(--survey-spacing-xxl);
        font-size: 1.2rem;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .hobby-survey-page {
        padding: var(--survey-spacing-sm) 0;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .row.justify-content-center {
        padding-bottom: 100px !important; /* Достаточный отступ для прокрутки на мобильных */
    }
    
    .survey-header {
        padding: var(--survey-spacing-lg);
        margin-bottom: var(--survey-spacing-lg);
    }
    
    .survey-title {
        font-size: 1.5rem;
    }
    
    .survey-description {
        font-size: 1rem;
    }
    
    .survey-card {
        padding: var(--survey-spacing-lg);
        border-radius: var(--survey-radius);
    }
    
    .question-title {
        font-size: 1.3rem;
        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: 50px;
        height: 50px;
        font-size: 2rem;
    }
    
    .answer-title {
        font-size: 1.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: 45px;
        height: 45px;
        font-size: 1.8rem;
    }
    
    .nav-buttons {
        flex-direction: column;
        gap: var(--survey-spacing-sm);
    }
    
    .survey-btn {
        width: 100%;
        justify-content: center;
        padding: var(--survey-spacing-md) var(--survey-spacing-lg);
    }
}

@media (max-width: 480px) {
    .hobby-survey-page {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .row.justify-content-center {
        padding-bottom: 100px !important; /* Достаточный отступ для прокрутки на маленьких экранах */
    }
    
    .survey-header {
        padding: var(--survey-spacing-md);
    }
    
    .survey-title {
        font-size: 1.3rem;
    }
    
    .survey-card {
        padding: var(--survey-spacing-md);
    }
    
    .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);
    }
}

.survey-card {
    animation: fadeInUp 0.6s ease-out;
    margin-bottom: 125px;
}

/* Дополнительные эффекты */
.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;
    }
}