/* VIAMPEX.zip/VIAMPEX/styles/main.css */

/* --- ПЕРЕМЕННЫЕ ПО УМОЛЧАНИЮ (СВЕТОВАЯ ТЕМА) --- */
:root {
    --bg: #f7f9fc; 
    --card: #fff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #1d4ed8; 
    --border: #e5e7eb;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03); 
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, sans-serif;
    --card-style: 0; 
}

/* --- ТЕМЫ --- */
body.theme-dark {
    --bg: #111827;
    --card: #1f2937;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --primary: #60a5fa; 
    --border: #374151;
}

body.theme-blue-sky {
    --bg: #f3faff;
    --card: #ffffff;
    --text: #0b172a;
    --muted: #4e5d78;
    --primary: #007bff;
    --border: #c3d9f0;
}

body.theme-forest {
    --bg: #1a1a1a;
    --card: #2c2c2c;
    --text: #e0f2f1;
    --muted: #94a3b8;
    --primary: #4ade80;
    --border: #404040;
}

body.theme-sepia {
    --bg: #fbf0e6;
    --card: #fff8f0;
    --text: #5c4033;
    --muted: #9d8174;
    --primary: #7a5230;
    --border: #d4c3b8;
}

body.theme-cyberpunk {
    --bg: #1c0029;
    --card: #33004d;
    --text: #ffebf7;
    --muted: #f8c0e7;
    --primary: #e91e63;
    --border: #4d0066;
    --shadow-md: 0 0 10px rgba(233, 30, 99, 0.5);
}

body.theme-classic-serif {
    --bg: #f9f6f1;
    --card: #fff;
    --text: #333;
    --muted: #666;
    --primary: #8b0000;
    --border: #ddd;
    --font-family: Georgia, 'Times New Roman', Times, serif; 
    --card-style: 1; 
}

body.theme-dev-mono {
    --bg: #000000;
    --card: #111111;
    --text: #00ff00; 
    --muted: #008800;
    --primary: #00ff00;
    --border: #003300;
    --font-family: 'Courier New', Courier, monospace; 
    --card-style: 2; 
}

/* --- БАЗОВЫЕ СТИЛИ --- */
*{box-sizing:border-box}
body{
    font-family:var(--font-family); 
    margin:0;
    background:var(--bg);
    color:var(--text);
    transition: background-color 0.4s, color 0.4s, font-family 0.4s; 
}
h1, h2, h3 { color: var(--text); }

.site-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:16px 24px;
    background:var(--card);
    box-shadow:var(--shadow-md);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo-row{display:flex;align-items:center;gap:12px}
.logo{height:50px;width:auto} 
.subtitle{margin:0;color:var(--muted); font-size: 0.9em;}
.header-actions{display:flex;gap:10px;align-items:center}
.header-actions input{
    padding:10px 14px;
    border-radius:10px;
    border:1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.3s, background-color 0.3s;
}
.header-actions input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--primary)33; 
}

/* --- Стили для переключения тем --- */
.theme-switcher-container {
    position: relative;
}
.theme-picker {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 10;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    margin-top: 5px;
    box-shadow: var(--shadow-md);
    min-width: 180px;
}
.theme-picker button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 8px 10px;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    margin-bottom: 4px;
    font-size: 0.95em;
    transition: background-color 0.2s;
}
.theme-picker button:hover {
    background: var(--bg);
}
.theme-picker button.active {
    background: var(--primary);
    color: white;
}
.hidden {display: none;}
/* --- Конец стилей для переключения тем --- */

/* Улучшенные кнопки */
.btn{
    display:inline-block;
    padding:10px 14px;
    border-radius:10px;
    background:var(--card);
    border:1px solid var(--border);
    text-decoration:none;
    color:var(--text);
    cursor:pointer;
    transition:transform .18s, box-shadow .18s, background-color 0.3s;
}
.btn:hover{
    transform:translateY(-1px);
    box-shadow: var(--shadow-sm);
    background-color: var(--bg);
}

.container{display:flex;gap:24px;padding:24px;max-width:1400px;margin:0 auto;}
.sidebar{width:280px;position:sticky;top:90px;height:calc(100vh - 110px);overflow-y:auto;padding-right:10px;}
.categories{display:flex;flex-direction:column;gap:8px}
.category{
    padding:12px 15px;
    border-radius:10px;
    background:var(--card);
    cursor:pointer;
    border:1px solid var(--border);
    text-align:left;
    font-weight: 500;
    color: var(--text);
    transition: all .2s;
}
.category:hover{
    background:var(--primary);
    color:white;
    border-color:var(--primary);
    box-shadow:var(--shadow-sm);
}
.category.active{
    box-shadow:0 0 0 3px var(--primary)33; 
    border-color: var(--primary);
    background:var(--primary);
    color:white;
}

.content{flex:1}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}

/* --- Стилизация карточек подтем --- */
.card{
    padding:16px;
    border-radius:12px;
    background:var(--card);
    box-shadow:var(--shadow-sm);
    cursor:pointer;
    transition:transform .18s, box-shadow .18s;
    font-weight: 500;
    min-height: 80px;
    display: flex;
    align-items: center;
}
.card:hover{
    transform:translateY(-3px);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--primary);
}

/* СТИЛЬ КАРТОЧЕК 1: Прозрачные карточки (для Classic/Serif темы) */
body[style*="--card-style: 1"] .card {
    background: transparent;
    border: 1px dashed var(--border);
    box-shadow: none;
    border-radius: 0;
    min-height: 40px;
    padding: 10px 16px;
}
body[style*="--card-style: 1"] .card:hover {
    transform: none;
    background: var(--bg);
    border: 1px dashed var(--primary);
    box-shadow: none;
}

/* СТИЛЬ КАРТОЧЕК 2: Стиль Терминала (для Dev/Mono темы) */
body[style*="--card-style: 2"] .card {
    background: var(--card);
    border: 1px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
    border-radius: 4px;
    font-size: 0.9em;
}
body[style*="--card-style: 2"] .card:hover {
    transform: none;
    box-shadow: 0 0 5px var(--primary);
    background: #000000;
}
/* ------------------------------------------------ */


.instruction{
    margin-top:20px;
    padding:25px;
    border-radius:12px;
    background:var(--card);
    box-shadow:var(--shadow-md);
    border: 1px solid var(--border);
}

/* --- ИСПРАВЛЕНИЕ: ВОЗВРАЩАЕМ АВТОМАТИЧЕСКУЮ ЛИНИЮ ПОД H3 --- */
.instruction h3 {
    border-bottom: 2px solid var(--border); /* <-- ВОЗВРАЩЕНО */
    padding-bottom: 10px;
    margin-top: 0;
}
/* --------------------------------------------------------- */


/* Стили для пользовательской линии HR, если она добавлена в Quill */
#instText hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}


.inst-images img{max-width:120px;margin-right:8px;border-radius:6px;border: 1px solid var(--border);}
#instText p,
#instText ul,
#instText ol,
#instText h1,
#instText h2,
#instText h3 {
    margin-top: 6px;
    margin-bottom: 6px;
    line-height: 1.5;
}

#instText li {
    margin-bottom: 4px; 
    padding-left: 5px;
}

.site-footer{text-align:center;padding:16px;color:var(--muted);font-size:0.9em;margin-top:20px;}

@media(max-width:900px){
    .container{flex-direction:column;padding:15px;}
    .sidebar{width:100%;position:static;height:auto;padding-right:0;}
}
@media(max-width:600px){
    .site-header{flex-direction:column;gap:10px;}
    .header-actions{width:100%;justify-content:space-between;}
    .header-actions input{flex:1;}
}