:root {
    --page-bg: #e2e8f0;
    --platform-bg: #cbd5e1;
    --monitor-bg: rgba(255, 255, 255, 0.45);
    --module-bg: rgba(255, 255, 255, 0.75);
    --plate-bg: rgba(255, 255, 255, 0.95);
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-shadow: 0 0 15px rgba(255, 255, 255, 1);
    --accent: #2563eb;
    --border: rgba(0, 0, 0, 0.1);
    --monitor-edge: inset 0 0 0 1px rgba(255, 255, 255, 0.7), inset 0 0 20px rgba(255, 255, 255, 0.5);
    
    --input-glow: 0 5px 25px rgba(37, 99, 235, 0.25);
    --input-border-glow: rgba(37, 99, 235, 0.5);

    --azure-bg: rgba(37, 99, 235, 0.1); --azure-glow: 0 10px 20px rgba(37, 99, 235, 0.15);
    --indigo-bg: rgba(79, 70, 229, 0.1); --indigo-color: #4f46e5;
    --emerald-bg: rgba(16, 185, 129, 0.1); --emerald-color: #10b981;
    --gold-bg: rgba(217, 119, 6, 0.1); --gold-color: #d97706; --gold-glow: 0 10px 20px rgba(217, 119, 6, 0.15);
}

[data-theme="dark"] {
    --page-bg: #000000;
    --platform-bg: #020617;
    --monitor-bg: rgba(10, 15, 25, 0.25);
    --module-bg: rgba(15, 23, 42, 0.4);
    --plate-bg: rgba(30, 41, 59, 0.7);
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.8);
    --accent: #38bdf8;
    --border: rgba(255, 255, 255, 0.15);
    --monitor-edge: inset 0 0 0 1px rgba(255, 255, 255, 0.3), inset 0 0 30px rgba(255, 255, 255, 0.05);
    
    --input-glow: 0 5px 30px rgba(56, 189, 248, 0.3);
    --input-border-glow: rgba(56, 189, 248, 0.6);

    --azure-bg: rgba(59, 130, 246, 0.15); --azure-glow: 0 10px 20px rgba(59, 130, 246, 0.2);
    --indigo-bg: rgba(129, 140, 248, 0.15); --indigo-color: #818cf8;
    --emerald-bg: rgba(52, 211, 153, 0.15); --emerald-color: #34d399;
    --gold-bg: rgba(251, 191, 36, 0.15); --gold-color: #fbbf24; --gold-glow: 0 10px 20px rgba(251, 191, 36, 0.2);
}

* { box-sizing: border-box; }
body, html { 
    margin: 0; padding: 0; height: 100%; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    overflow: hidden; background: var(--page-bg); color: var(--text-main); 
}

.oled-environment { width: 100%; height: 100vh; display: flex; align-items: center; justify-content: center; }

.art-platform {
    width: 100%; height: 100%; max-width: 1600px;
    background: var(--platform-bg); 
    padding: 8vh 8vw; 
    position: relative; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.4s ease;
}

#avantgarde-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

.transparent-monitor {
    width: 100%; height: 100%; 
    background: var(--monitor-bg);
    backdrop-filter: blur(12px) saturate(120%); -webkit-backdrop-filter: blur(12px) saturate(120%);
    border-radius: 30px; display: flex; flex-direction: column; overflow: hidden;
    box-shadow: var(--monitor-edge), 0 30px 60px rgba(0,0,0,0.3);
    position: relative; z-index: 10; transition: all 0.4s ease; border: 1px solid var(--border);
}

.transparent-monitor h1, .transparent-monitor h3, .transparent-monitor span:not(.indicator), .transparent-monitor strong, .module-title { text-shadow: var(--text-shadow); }

.monitor-header { height: 60px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; padding: 0 25px; background: rgba(0,0,0,0.03); }
.header-left { display: flex; align-items: center; gap: 15px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; }
.brand strong { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-main); transition: 0.2s; }
.icon-btn:hover { color: var(--accent); }
.btn-primary { background: var(--text-main); color: var(--page-bg); border: none; padding: 6px 18px; border-radius: 20px; font-weight: 700; font-size: 13px; cursor: pointer; }
.mobile-only { display: none; }

.monitor-content { display: flex; flex: 1; overflow: hidden; position: relative; }
.glass-module { flex: 0 0 auto; background: var(--module-bg); padding: 25px; border-right: 1px solid var(--border); overflow-y: auto; transition: left 0.3s ease; }
.module-title { font-size: 11px; font-weight: 900; color: var(--text-muted); letter-spacing: 1.5px; margin-bottom: 24px; text-transform: uppercase; }

.status-plate { background: var(--plate-bg); padding: 15px; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 4px 12px rgba(0,0,0,0.05); margin-bottom: 25px; display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; }
.indicator { width: 10px; height: 10px; background: #10b981; border-radius: 50%; box-shadow: 0 0 12px #10b981; }

.nav-menu a { display: block; margin-bottom: 16px; font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; text-shadow: none; }
.nav-menu a:hover { text-decoration: underline; }

.promo-block { margin-top: 30px; padding: 15px; background: rgba(0,0,0,0.05); border-radius: 12px; border: 1px dashed var(--border); font-size: 11px; color: var(--text-muted); line-height: 1.5; text-shadow: none; }

.glass-resizer { width: 1px; background: var(--border); cursor: col-resize; position: relative; z-index: 20; }
.glass-resizer:hover { background: var(--accent); width: 3px; box-shadow: 0 0 10px var(--accent); }

.main-workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view-panel { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }

.hero-title { font-size: 38px; font-weight: 900; letter-spacing: -1.5px; margin-top: 15px; margin-bottom: 30px; text-align: center; }
.hero-title span { color: var(--accent); }

.grid-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; width: 100%; max-width: 650px; }
.tool-plate { background: var(--plate-bg); border: 1px solid var(--border); padding: 20px 15px; border-radius: 20px; text-align: center; cursor: pointer; box-shadow: 0 10px 20px rgba(0,0,0,0.05); transition: 0.3s; position: relative; }
.tool-plate h3 { font-size: 14px; margin: 0; }
.tool-plate:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }

.icon-wrap { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.azure-glow { background: var(--azure-bg); color: var(--accent); box-shadow: var(--azure-glow); }
.indigo-glow { background: var(--indigo-bg); color: var(--indigo-color); }
.emerald-glow { background: var(--emerald-bg); color: var(--emerald-color); }
.gold-glow { background: var(--gold-bg); color: var(--gold-color); box-shadow: var(--gold-glow); }

.badge-free, .badge-pro, .badge-vip { position: absolute; top: 12px; right: 12px; font-size: 8px; font-weight: 900; padding: 3px 6px; border-radius: 6px; text-shadow: none !important; }
.badge-free { background: #10b981; color: #fff; }
.badge-pro { background: #6366f1; color: #fff; }
.badge-vip { background: linear-gradient(135deg, #fbbf24, #d97706); color: #000; }

.hidden { display: none !important; }
.monitor-footer { height: 40px; border-top: 1px solid var(--border); display: flex; justify-content: center; align-items: center; font-size: 11px; color: var(--text-muted); background: rgba(0,0,0,0.05); }

/* Чат */
.chat-top { width: 100%; padding: 15px 25px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 20px; font-weight: 700; }
.back-btn { background: none; border: none; cursor: pointer; color: var(--text-main); font-size: 14px; font-weight: 700; text-shadow: var(--text-shadow); }
.chat-messages { flex: 1; width: 100%; overflow-y: auto; padding: 25px; display: flex; flex-direction: column; gap: 20px; }
.chat-input-box { padding: 25px; border-top: 1px solid var(--border); width: 100%; transition: 0.3s; }

.highlighted-input { max-width: 800px; margin: 0 auto; background: var(--plate-bg); border: 1px solid var(--input-border-glow); padding: 8px 8px 8px 20px; border-radius: 30px; display: flex; align-items: center; gap: 15px; box-shadow: var(--input-glow); }
.highlighted-input input { flex: 1; background: none; border: none; outline: none; color: var(--text-main); font-size: 14px; font-weight: 600; text-shadow: none; }
.highlighted-input input::placeholder { color: var(--text-muted); opacity: 0.8; font-weight: 400; }
.send-btn { background: var(--accent); color: #fff; border: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-weight: bold; transition: 0.2s; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }

/* Кнопки и панель действий */
.voice-btn { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 5px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.voice-btn:hover { color: var(--accent); }
.voice-btn.recording { color: #ef4444; animation: voicePulse 1.5s infinite; }

@keyframes voicePulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.ai-message-container { background: var(--plate-bg); padding: 18px 24px; border-radius: 20px; border: 1px solid var(--border); align-self: flex-start; max-width: 85%; box-shadow: 0 10px 20px rgba(0,0,0,0.05); text-shadow: none; color: var(--text-main); line-height: 1.6; position: relative; }
.generated-image { max-width: 100%; border-radius: 15px; margin-top: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.2); display: block; }

.msg-actions { display: flex; gap: 8px; margin-top: 15px; padding-top: 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.msg-actions button { background: rgba(128, 128, 128, 0.1); border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; font-weight: 600; padding: 6px 12px; border-radius: 12px; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: 0.2s; }
.msg-actions button:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Модальное окно PRO */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 1; transition: opacity 0.3s; }
.modal-overlay.hidden { opacity: 0; pointer-events: none; }
.pro-modal-content { background: var(--plate-bg); border: 1px solid var(--border); padding: 40px; border-radius: 30px; width: 90%; max-width: 450px; text-align: center; position: relative; box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(255,255,255,0.2); transform: translateY(0); transition: transform 0.3s; color: var(--text-main); }
.modal-overlay.hidden .pro-modal-content { transform: translateY(30px); }
.close-modal-btn { position: absolute; top: 20px; right: 20px; background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; transition: 0.2s; }
.close-modal-btn:hover { color: #ef4444; }
.modal-header-icon { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.pro-modal-content h2 { margin: 0 0 10px; font-size: 24px; font-weight: 800; }
.pro-modal-content p { font-size: 13px; color: var(--text-muted); margin-bottom: 25px; line-height: 1.5; text-shadow: none; }
.pro-form { display: flex; flex-direction: column; gap: 15px; }
.pro-form input, .pro-form textarea { background: rgba(128,128,128,0.1); border: 1px solid var(--border); padding: 15px; border-radius: 15px; color: var(--text-main); font-family: inherit; outline: none; }
.pro-form input:focus, .pro-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 10px rgba(37, 99, 235, 0.2); }
.submit-pro-btn { background: linear-gradient(135deg, #fbbf24, #d97706); color: #000; border: none; padding: 15px; border-radius: 15px; font-weight: 800; font-size: 14px; cursor: pointer; box-shadow: 0 10px 20px rgba(217, 119, 6, 0.3); transition: 0.2s; }
.submit-pro-btn:hover { transform: translateY(-2px); box-shadow: 0 15px 30px rgba(217, 119, 6, 0.4); }
.success-text { color: #10b981; font-weight: 700; margin-top: 20px; font-size: 14px; text-shadow: none; }

/* Панель настроек (JANGERA PRO) */
.pro-settings-bar { padding: 12px 25px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; background: rgba(0,0,0,0.05); flex-wrap: wrap; transition: 0.3s; }
.pro-settings-bar.hidden { display: none !important; }
.glass-select, .glass-input { background: var(--plate-bg); border: 1px solid var(--border); color: var(--text-main); padding: 8px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; outline: none; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
.glass-select { cursor: pointer; }
.glass-select option { background: var(--page-bg); color: var(--text-main); }
.glass-input { flex: 1; min-width: 150px; }
.btn-save-key { background: rgba(128, 128, 128, 0.1); border: 1px solid var(--border); color: var(--text-muted); padding: 8px 16px; border-radius: 12px; cursor: pointer; font-size: 12px; font-weight: 800; transition: 0.2s; }
.btn-save-key:hover { background: #10b981; color: #fff; border-color: #10b981; }
.btn-buy-key { background: linear-gradient(135deg, #fbbf24, #d97706); color: #000; border: none; padding: 8px 16px; border-radius: 12px; cursor: pointer; font-size: 12px; font-weight: 800; transition: 0.2s; }
.btn-buy-key:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3); }

/* Мобильная адаптация */
@media (max-width: 768px) {
    .mobile-only { display: inline-block; }
    .art-platform { padding: 12vh 6vw 15vh 6vw; width: 100%; height: 100%; border-radius: 0; }
    .transparent-monitor { border-radius: 20px; }
    body.fullscreen-active .art-platform { padding: 0; }
    body.fullscreen-active .transparent-monitor { border-radius: 0; border: none; }
    .hero-title { font-size: 28px; margin-top: 10px; margin-bottom: 20px; }
    .grid-tools { gap: 10px; padding: 0 5px; }
    .tool-plate { padding: 15px 10px; border-radius: 16px; }
    .tool-plate h3 { font-size: 12px; }
    .icon-wrap { width: 40px; height: 40px; margin-bottom: 8px; }
    .icon-wrap svg { width: 20px; height: 20px; }
    .glass-module { position: absolute; left: -100%; top: 0; bottom: 0; width: 280px !important; z-index: 100; box-shadow: 10px 0 40px rgba(0,0,0,0.9); background: rgba(15, 23, 42, 0.98); backdrop-filter: blur(20px); border-right: 1px solid rgba(255, 255, 255, 0.1); }
    .glass-module.active { left: 0; }
    .glass-resizer { display: none; }
    .monitor-header { padding: 0 15px; height: 50px; }
    .view-panel { padding: 15px 10px; }
    .chat-input-box { padding: 15px 15px 40px 15px; }
    
    /* Адаптация новой панели Pro */
    .pro-settings-bar { padding: 10px 15px; gap: 8px; justify-content: space-between; }
    .glass-select { width: 100%; }
    .glass-input { width: 100%; }
    .btn-save-key, .btn-buy-key { flex: 1; text-align: center; justify-content: center; }
}
