/* ============================================
   Box Shadow Generator — Стили
   ============================================ */

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

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

/* ============================================
   Контейнер: превью + панель управления
   ============================================ */
.shadow-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: 
        linear-gradient(45deg, #2a2a3e 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a3e 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a3e 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a3e 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #1a1a2e;
    border-radius: 12px;
    padding: 2rem;
    min-height: 400px;
}

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

.preview-text {
    color: #333;
    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: #4facfe;
    font-family: 'Courier New', monospace;
}

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

/* ============================================
   Список теней
   ============================================ */
.shadows-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.shadows-list::-webkit-scrollbar {
    width: 6px;
}

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

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

/* Один элемент тени */
.shadow-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem;
    animation: slideIn 0.3s ease;
}

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

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

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

.shadow-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shadow-item-title {
    color: #4facfe;
    font-weight: 600;
    font-size: 0.9rem;
}

.remove-shadow-btn {
    background: rgba(245, 87, 108, 0.15);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    color: #f5576c;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

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

.shadow-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.shadow-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.shadow-control label {
    min-width: 70px;
    color: #888;
    font-size: 0.8rem;
}

.shadow-control input[type="range"] {
    flex: 1;
}

.shadow-control .value-display {
    min-width: 50px;
    color: #4facfe;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    text-align: right;
}

.shadow-control input[type="color"] {
    width: 40px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: none;
    padding: 0;
}

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

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

/* Чекбокс Inset */
.inset-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.inset-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #4facfe;
}

.inset-control label {
    color: #a0a0b0;
    font-size: 0.85rem;
    cursor: pointer;
}

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

.add-shadow-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.6);
    transform: translateY(-1px);
}

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

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

/* Счётчик теней */
.shadows-count {
    color: #667eea;
    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: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 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.8rem;
    color: #667eea;
    overflow-x: auto;
    word-break: break-all;
    line-height: 1.5;
}

.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);
}

/* ============================================
   Кнопки действий
   ============================================ */
.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, #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);
}

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

/* ============================================
   Переключатель фона превью
   ============================================ */
.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(102, 126, 234, 0.3);
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 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, #667eea 0%, #764ba2 100%);
}

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

/* ============================================
   Переключатель форматов CSS/Tailwind
   ============================================ */
.format-switcher {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

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

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

.format-btn.active {
    background: rgba(79, 172, 254, 0.2);
    border-color: #4facfe;
    color: #4facfe;
}

.format-hint {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(56, 189, 248, 0.1);
    border-left: 3px solid #38bdf8;
    border-radius: 6px;
    color: #7dd3fc;
    font-size: 0.85rem;
    line-height: 1.5;
}