/* ============================================
   LightScreen Pro — СТИЛИ ДЛЯ КАЛИБРОВКИ ЭКРАНА
   ============================================ */

* {
    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: all 0.3s ease;
}

/* ---------- ФИКСИРОВАННЫЕ КНОПКИ ВВЕРХУ ---------- */
.fixed-back-btn {
    position: fixed !important;
    top: 16px;
    left: 16px;
    z-index: 100;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    color: white !important;
    text-decoration: none;
}

.fixed-back-btn:hover {
    background: rgba(50, 50, 60, 0.95);
    transform: scale(1.02);
}

.fixed-fullscreen-btn {
    position: fixed !important;
    top: 16px;
    right: 16px;
    z-index: 100;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    color: white;
}

.fixed-fullscreen-btn:hover {
    background: rgba(50, 50, 60, 0.95);
    transform: scale(1.02);
}

/* ---------- ПАНЕЛЬ УПРАВЛЕНИЯ ---------- */
.ui-panel {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 30, 0.95);
    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;
}

/* ---------- ОБЩИЕ СТИЛИ КНОПОК ---------- */
.btn {
    background: rgba(40, 40, 50, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
    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(60, 60, 75, 0.95);
    transform: scale(0.96);
    color: white;
}

/* ---------- ИНФОРМАЦИОННЫЙ БЛОК ---------- */
.info-text {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 30px;
}

.info-icon {
    font-size: 18px;
}

.info-title {
    font-size: 14px;
    font-weight: bold;
    color: #00ffff;
}

/* ---------- КНОПКИ ПАТТЕРНОВ ---------- */
.pattern-buttons {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pattern-btn {
    background: rgba(0, 255, 255, 0.15);
    border: 1px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    white-space: nowrap;
}

.pattern-btn:hover {
    background: rgba(0, 255, 255, 0.3);
    transform: scale(0.96);
}

.pattern-btn.active {
    background: linear-gradient(135deg, #00ffff, #0088ff);
    color: #000;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

/* Дополнительные паттерны */
.extra-patterns {
    gap: 8px;
}

.pattern-btn.small {
    padding: 5px 12px;
    font-size: 12px;
}

/* ---------- ИНСТРУКЦИЯ ---------- */
.instruction {
    background: rgba(0, 255, 255, 0.08);
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 11px;
    color: #aaa;
    text-align: left;
    max-width: 100%;
}

.instruction p {
    margin: 2px 0;
}

.instruction strong {
    color: #00ffff;
}

/* ---------- РЕКЛАМНЫЙ БЛОК ---------- */
.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;
}

/* ---------- ТОСТ УВЕДОМЛЕНИЯ ---------- */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(12px);
    color: #00ffff;
    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(30, 30, 40, 0.7);
    backdrop-filter: blur(8px);
    font-size: 9px;
    padding: 3px 12px;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.7);
    z-index: 15;
    white-space: nowrap;
    pointer-events: none;
}

/* ---------- СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ ПАТТЕРНОВ ---------- */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 2;
}

.focus-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 2px solid rgba(0, 255, 255, 0.8);
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
}

.focus-overlay::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(0, 255, 255, 0.8);
    font-size: 30px;
    font-weight: bold;
}

/* ---------- АДАПТИВ ---------- */
@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; }
    .pattern-btn { padding: 6px 12px; font-size: 11px; }
    .pattern-btn.small { padding: 4px 10px; font-size: 10px; }
    .instruction { font-size: 9px; }
    .info-title { font-size: 12px; }
}

@media (max-width: 640px) {
    .hint {
        font-size: 7px;
        top: 6px;
    }
    
    .fixed-back-btn,
    .fixed-fullscreen-btn {
        top: 10px;
    }
    
    .fixed-back-btn {
        left: 10px;
    }
    
    .fixed-fullscreen-btn {
        right: 10px;
    }
    
    .focus-overlay {
        width: 150px;
        height: 150px;
    }
}
/* ========== SEO КОНТЕНТ ========== */
.seo-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    padding: 16px 20px;
    z-index: 9;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    max-height: 40vh;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    color: #ccc;
}

.seo-content.hide {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.seo-content h1 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #00ffff;
}

.seo-content h2 {
    font-size: 16px;
    margin: 12px 0 8px;
    color: #ff99cc;
}

.seo-content h3 {
    font-size: 14px;
    margin: 10px 0 6px;
    color: #ffcc66;
}

.seo-content p {
    margin-bottom: 10px;
    color: #aaa;
}

.seo-content ul, .seo-content ol {
    margin: 8px 0 8px 20px;
}

.seo-content li {
    margin-bottom: 5px;
    color: #aaa;
}

.seo-content a {
    color: #00ffff;
    text-decoration: none;
}

.seo-content a:hover {
    text-decoration: underline;
}

.seo-content strong {
    color: #fff;
}

/* Скрытие при скрытой панели */
.ui-panel.hide ~ .seo-content {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Адаптив */
@media (max-width: 768px) {
    .seo-content {
        padding: 12px 16px;
        font-size: 11px;
        max-height: 35vh;
    }
    .seo-content h1 {
        font-size: 16px;
    }
    .seo-content h2 {
        font-size: 14px;
    }
}
/* ============================================
   ВСПЛЫВАЮЩЕЕ ОКНО С 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) {
    .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;
    }
}