/* ============================================
   Gradient Generator — Стили
   ============================================ */

/* ============================================
   Базовая структура страницы
   ============================================ */
.gradient-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, #f093fb, #f5576c, #4facfe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

/* ============================================
   Контейнер: превью + панель управления
   ============================================ */
.gradient-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;
    align-items: center;
    justify-content: center;
}

.gradient-preview {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, #f093fb, #f5576c, #4facfe);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease;
}

.preview-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ============================================
   Панель управления
   ============================================ */
.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;
}

/* ============================================
   Radio кнопки типов градиента
   ============================================ */
.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.radio-label:hover {
    background: rgba(255, 255, 255, 0.1);
}

.radio-label input[type="radio"] {
    cursor: pointer;
}

/* ============================================
   Динамический список цветов (НОВОЕ!)
   ============================================ */
.colors-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

/* Кастомный скроллбар */
.colors-list::-webkit-scrollbar {
    width: 6px;
}

.colors-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.colors-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.colors-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Один элемент цвета */
.color-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

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

.color-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.color-item.removing {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(10px);
        height: 0;
        padding: 0;
        margin: 0;
    }
}

/* Номер цвета */
.color-number {
    color: #666;
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* Обёртка color picker + text input */
.color-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
}

.color-input-wrapper input[type="color"] {
    width: 40px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input-wrapper input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.color-text {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: white;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    min-width: 0;
}

/* Кнопка удаления цвета */
.remove-color-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(245, 87, 108, 0.15);
    color: #f5576c;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-color-btn:hover {
    background: rgba(245, 87, 108, 0.3);
    transform: scale(1.1);
}

.remove-color-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

/* Кнопка добавления цвета */
.add-color-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(79, 172, 254, 0.1);
    border: 1px dashed rgba(79, 172, 254, 0.4);
    border-radius: 8px;
    color: #4facfe;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.add-color-btn:hover {
    background: rgba(79, 172, 254, 0.2);
    border-color: rgba(79, 172, 254, 0.6);
    transform: translateY(-1px);
}

.add-color-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.plus-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Счётчик цветов */
.colors-count {
    color: #4facfe;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ============================================
   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: 20px;
    height: 20px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(240, 147, 251, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(240, 147, 251, 0.5);
}

/* ============================================
   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: #4facfe;
    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);
}

/* ============================================
   Пресеты
   ============================================ */
.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);
}

/* ============================================
   Кнопки Random и Reset
   ============================================ */
.random-section {
    display: flex;
    gap: 0.5rem;
}

.random-btn,
.reset-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, #667eea, #764ba2);
    color: white;
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 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);
}

.random-btn:active,
.reset-btn:active {
    transform: translateY(0);
}

/* ============================================
   Подсказки (hints)
   ============================================ */
.hint-message {
    border-left: 3px solid #4facfe;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

/* Информационная подсказка (синяя) */
.hint-info {
    border-left-color: #4facfe;
    background: rgba(79, 172, 254, 0.1);
    color: #a0c4ff;
}

/* Подсказка-совет (зелёная) */
.hint-tip {
    border-left-color: #43e97b;
    background: rgba(67, 233, 123, 0.1);
    color: #a8edbb;
}

/* Предупреждение (жёлтая) */
.hint-warning {
    border-left-color: #fee140;
    background: rgba(254, 225, 64, 0.1);
    color: #fff3b0;
}

/* Ошибка (красная) */
.hint-error {
    border-left-color: #f5576c;
    background: rgba(245, 87, 108, 0.1);
    color: #ffb3bc;
}

/* ============================================
   Адаптивность
   ============================================ */
@media (max-width: 768px) {
    .gradient-container {
        grid-template-columns: 1fr;
    }
    
    .gradient-preview {
        height: 250px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .presets {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .radio-group {
        flex-wrap: wrap;
    }
    
    .random-section {
        flex-direction: column;
    }
}

/* ============================================
   Блок описания инструмента
   ============================================ */
.tool-description-block {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.tool-description-block h2 {
    color: #4facfe;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.tool-description-block p {
    color: #a0a0b0;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* ============================================
   Блок преимуществ
   ============================================ */
.features-block {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 2rem;
}

.features-block h2 {
    text-align: center;
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-item h3 {
    color: #ffffff;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: #a0a0b0;
    line-height: 1.6;
}

/* ============================================
   Блок "Как использовать"
   ============================================ */
.how-to-block {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 2rem;
}

.how-to-block h2 {
    text-align: center;
    color: #ffffff;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.step-item {
    display: flex;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.step-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.step-content h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.step-content p {
    color: #a0a0b0;
    line-height: 1.6;
}

/* Адаптивность */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .step-item {
        flex-direction: column;
        text-align: center;
    }
    
    .step-number {
        margin: 0 auto;
    }
}