/**
 * Колесо фортуны v2 - Стили
 * Адаптивная версия с двухколоночной раскладкой
 * 
 * @version 2.3
 */

/* CSS переменные */
.wheel-v2 {
    --pointer-color: #ffd700;
    --border-color: #ffd700;
    --accent-color: #ff1493;
    --accent-light: #ff69b4;
    --yellow-accent: #ffeb3b;
    --pink-button: #ff1493;
}

/* Reset для виджета */
.wheel-v2,
.wheel-v2 * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Popup контейнер */
.wheel-v2 {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wheel-v2--visible {
    opacity: 1;
    visibility: visible;
}

/* Overlay */
.wheel-v2__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

/* Контейнер содержимого */
.wheel-v2__container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* Кнопка закрытия */
.wheel-v2__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.wheel-v2__close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* Основной контент - мобильная версия по умолчанию */
.wheel-v2__content {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
}

/* Левая колонка (форма) */
.wheel-v2__left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Правая колонка (колесо) */
.wheel-v2__right {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Таймер */
.wheel-v2__timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.wheel-v2__timer-label {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: #ffeb3b;
    color: #1a1a1a;
    font-size: 0.8125rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wheel-v2__timer-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #333333;
}

/* Заголовок */
.wheel-v2__header {
    text-align: center;
}

.wheel-v2__title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.wheel-v2__subtitle {
    font-size: clamp(1rem, 3.5vw, 1.25rem);
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

/* Форма */
.wheel-v2__form-wrapper {
    flex: 1;
}

.wheel-v2__form {
    display: flex;
    flex-direction: column;
    gap: 0.9375rem;
}

.wheel-v2__field {
    position: relative;
}

.wheel-v2__input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    color: #333333;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.wheel-v2__input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.wheel-v2__input:focus {
    outline: none;
    border-color: #ff1493;
    background: #ffffff;
}

.wheel-v2__error {
    display: none;
    position: absolute;
    bottom: -1.125rem;
    left: 0;
    font-size: 0.75rem;
    color: #ff6b6b;
}

/* Кнопка отправки */
.wheel-v2__submit {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    border: none;
    border-radius: 30px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
}

.wheel-v2__submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 20, 147, 0.5);
}

.wheel-v2__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Чекбокс согласия */
.wheel-v2__agreement {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    font-size: 0.75rem;
    color: #666666;
    cursor: pointer;
}

.wheel-v2__agreement input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
    accent-color: #ff1493;
}

.wheel-v2__agreement a {
    color: #ff1493;
    text-decoration: underline;
}

.wheel-v2__agreement a:hover {
    color: #ff69b4;
}

/* Legal текст */
.wheel-v2__legal {
    margin-top: auto;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 0 0 20px 20px;
    font-size: 0.6875rem;
    color: rgba(0, 0, 0, 0.5);
    line-height: 1.5;
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Колесо */
.wheel-v2__game {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.wheel-v2__wheel-container {
    position: relative;
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1;
}

.wheel-v2__pointer {
    position: absolute;
    top: -0.625rem;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 0.75rem solid transparent;
    border-right: 0.75rem solid transparent;
    border-top: 1.25rem solid var(--pointer-color, #ffd700);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    z-index: 10;
}

.wheel-v2__wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 0.5rem solid var(--border-color, #ffd700);
    background-size: cover;
    background-position: center;
}

.wheel-v2__segment {
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 
        1px 1px 2px rgba(0, 0, 0, 0.5),
        -1px -1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    word-break: break-word;
}

.wheel-v2__segment span {
    display: block;
    max-width: 100%;
}

/* Результат */
.wheel-v2__result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
    min-width: 300px;
}

.wheel-v2__result-prize {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ff1493;
    padding: 1.5rem;
    background: linear-gradient(135deg, #ff1493 0%, #8a64e6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: prizeGlow 2s ease infinite;
}

@keyframes prizeGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== АДАПТИВНОСТЬ ===== */

/* Десктоп: две колонки */
@media (min-width: 768px) {
    .wheel-v2__result {
        min-width: 400px;
        padding: 3rem;
    }
    
    .wheel-v2__result-prize {
        font-size: 2rem;
    }
    
    .wheel-v2__container {
        max-width: 1100px;
        overflow: visible;
    }
    
    .wheel-v2__content {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
        padding: 2.5rem;
        padding-right: 0;
        overflow: visible;
    }
    
    .wheel-v2__left {
        flex: 0 0 40%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 1.25rem;
    }
    
    .wheel-v2__right {
        flex: 1;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: visible;
        margin-top: -25%;
        margin-bottom: -25%;
        margin-right: -15%;
    }
    
    .wheel-v2__game {
        position: relative;
        overflow: visible;
    }
    
    .wheel-v2__wheel-container {
        width: max(550px, 45vw);
        height: max(550px, 45vw);
        max-width: 540px;
        max-height: 540px;
        aspect-ratio: 1;
    }
    
    .wheel-v2__header {
        text-align: left;
    }
    
    .wheel-v2__timer {
        justify-content: flex-start;
    }
    
    .wheel-v2__close {
        top: -1rem;
        right: -1rem;
        background: rgba(255, 107, 107, 0.95);
        color: #fff;
        font-size: 2rem;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    .wheel-v2__close:hover {
        background: rgba(255, 68, 68, 1);
        transform: rotate(90deg);
    }
    
    .wheel-v2__legal {
        text-align: left;
        padding-left: 2.5rem;
    }
}

/* Мобильные устройства */
@media (max-width: 767px) {
    .wheel-v2__container {
        width: 95%;
        max-height: 95vh;
    }
    
    .wheel-v2__content {
        padding: 1.5rem 1.25rem;
        gap: 1.25rem;
    }
    
    .wheel-v2__wheel-container {
        max-width: 280px;
    }
    
    .wheel-v2__title {
        font-size: 1.25rem;
    }
    
    .wheel-v2__submit {
        font-size: 0.9375rem;
        padding: 0.875rem;
    }
    
    .wheel-v2__close {
        width: 2rem;
        height: 2rem;
        font-size: 1.25rem;
    }
}

/* Малые мобильные */
@media (max-width: 480px) {
    .wheel-v2__wheel-container {
        max-width: 240px;
    }
    
    .wheel-v2__content {
        padding: 1.25rem 1rem;
    }
}

/* Горизонтальная ориентация мобильных */
@media (max-height: 600px) and (orientation: landscape) {
    .wheel-v2__container {
        max-height: 98vh;
    }
    
    .wheel-v2__content {
        padding: 1rem;
        gap: 1rem;
    }
    
    .wheel-v2__wheel-container {
        max-width: 200px;
    }
}
