/* ============================================
   Border Radius Generator — Стили
   ============================================ */

/* ============================================
   Базовая структура
   ============================================ */
.radius-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #43e97b, #38f9d7, #4facfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: #a0a0b0;
    font-size: 1.1rem;
}

/* ============================================
   Контейнер
   ============================================ */
.radius-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 2rem;
}

/* ============================================
   Превью
   ============================================ */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 2rem;
    min-height: 400px;
    transition: background 0.3s ease;
}

.radius-preview {
    width: 200px;
    height: 200px;
    background: #667eea;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.preview-text {
    color: white;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
}

/* ============================================
   Настройки превью
   ============================================ */
.preview-settings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.preview-setting {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: #a0a0b0;
}

.preview-setting label {
    min-width: 100px;
}

.preview-setting input[type="range"] {
    flex: 1;
}

.preview-setting input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.preview-setting span {
    min-width: 40px;
    color: #43e97b;
    font-family: 'Courier New', monospace;
}

/* ============================================
   Select (выпадающий список) — УЛУЧШЕННЫЙ
   ============================================ */
.preview-setting select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-size: 0.9rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.preview-setting select:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.preview-setting select:focus {
    outline: none;
    border-color: #43e97b;
    box-shadow: 0 0 0 2px rgba(67, 233, 123, 0.2);
}

/* Стили для option (выпадающий список) */
.preview-setting select option {
    background: #2a2a3e;
    color: #ffffff;
    padding: 0.5rem;
}

.preview-setting select option:hover {
    background: #43e97b;
    color: #ffffff;
}

/* ============================================
   Переключатель фона превью
   ============================================ */
.bg-switcher {
    display: flex;
    gap: 0.5rem;
}

.bg-btn {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.bg-btn.active {
    background: rgba(67, 233, 123, 0.3);
    border-color: #43e97b;
    box-shadow: 0 0 10px rgba(67, 233, 123, 0.5);
}

/* Разные фоны превью */
.preview-wrapper.bg-light {
    background: #f5f5f5;
}

.preview-wrapper.bg-dark {
    background: #1a1a2e;
}

.preview-wrapper.bg-checker {
    background: 
        linear-gradient(45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(-45deg, #e0e0e0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e0e0e0 75%),
        linear-gradient(-45deg, transparent 75%, #e0e0e0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #f5f5f5;
}

.preview-wrapper.bg-gradient {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* ============================================
   Панель управления
   ============================================ */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    color: #a0a0b0;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ============================================
   Переключатель режима
   ============================================ */
.mode-switcher {
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #a0a0b0;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.mode-btn.active {
    background: rgba(67, 233, 123, 0.2);
    border-color: #43e97b;
    color: #43e97b;
}

/* ============================================
   Сетка углов
   ============================================ */
.corners-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.corner-control {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.corner-control label {
    color: #888;
    font-size: 0.8rem;
    font-weight: 600;
}

.corner-control input[type="range"] {
    width: 100%;
}

.corner-value {
    color: #43e97b;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    text-align: center;
}

/* ============================================
   Range slider
   ============================================ */
input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(67, 233, 123, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(67, 233, 123, 0.5);
}

/* ============================================
   Пресеты
   ============================================ */
.presets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.preset-btn {
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preset-btn:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.preset-btn:active {
    transform: scale(0.95);
}

/* ============================================
   Box с CSS кодом
   ============================================ */
.code-box {
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    padding-right: 3.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #43e97b;
    overflow-x: auto;
    word-break: break-all;
}

.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.copy-btn.copied {
    background: rgba(76, 217, 100, 0.3);
}

/* ============================================
   Кнопки действий
   ============================================ */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.random-btn {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
    color: white;
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(67, 233, 123, 0.4);
}

.reset-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.reset-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.action-btn:active {
    transform: translateY(0);
}

/* ============================================
   Адаптивность
   ============================================ */
@media (max-width: 768px) {
    .radius-container {
        grid-template-columns: 1fr;
    }
    
    .preview-wrapper {
        min-height: 300px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .presets {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .corners-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}