/* ============================================
   LightScreen Pro — ПОЛНЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ ЦВЕТА
   Страница: color.php (все стили в одном файле)
   ============================================ */

/* ---------- RESET И БАЗОВЫЕ СТИЛИ ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #000;
    color: #fff;
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ---------- КОНТЕЙНЕР ЭКРАНА ---------- */
.screen-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.light-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition: background-color 0.05s linear;
}

/* ---------- ПАНЕЛЬ УПРАВЛЕНИЯ ---------- */
.ui-panel {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 10px 14px;
    z-index: 10;
    transition: transform 0.3s, opacity 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.15);
    min-width: 280px;
    max-width: 95vw;
    text-align: center;
}

.ui-panel.hide {
    transform: translateX(-50%) translateY(120%);
    opacity: 0;
    pointer-events: none;
}

.ui-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
    cursor: grab;
    user-select: none;
}

.ui-row:active {
    cursor: grabbing;
}

.ui-row:last-child {
    margin-bottom: 0;
}

.ui-row::-webkit-scrollbar {
    height: 3px;
}

.ui-row::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ui-row::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.5);
    border-radius: 3px;
}

/* ---------- ФИКСИРОВАННЫЕ КНОПКИ ВВЕРХУ ---------- */
.fixed-back-btn {
    position: fixed !important;
    top: 16px;
    left: 16px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.fixed-back-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.02);
}

.fixed-fullscreen-btn {
    position: fixed !important;
    top: 16px;
    right: 16px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.fixed-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.02);
}

/* ---------- ОБЩИЕ СТИЛИ КНОПОК ---------- */
.btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn:hover,
.btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.96);
}

/* ---------- СЕЛЕКТОР ЭФФЕКТОВ ---------- */
select.effect-select {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: white;
    padding: 6px 14px;
    padding-right: 32px;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white' width='16px' height='16px'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    white-space: nowrap;
    flex-shrink: 0;
}

select.effect-select:hover,
select.effect-select:focus {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
}

select.effect-select option {
    background: #1a1a2e;
    color: white;
}

/* ---------- СЛАЙДЕР ЯРКОСТИ ---------- */
.slider-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 30px;
    flex-shrink: 0;
}

.slider-group label {
    color: #0ff;
    font-weight: bold;
    font-size: 12px;
}

input[type="range"] {
    width: 100px;
    height: 3px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0ff;
    cursor: pointer;
    border: none;
    -webkit-appearance: none;
}

.value-display {
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    color: #0ff;
    min-width: 45px;
    text-align: center;
}

/* ---------- ТЕКУЩИЙ ЦВЕТ (КЛИКАБЕЛЬНЫЙ С КНОПКОЙ ВЫЗОВА ПАЛИТРЫ) ---------- */
.current-color-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    border-radius: 30px;
    flex-shrink: 0;
    cursor: pointer;
    transition: 0.2s;
}

.current-color-info:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.02);
}

.current-color-info:active {
    transform: scale(0.98);
}

.current-color-preview {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #0ff;
}

.current-color-hex {
    font-size: 12px;
    font-weight: bold;
    color: #0ff;
    font-family: monospace;
}

.picker-icon {
    font-size: 16px;
    color: #0ff;
    opacity: 0.7;
    transition: 0.2s;
    background: rgba(0, 255, 255, 0.15);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.current-color-info:hover .picker-icon {
    opacity: 1;
    transform: scale(1.1);
    background: rgba(0, 255, 255, 0.3);
}

/* ---------- ПАЛИТРА ЦВЕТОВ (КРУГИ-ССЫЛКИ) ---------- */
.color-palette {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 8px 0 12px 0;
    cursor: grab;
    user-select: none;
    scroll-behavior: smooth;
}

.color-palette:active {
    cursor: grabbing;
}

.color-palette::-webkit-scrollbar {
    height: 3px;
}

.color-palette::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.color-palette::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.5);
    border-radius: 3px;
}

.palette-item {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.palette-item:hover {
    transform: scale(1.1);
    border-color: #0ff;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.5);
}

.palette-item.active {
    border-color: #0ff;
    transform: scale(1.05);
    box-shadow: 0 0 16px rgba(0, 255, 255, 0.6);
}

/* ---------- TOAST УВЕДОМЛЕНИЯ ---------- */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    color: #0ff;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
    font-weight: 500;
}

/* ---------- ПОДСКАЗКА ---------- */
.hint {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    font-size: 9px;
    padding: 3px 12px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.6);
    z-index: 15;
    white-space: nowrap;
    pointer-events: none;
}

/* ---------- РЕКЛАМНЫЙ БЛОК ---------- */
.ad-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 5px 10px;
    text-align: center;
    font-size: 9px;
    color: #ccc;
    z-index: 20;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ad-badge {
    background: #ff00cc;
    color: #000;
    padding: 2px 8px;
    border-radius: 16px;
    font-weight: bold;
    font-size: 8px;
}

/* ---------- ЭФФЕКТЫ АНИМАЦИИ ---------- */
@keyframes pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.15); }
}
.effect-pulse { animation: pulse 1s infinite ease-in-out; }

@keyframes candle {
    0%, 100% { filter: brightness(1); }
    25% { filter: brightness(1.08); }
    75% { filter: brightness(0.94); }
}
.effect-candle { animation: candle 0.3s infinite; }

@keyframes rainbow {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}
.effect-rainbow { animation: rainbow 3s linear infinite; }

/* ---------- АНИМАЦИЯ СОХРАНЕНИЯ ---------- */
@keyframes save-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.save-success {
    animation: save-success 0.3s ease;
}

/* ============================================
   ВСПЛЫВАЮЩЕЕ ОКНО С SEO КОНТЕНТОМ
   ============================================ */
.seo-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.seo-modal.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.seo-modal-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 255, 255, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.seo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
}

.seo-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #00ffff, #ff99cc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.seo-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.seo-modal-close:hover {
    background: rgba(255, 80, 80, 0.6);
    transform: scale(1.05);
}

.seo-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
    font-size: 14px;
    line-height: 1.6;
    color: #e0e0e0;
}

.seo-modal-body h1 {
    font-size: 22px;
    color: #00ffff;
    margin: 0 0 16px 0;
}

.seo-modal-body h2 {
    font-size: 18px;
    color: #ff99cc;
    margin: 20px 0 12px 0;
}

.seo-modal-body h3 {
    font-size: 16px;
    color: #ffcc66;
    margin: 16px 0 10px 0;
}

.seo-modal-body p {
    margin-bottom: 12px;
    color: #ccc;
}

.seo-modal-body ul, .seo-modal-body ol {
    margin: 10px 0 10px 20px;
}

.seo-modal-body li {
    margin-bottom: 6px;
    color: #bbb;
}

.seo-modal-body strong {
    color: #fff;
}

.seo-modal-body a {
    color: #00ffff;
    text-decoration: none;
}

.seo-modal-body a:hover {
    text-decoration: underline;
}

/* ---------- АДАПТИВ ---------- */
@media (max-width: 768px) {
    .btn { padding: 5px 10px; font-size: 11px; }
    .toast { white-space: normal; text-align: center; max-width: 80%; bottom: 90px; }
    .ui-panel { padding: 8px 12px; bottom: 70px; }
    .slider-group { padding: 3px 10px; }
    input[type="range"] { width: 80px; }
    .palette-item { width: 38px; height: 38px; }
    .picker-icon { width: 22px; height: 22px; font-size: 12px; }
    
    .seo-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    .seo-modal-header {
        padding: 16px 20px;
    }
    .seo-modal-header h2 {
        font-size: 16px;
    }
    .seo-modal-body {
        padding: 16px;
        font-size: 12px;
    }
    .seo-modal-body h1 {
        font-size: 18px;
    }
    .seo-modal-body h2 {
        font-size: 16px;
    }
    .seo-modal-body h3 {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .hint {
        font-size: 7px;
        top: 6px;
        right: 6px;
    }
    
    .fixed-back-btn,
    .fixed-fullscreen-btn {
        top: 10px;
    }
    
    .fixed-back-btn {
        left: 10px;
    }
    
    .fixed-fullscreen-btn {
        right: 10px;
    }
    
    select.effect-select {
        padding: 5px 10px;
        padding-right: 28px;
        font-size: 11px;
    }
    
    .palette-item {
        width: 34px;
        height: 34px;
    }
    
    .current-color-info {
        padding: 3px 10px;
    }
    
    .current-color-preview {
        width: 24px;
        height: 24px;
    }
    
    .current-color-hex {
        font-size: 10px;
    }
    
    .picker-icon {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* ---------- СТИЛИ ДЛЯ PICKR (ПАЛИТРА) ---------- */
.pickr {
    display: inline-block;
}

.pickr .pcr-button {
    display: none;
}

.pcr-app {
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
}

.pcr-app .pcr-interaction .pcr-result {
    background: rgba(255, 255, 255, 0.1);
    color: #0ff;
    border: none;
    border-radius: 30px;
}

.pcr-app .pcr-interaction input {
    border-radius: 30px;
}

.pcr-app .pcr-interaction button {
    border-radius: 30px;
    background: rgba(0, 255, 255, 0.2);
    color: #0ff;
}

.pcr-app .pcr-interaction button.pcr-save {
    background: linear-gradient(135deg, #0ff, #f0f);
    color: white;
}

.pcr-app .pcr-selection .pcr-color-preview {
    border-radius: 16px;
    border: 1px solid rgba(0, 255, 255, 0.5);
}

/* Индикатор активности Wake Lock */
.wake-lock-active {
    position: fixed;
    bottom: 60px;
    right: 10px;
    background: rgba(0, 255, 255, 0.3);
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 8px;
    color: #0ff;
    z-index: 25;
    pointer-events: none;
}