/* PERFORMANCE FIX: Force visible by default — no blank screen waiting for JS */
.reveal-block {
    opacity: 1 !important; /* Force visible immediately */
    transform: none !important; /* Remove shift */
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
/* Optional: Only hide if JS is active and ready */
.script-ready .reveal-block.wait-reveal {
    opacity: 0 !important;
    transform: translateY(30px) !important;
}

/* Сброс и базовые настройки */
html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    color: #34495e;
    line-height: 1.6;
}

/* Заголовки — современный стиль */
h1 {
    font-size: 24px;
    color: #2c3e50;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
}

h2 {
    font-size: 20px;
    color: #3498db;
    font-weight: bold;
    margin-top: 25px;
    margin-bottom: 12px;
}

h3 {
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}

h4 {
    font-size: 16px;
    color: #e74c3c;
    font-weight: bold;
    margin: 15px 0 10px;
}

h5 {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: bold;
    margin: 5px 0 12px;
}

/* Текст и списки */
p {
    font-size: 16px;
    color: #34495e;
    margin: 0 0 16px;
    line-height: 1.6;
}

li {
    margin-bottom: 6px;
    line-height: 1.6;
}

/* Ссылки */
a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #2980b9;
    text-decoration: underline;
}

a:visited {
    color: #3498db;
}

a.underline,
a.underline:visited {
    text-decoration: underline;
}

/* Специфичные ссылки меню */
a.menu-anchor,
a.menu-anchor:visited {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    padding: 8px 12px 8px 16px;
    border-left: 3px solid #3498db;
    margin: 4px 0;
    background-color: #ecf0f1;
    border-radius: 0 4px 4px 0;
    transition: all 0.2s;
    text-decoration: none;
}

a.menu-anchor:hover {
    color: #2980b9;
    border-left-color: #2980b9;
    background-color: #dfe6e9;
    transform: translateX(4px);
}

/* Заголовки меню */
.menu-label {
    font-size: 14px;
    color: #fff;
    background-color: #2c3e50;
    font-weight: bold;
    padding: 8px 12px;
    margin: 10px 0 6px;
    border: none;
    border-radius: 4px;
}

/* Элементы меню */
.menu-item {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.menu-item:hover {
    background-color: transparent;
}

/* Блоки макета */
.panel-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.brand-mark {
    background-color: #2c3e50;
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

.brand-mark img {
    border-radius: 8px;
    width: 84px;
    height: 84px;
}

.masthead .hero-copy img {
    width: 84px;
    height: 84px;
    display: inline-block !important;
}

.masthead {
    background-color: #2c3e50;
    color: white;
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 0.5px;
}


.side-menu {
    padding: 20px 0;
    background-color: #f8f9fa;
    border-right: 1px solid #eee;
    width: 186px;
}

.article-area {
    background-color: #ffffff;
    padding: 24px;
    border-bottom: none;
    font-size: 16px;
}

.article-area table {
    margin-bottom: 20px;
    width: 100%;
}

/* Футер */
.site-base {
    padding: 14px;
    font-size: 13px;
    color: #7f8c8d;
    background-color: #2c3e50;
    text-align: center;
    border-top: 1px solid #34495e;
}

.site-base a {
    color: #ecf0f1;
    text-decoration: underline;
    font-size: 13px;
}

.site-base a:hover {
    color: #3498db;
}

/* Утилиты */
.highlight-copy {
    font-size: 18px;
    color: #3498db;
    font-weight: bold;
}

.note-panel {
    background-color: #ecf0f1;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}

.is-hidden { display: none; }
.is-visible { display: block; }
.spacer-top { margin-top: 16px; }

a.muted-link,
a.muted-link:visited,
a.muted-link:hover {
    color: #34495e;
}

/* Макет */
.layout-frame {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.content-rail {
    flex: 1;
    min-width: 300px;
    display: block;
    float: none;
    margin: 0;
}

.left-rail, .right-rail {
    display: none;
}

@media screen and (min-width: 1400px) {
    .left-rail {
        display: block;
        width: 180px;
        padding: 10px;
    }
    .right-rail {
        display: block;
        width: 180px;
        padding: 10px;
        position: sticky;
        top: 20px;
        align-self: flex-start;
    }
}

/* Cookie banner (оставим как есть, но чуть улучшим) */
.notice-bar {
    background: #fff8e1;
    color: #5d4037;
    border: 1px solid #ffcc80;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    font-family: 'Segoe UI', sans-serif;
    font-size: 14px;
    padding: 12px 16px;
    z-index: 9001;
}

.notice-bar .notice-ok {
    background-color: #ffb300;
    color: #000;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.notice-bar .notice-ok:hover {
    background-color: #ff8f00;
}

.notice-bar a {
    color: #1a237e;
    font-weight: bold;
}

/* Анимация баннера */
@keyframes slideUp {
    from { transform: translateY(40px); }
    to { transform: translateY(0); }
}
.notice-bar {
    animation: slideUp 0.6s ease-out;
}
.masthead {
    background-color: #2c3e50; /* Темно-синий фон */
    padding: 20px 0;
    text-align: center;
    border-bottom: 3px solid #3498db; /* Голубая линия снизу */
}

.masthead .hero-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.masthead h1 {
    margin: 0;
    font-size: 28px;
    color: white;
    font-weight: bold;
    letter-spacing: 1px;
}

.masthead hr {
    border: 0;
    border-top: 1px solid #3498db;
    width: 80%;
    margin: 10px auto;
}

.masthead p {
    margin: 0;
    font-size: 16px;
    color: #ecf0f1;
    font-style: italic;
}

/* Floating Download button — fixed bottom-right, stays visible while scrolling */
.get-copy-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff !important;
    font-weight: bold;
    font-size: 15px;
    text-decoration: none !important;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(52, 152, 219, 0.45);
    transition: transform 0.2s, box-shadow 0.2s;
}
.get-copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
    color: #fff !important;
    text-decoration: none !important;
}
.get-copy-btn:visited {
    color: #fff !important;
}

/* Features section — small thumbnails */
.perk-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.perk-tile {
    padding: 0;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.perk-tile:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: scale(1.03);
}
.perk-tile img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

/* Lightbox — full-screen overlay, slide left/right */
.viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.viewer-overlay[hidden] {
    display: none !important;
}
.viewer-stage {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.viewer-stage img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}
.viewer-caption {
    margin: 12px 0 0;
    color: #ecf0f1;
    font-size: 14px;
    text-align: center;
}
.viewer-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}
.viewer-close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.viewer-prev,
.viewer-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}
.viewer-prev { left: 20px; }
.viewer-next { right: 20px; }
.viewer-prev:hover,
.viewer-next:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Download page — theme preview thumbnails (same style as feature thumbnails) */
.skin-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.skin-tile {
    padding: 0;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.skin-tile:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: scale(1.03);
}
.skin-tile img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

.catalog-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.catalog-tile {
    padding: 0;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.catalog-tile:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: scale(1.03);
}
.catalog-tile img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

/* Home page — Screenshot for the software (small icons, click to enlarge, scroll left/right) */
.shot-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.shot-tile {
    padding: 0;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.shot-tile:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: scale(1.03);
}
.shot-tile img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

/* Language Specific Overrides */

/* Chinese: Adjust letter spacing */
html[lang="zh-CN"] body {
    letter-spacing: 0.05em;
}
html[lang="zh-CN"] .side-menu a {
    letter-spacing: 0.1em;
}

/* Russian: Increase button padding */
html[lang="ru"] .notice-ok,
html[lang="ru"] .get-copy-btn,
html[lang="ru"] .menu-anchor,
html[lang="ru"] button,
html[lang="ru"] .btn {
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

/* Arabic: RTL Support */
html[lang="ar"] {
    direction: rtl;
    text-align: right;
}
html[lang="ar"] .side-menu {
    border-right: none;
    border-left: 1px solid #eee;
}
html[lang="ar"] a.menu-anchor {
    border-left: none;
    border-right: 3px solid #3498db;
    border-radius: 4px 0 0 4px;
    padding: 8px 16px 8px 12px;
    text-align: right;
}
html[lang="ar"] a.menu-anchor:hover {
    border-right-color: #2980b9;
    transform: translateX(-4px);
}
html[lang="ar"] .get-copy-btn {
    right: auto;
    left: 24px;
}
html[lang="ar"] .hero-copy {
    flex-direction: row-reverse;
}
/* Swap layout for RTL if using flexbox/grid that isn't auto-flipping */
/* Adjust leftcol/rightcol if needed, but flex-direction: row-reverse on outerwrap might be too much if not careful. */
/* Assuming standard flow, RTL handles most. */

.panel-outer {
    width: 100%;
}
.hero-stack {
    display: inline-block;
    vertical-align: middle;
}
.layout-frame > .content-rail {
    flex: 1;
    min-width: 300px;
}
