/**
 * Файл: wheel.css
 * Описание: Стили для фронтенда колеса фортуны
 */

/* Контейнер колеса */
.fw-wheel-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Предупреждение об истечении */
.fw-warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    color: #856404;
}

/* Обёртка формы */
.fw-form-wrapper {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
    box-sizing: border-box;
}

/* Группы полей формы */
.fw-form-group {
    margin-bottom: 20px;
}

.fw-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* Поля ввода */
.fw-input {
    width: 100%;
    padding: 12px 0;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.fw-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.fw-input.error {
    border-color: #f44336;
}

/* Чекбоксы */
.fw-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.fw-checkbox {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.fw-checkbox-label span {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

/* Кнопка "Крутить колесо" */
.fw-spin-button {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fw-spin-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.fw-spin-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.fw-spin-button.spinning {
    background: #999;
    pointer-events: none;
}

/* Обёртка колеса */
.fw-wheel-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    width: 100%;
    max-width: 600px;
}

#fw-canvas,
canvas[id^="fw-canvas-"] {
    max-width: 100%;
    height: auto;
    display: block;
    width: 100%;
}

/* Сообщения об ошибках/успехе */
.fw-message {
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

.fw-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.fw-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.fw-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Адаптивность */
@media (max-width: 768px) {
    .fw-wheel-container {
        padding: 15px;
    }
    
    .fw-form-wrapper {
        padding: 20px;
        max-width: 100%;
    }
    
    .fw-input {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .fw-spin-button {
        font-size: 16px;
        padding: 12px;
    }
    
    #fw-canvas,
    canvas[id^="fw-canvas-"] {
        width: 100% !important;
        height: auto !important;
    }
    
    .fw-wheel-wrapper {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .fw-wheel-container {
        padding: 10px;
    }
    
    .fw-form-wrapper {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .fw-form-group {
        margin-bottom: 15px;
    }
    
    .fw-input {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .fw-spin-button {
        font-size: 14px;
        padding: 12px 15px;
    }
    
    .fw-checkbox-label span {
        font-size: 12px;
    }
}

/* Попап окно с призом */
.fw-prize-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.fw-prize-modal.active {
    display: flex;
}

.fw-prize-modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fw-prize-modal-content h2 {
    font-size: 24px;
    color: #333;
    margin: 0 0 20px 0;
    font-weight: 700;
}

.fw-prize-modal-content .fw-prize-name {
    font-size: 28px;
    color: #667eea;
    font-weight: 700;
    margin: 20px 0;
    padding: 15px;
    background-color: #f0f4ff;
    border-radius: 8px;
}

.fw-prize-modal-content p {
    font-size: 16px;
    color: #555;
    line-height: 1.6;
    margin: 15px 0;
}

.fw-prize-modal-content .fw-modal-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fw-prize-modal-content .fw-modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.fw-prize-modal-content .fw-modal-button:active {
    transform: translateY(0);
}

/* Адаптивность попапа */
@media (max-width: 480px) {
    .fw-prize-modal-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .fw-prize-modal-content h2 {
        font-size: 20px;
    }
    
    .fw-prize-modal-content .fw-prize-name {
        font-size: 24px;
    }
    
    .fw-prize-modal-content p {
        font-size: 14px;
    }
    
    .fw-prize-modal-content .fw-modal-button {
        padding: 12px 30px;
        font-size: 14px;
    }
}

/* Анимация конфетти (управляется через confetti.js) */
canvas.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Попапы соглашений */
.fw-consent-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10010;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fw-consent-modal.active {
    display: flex;
}

.fw-consent-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    padding: 24px 24px 16px 24px;
    display: flex;
    flex-direction: column;
}

.fw-consent-modal__title {
    margin: 0 32px 12px 0;
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.fw-consent-modal__content {
    overflow: auto;
    padding-right: 8px;
    color: #444;
    line-height: 1.6;
}

.fw-consent-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #333;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.fw-consent-modal__close:hover {
    color: #000;
}

/* Кликабельные тексты согласий */
.fw-consent-text {
    color: #3b6fe8;
    text-decoration: underline;
    cursor: pointer;
}