/* PERFORMANCE FIX: Force visible by default — no blank screen waiting for JS */
.reveal-on-scroll {
    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 */
.js-active .reveal-on-scroll.pending {
    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.ml,
a.ml: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.ml:hover {
    color: #2980b9;
    border-left-color: #2980b9;
    background-color: #dfe6e9;
    transform: translateX(4px);
}

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

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

.mi:hover {
    background-color: transparent;
}

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

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

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

.header .header-text img {
    width: 84px;
    height: 84px;
    display: inline-block !important;
}

.header {
    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;
}


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

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

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

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

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

.footer a:hover {
    color: #3498db;
}

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

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

.hide { display: none; }
.show { display: block; }
.ubtop { margin-top: 16px; }

a.ubtext,
a.ubtext:visited,
a.ubtext:hover {
    color: #34495e;
}

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

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

.leftcol, .rightcol {
    display: none;
}

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

/* Cookie banner (оставим как есть, но чуть улучшим) */
.cc_container {
    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;
}

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

.cc_container .cc_btn:hover {
    background-color: #ff8f00;
}

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

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

.header .header-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

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

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

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

/* Floating Download button — fixed bottom-right, stays visible while scrolling */
.floating-download {
    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;
}
.floating-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
    color: #fff !important;
    text-decoration: none !important;
}
.floating-download:visited {
    color: #fff !important;
}

/* Features section — small thumbnails */
.features-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.feature-thumb {
    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;
}
.feature-thumb:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: scale(1.03);
}
.feature-thumb img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

/* Lightbox — full-screen overlay, slide left/right */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.lightbox[hidden] {
    display: none !important;
}
.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}
.lightbox-caption {
    margin: 12px 0 0;
    color: #ecf0f1;
    font-size: 14px;
    text-align: center;
}
.lightbox-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;
}
.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}
.lightbox-prev,
.lightbox-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;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Download page — theme preview thumbnails (same style as feature thumbnails) */
.theme-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.theme-thumb {
    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;
}
.theme-thumb:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: scale(1.03);
}
.theme-thumb img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    vertical-align: middle;
}

/* Other Products page — CrystalDiskMark / CrystalMark Retro screenshot thumbnails */
.product-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.product-thumb {
    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;
}
.product-thumb:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: scale(1.03);
}
.product-thumb 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) */
.screenshot-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 20px 0 24px;
    justify-content: center;
}
.screenshot-thumb {
    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;
}
.screenshot-thumb:hover {
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transform: scale(1.03);
}
.screenshot-thumb 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"] .menubar a {
    letter-spacing: 0.1em;
}

/* Russian: Increase button padding */
html[lang="ru"] .cc_btn,
html[lang="ru"] .floating-download,
html[lang="ru"] .ml,
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"] .menubar {
    border-right: none;
    border-left: 1px solid #eee;
}
html[lang="ar"] a.ml {
    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.ml:hover {
    border-right-color: #2980b9;
    transform: translateX(-4px);
}
html[lang="ar"] .floating-download {
    right: auto;
    left: 24px;
}
html[lang="ar"] .header-text {
    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. */