/**
 * GG Quiz - Personality Quiz Styles
 * Mobile First
 */

/* ================================
   Базовые стили
   ================================ */

.gg-quiz {
    margin: 0 auto;
    width: 525px;
    max-width: 100%;
}

/* Экраны */
.gg-quiz__screen {
    display: none;
}

.gg-quiz__screen--active {
    display: block;
    animation: ggQuizFadeIn 0.3s ease-out;
}

@keyframes ggQuizFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   Стартовый экран
   ================================ */

.gg-quiz__start {
    padding: 24px 16px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.gg-quiz__cover {
    margin: -24px -16px 20px;
    overflow: hidden;
}

.gg-quiz__cover img {
    width: 100%;
    height: auto;
    display: block;
}

.gg-quiz__title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
    line-height: 1.3;
    text-transform: uppercase;
}

.gg-quiz__description {
    font-size: 15px;
    color: #6c757d;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ================================
   Кнопки
   ================================ */

.gg-quiz__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    height: 45px;
    font-size: 15px;
    font-weight: bold;
    padding-left: 20px;
    padding-right: 20px;
}

.gg-quiz__btn--start,
.gg-quiz__btn--take {
    font-size: 16px;
    min-width: 200px;
}

.gg-quiz__btn--take {
    margin-top: 20px;
}

.gg-quiz__btn--restart {
    background: none;
    border: none;
    border-radius: 0;
    padding: 8px 0;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: auto;
}

.gg-quiz__btn--restart span {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

.gg-quiz__btn--restart svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.gg-quiz__btn--restart:hover {
    color: #495057;
}

.gg-quiz__btn--restart:hover svg {
    transform: rotate(-45deg);
}

/* ================================
   Прогресс
   ================================ */

.gg-quiz__progress {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    text-transform: uppercase;
}

.gg-quiz__progress-bar {
    flex: 1;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.gg-quiz__progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--green-color, #09924e) 0%, var(--dark-green, #36dd8a) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0;
}

.gg-quiz__progress-text {
    font-size: 13px;
    color: #6c757d;
    text-align: center;
    margin-right: 12px;
    flex-shrink: 0;
    font-weight: bold;
}

.gg-quiz__progress-text b {
    font-weight: bold;
    color: #000;
}

.gg-quiz__progress-current {
    font-weight: bold;
    color: #000;
}

/* ================================
   Вопросы
   ================================ */

.gg-quiz__questions {
    padding: 24px 16px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.gg-quiz__question {
    display: none;
}

.gg-quiz__question--active {
    display: block;
    animation: ggQuizSlideIn 0.3s ease-out;
}

@keyframes ggQuizSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.gg-quiz__question-image {
    margin: -24px -16px 15px;
    overflow: hidden;
}

.gg-quiz__question-image img {
    width: 100%;
    height: auto;
    display: block;
}

.gg-quiz__question-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 20px;
    line-height: 1.4;
}

.gg-quiz__question-number {
    color: #667eea;
    font-weight: 700;
}

/* ================================
   Ответы
   ================================ */

.gg-quiz__answers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gg-quiz__answer {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid transparent;
    font-size: 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gg-quiz__answer:active {
    transform: scale(0.98);
}

.gg-quiz__answer--selected {
    background: linear-gradient(135deg, #09924e15 0%, #36dd8a15 100%);
    border-color: var(--green-color, #09924e);
}

.gg-quiz__answer-code {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: #6c757d;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.gg-quiz__answer--selected .gg-quiz__answer-code {
    background: var(--green-color, #09924e);
    border-color: var(--green-color, #09924e);
    color: #ffffff;
}

.gg-quiz__answer-text {
    color: #1a1a2e;
    line-height: 1.4;
}

/* ================================
   Загрузка
   ================================ */

.gg-quiz__loading {
    padding: 60px 24px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.gg-quiz__spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: var(--green-color, #09924e);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: ggQuizSpin 0.8s linear infinite;
}

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

.gg-quiz__loading p {
    font-size: 15px;
    color: #6c757d;
    margin: 0;
}

/* ================================
   Результат
   ================================ */

.gg-quiz__result-inner {
    padding: 24px 16px;
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.gg-quiz__shared-label {
    font-size: 22px;
    text-transform: uppercase;
    font-weight: bold;
    text-align: center;
    margin: 0 0 16px;
}

.gg-quiz__result-image {
    margin: -24px -16px 20px;
    overflow: hidden;
}

.gg-quiz__result-image img {
    width: 100%;
    height: auto;
    display: block;
}

.gg-quiz__result-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 12px;
    line-height: 1.3;
    text-transform: uppercase;
}

.gg-quiz__result-description {
    font-size: 15px;
    color: #6c757d;
    margin: 0 0 24px;
    line-height: 1.5;
}

/* ================================
   Шаринг
   ================================ */

.gg-quiz__share {
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    margin-top: 20px;
}

.gg-quiz__share-title {
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    margin-bottom: 3px;
}

.gg-quiz__share-buttons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    vertical-align: middle;
}

.gg-quiz__share-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 8px;
}

.gg-quiz__share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gg-quiz__share-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.gg-quiz__share-btn span {
    display: none;
}

/* Hover состояния с фирменными цветами */
.gg-quiz__share-btn--telegram:hover,
.gg-quiz__share-btn--telegram:focus {
    background: #0088cc;
    color: #fff;
}

.gg-quiz__share-btn--instagram:hover,
.gg-quiz__share-btn--instagram:focus {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
}

.gg-quiz__share-btn--linkedin:hover,
.gg-quiz__share-btn--linkedin:focus {
    background: #0A66C2;
    color: #fff;
}

.gg-quiz__share-btn--download:hover,
.gg-quiz__share-btn--download:focus {
    background: var(--green-color, #09924e);
    color: #fff;
}

.gg-quiz__share-btn--copy:hover,
.gg-quiz__share-btn--copy:focus {
    background: #495057;
    color: #fff;
}

.gg-quiz__share-message {
    display: none;
    margin-top: 12px;
    padding: 10px 16px;
    background: #d4edda;
    color: #155724;
    border-radius: 8px;
    font-size: 14px;
    animation: ggQuizFadeIn 0.3s ease-out;
    text-align: center;
}

/* ================================
   Ошибка
   ================================ */

.gg-quiz__error {
    padding: 40px 24px;
    text-align: center;
}

.gg-quiz__error p {
    font-size: 15px;
    color: #dc3545;
    margin: 0 0 20px;
}

/* ================================
   Desktop (min-width: 576px)
   ================================ */

@media (min-width: 576px) {
    .gg-quiz__start,
    .gg-quiz__questions,
    .gg-quiz__loading,
    .gg-quiz__result-inner {
        padding: 32px 28px;
    }

    .gg-quiz__cover,
    .gg-quiz__question-image,
    .gg-quiz__result-image {
        margin: -32px -28px 15px;
    }
    
    .gg-quiz__shared-label,
    .gg-quiz__title,
    .gg-quiz__result-title {
        font-size: 26px;
    }

    .gg-quiz__question-title {
        font-size: 20px;
    }

    .gg-quiz__btn {
        width: auto;
    }

    .gg-quiz__btn--restart {
        width: auto;
        min-width: auto;
    }

    .gg-quiz__btn--restart:hover {
        transform: none;
        box-shadow: none;
    }

    .gg-quiz__btn--restart:hover span {
        text-decoration: none;
    }

    .gg-quiz__answers {
        gap: 12px;
    }

    .gg-quiz__answer {
        padding: 16px 20px;
    }

    .gg-quiz__answer:hover {
        background: #edf2f7;
        border-color: #e2e8f0;
    }

    .gg-quiz__answer--selected:hover {
        background: linear-gradient(135deg, #09924e20 0%, #36dd8a20 100%);
        border-color: var(--green-color, #09924e);
    }

    .gg-quiz__share-row {
        flex-direction: row;
    }

    .gg-quiz__share-title {
        margin-bottom: 0;
    }

    .gg-quiz__share-buttons {
        gap: 10px;
    }
}