/* Quiz Page Styles */

.quiz-container-wrapper {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
    /* Безопасные отступы для notch на iPhone */
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

/* Стартовый экран */
.quiz-start {
    text-align: center;
    padding: 40px 20px;
}

.quiz-hero {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 20px;
    padding: 50px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.quiz-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.quiz-hero h2 {
    font-size: 32px;
    margin-bottom: 15px;
    color: #fff;
}

.quiz-description {
    font-size: 18px;
    color: #999;
    margin-bottom: 40px;
    line-height: 1.6;
}

.quiz-features {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
}

.feature-icon {
    font-size: 24px;
}

.btn-large {
    padding: 18px 50px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(135deg, #ff5f3d 0%, #ff8a65 50%, #ff5f3d 100%);
    background-size: 200% auto;
    box-shadow: 0 8px 25px rgba(255, 95, 61, 0.5);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    animation: pulse 2s ease-in-out infinite;
}

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

.btn-large:hover {
    background-position: right center;
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 35px rgba(255, 95, 61, 0.7);
}

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

.btn-large:active {
    transform: translateY(-2px) scale(1.02);
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(255, 95, 61, 0.5);
    }
    50% {
        box-shadow: 0 8px 35px rgba(255, 95, 61, 0.8);
    }
}

.btn-icon-arrow {
    font-size: 24px;
    margin-left: 8px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-large:hover .btn-icon-arrow {
    transform: translateX(8px);
    animation: arrowBounce 0.6s ease infinite;
}

@keyframes arrowBounce {
    0%, 100% {
        transform: translateX(8px);
    }
    50% {
        transform: translateX(14px);
    }
}

/* Вопросы */
.quiz-questions {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.quiz-progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff5f3d, #ff8a65);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    display: block;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.quiz-question {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
    color: #fff;
    line-height: 1.3;
}

.quiz-options {
    display: grid;
    gap: 15px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #2d2d2d;
    border: 2px solid #3d3d3d;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
}

.quiz-option:hover {
    background: #3d3d3d;
    border-color: #ff5f3d;
    transform: translateX(5px);
}

.quiz-option:active {
    transform: translateX(5px) scale(0.98);
}

.option-emoji {
    font-size: 36px;
    min-width: 40px;
}

.option-label {
    font-size: 18px;
    color: #fff;
    flex: 1;
}

/* Результаты */
.quiz-results {
    padding: 20px 0;
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
}

.results-header h2 {
    font-size: 36px;
    margin-bottom: 10px;
    color: #fff;
}

.results-header p {
    font-size: 18px;
    color: #999;
}

.recommendation-card {
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    border-radius: 15px;
    border: 2px solid #3d3d3d;
    position: relative;
    transition: all 0.3s;
}

.recommendation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(255, 95, 61, 0.2);
}

.recommendation-card.best-match {
    border-color: #ff5f3d;
    box-shadow: 0 0 30px rgba(255, 95, 61, 0.3);
}

.best-badge {
    position: absolute;
    top: -15px;
    left: 20px;
    background: linear-gradient(135deg, #ff5f3d, #ff8a65);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 95, 61, 0.4);
}

.match-score {
    position: absolute;
    top: 25px;
    right: 25px;
    text-align: center;
}

.score-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: conic-gradient(#ff5f3d var(--percent), #333 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 5px;
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 56px;
    height: 56px;
    background: #2d2d2d;
    border-radius: 50%;
}

.score-circle span {
    position: relative;
    z-index: 1;
    color: #fff;
}

.score-label {
    font-size: 12px;
    color: #999;
}

.movie-info {
    display: flex;
    gap: 20px;
}

.movie-poster {
    width: 150px;
    height: 220px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.movie-details {
    flex: 1;
    padding-right: 80px;
}

.movie-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: #fff;
}

.movie-meta {
    display: flex;
    gap: 15px;
    margin: 10px 0 15px 0;
    color: #999;
    font-size: 14px;
    flex-wrap: wrap;
}

.movie-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.movie-description {
    color: #ccc;
    line-height: 1.6;
    margin-bottom: 20px;
}

.movie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

button.btn {
    background: none;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, #ff5f3d, #ff8a65);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 95, 61, 0.4);
}

.btn-secondary {
    background: #3d3d3d;
    color: white;
}

.btn-secondary:hover {
    background: #4d4d4d;
}

.btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.quiz-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

.btn-outline {
    background: transparent;
    border: 2px solid #ff5f3d;
    color: #ff5f3d;
}

.btn-outline:hover {
    background: #ff5f3d;
    color: white;
}

.btn-link {
    background: transparent;
    color: #999;
}

.btn-link:hover {
    color: #fff;
}

.quiz-hint {
    text-align: center;
    padding: 20px;
    background: rgba(255, 95, 61, 0.1);
    border-radius: 10px;
    color: #ff8a65;
    border: 1px dashed #ff5f3d;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 28px;
    margin-bottom: 15px;
    color: #fff;
}

.no-results p {
    font-size: 18px;
    color: #999;
    margin-bottom: 30px;
}

/* Скрытие/показ коротких текстов на кнопках */
.btn-text-short {
    display: none;
}

.btn-text-full {
    display: inline;
}

/* Адаптив */
@media (max-width: 768px) {
    .quiz-container-wrapper {
        padding: 10px;
        margin-bottom: 0;
        padding-bottom: 20px; /* Уменьшенный отступ */
    }
    
    /* Показываем короткий текст на маленьких экранах */
    .btn-text-short {
        display: inline;
    }
    
    .btn-text-full {
        display: none;
    }
    
    .quiz-hero {
        padding: 30px 20px;
    }
    
    .quiz-hero h2 {
        font-size: 24px;
    }
    
    .quiz-description {
        font-size: 16px;
    }
    
    .quiz-features {
        flex-direction: column;
        gap: 15px;
    }
    
    .feature-item {
        font-size: 14px;
    }
    
    .quiz-question {
        font-size: 22px;
    }
    
    .quiz-option {
        padding: 15px;
    }
    
    .option-emoji {
        font-size: 28px;
        min-width: 35px;
    }
    
    .option-label {
        font-size: 16px;
    }
    
    .movie-info {
        flex-direction: column;
    }
    
    .movie-poster {
        width: 100%;
        height: auto;
        max-width: 200px;
        margin: 0 auto;
    }
    
    .movie-details {
        padding-right: 0;
        width: 100%;
        max-width: 100%;
    }
    
    .movie-title {
        font-size: 20px;
        word-wrap: break-word;
    }
    
    .movie-description {
        font-size: 14px;
    }
    
    .match-score {
        position: static;
        margin: 15px auto;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .quiz-results {
        padding: 10px 0;
    }
    
    .results-header {
        margin-bottom: 30px;
        padding-top: 10px;
    }
    
    .results-header h2 {
        font-size: 28px;
    }
    
    .movie-title {
        font-size: 20px;
    }
    
    .movie-meta {
        font-size: 13px;
        gap: 10px;
    }
    
    .movie-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .movie-actions .btn {
        width: 100%;
        justify-content: center;
        font-size: 14px;
        padding: 10px 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .recommendation-card {
        padding: 15px;
        padding-top: 10px; /* ✅ Меньше отступ сверху */
        margin-bottom: 20px;
        overflow: visible; /* ✅ Видимость для бейджа */
    }
    
    .best-badge {
        font-size: 12px;
        padding: 6px 15px;
        position: static; /* ✅ Убираем absolute позиционирование */
        top: auto;
        left: auto;
        margin-bottom: 10px;
        display: inline-block;
    }
    
    .btn-large {
        padding: 15px 40px;
        font-size: 18px;
    }
    
    .quiz-footer {
        flex-direction: column;
    }
    
    .quiz-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .quiz-container-wrapper {
        padding: 5px;
        padding-bottom: 20px; /* Уменьшенный отступ */
    }
    
    .quiz-hero {
        padding: 20px 15px;
    }
    
    .quiz-icon {
        font-size: 60px;
    }
    
    .quiz-hero h2 {
        font-size: 20px;
    }
    
    .quiz-description {
        font-size: 15px;
    }
    
    .quiz-features {
        gap: 10px;
    }
    
    .feature-item {
        font-size: 13px;
    }
    
    .quiz-question {
        font-size: 18px;
        padding: 0 10px;
    }
    
    .quiz-option {
        padding: 12px;
    }
    
    .option-emoji {
        font-size: 24px;
        min-width: 30px;
    }
    
    .option-label {
        font-size: 14px;
    }
    
    .recommendation-card {
        padding: 12px;
        padding-top: 8px;
        overflow: visible;
    }
    
    .best-badge {
        position: static;
        margin-bottom: 8px;
        font-size: 11px;
        padding: 5px 12px;
    }
    
    .movie-poster {
        max-width: 180px;
    }
    
    .movie-title {
        font-size: 18px;
    }
    
    .movie-meta {
        font-size: 12px;
        gap: 8px;
    }
    
    .movie-description {
        font-size: 13px;
    }
    
    .movie-actions .btn {
        font-size: 13px;
        padding: 9px 14px;
    }
    
    .quiz-results {
        padding: 5px 0;
    }
    
    .results-header {
        margin-bottom: 20px;
        padding-top: 5px;
    }
    
    .results-header h2 {
        font-size: 24px;
    }
    
    .results-header p {
        font-size: 15px;
    }
    
    .btn-large {
        font-size: 16px;
        padding: 12px 30px;
    }
    
    .quiz-footer .btn {
        font-size: 14px;
    }
    
    .quiz-hint {
        font-size: 13px;
        padding: 15px;
    }
}
