/* ===========================
   LIGHT THEME (default)
=========================== */
:root {
    --bg-hero: #fafafa;
    --bg-footer: #1a1d22;

    --text-color: #1a1a1a;
    --text-color-light: #666666;
    --text-color-heading: #333333; /* Менее черный для заголовков в светлой теме */

    --button-bg: #ffffff;
    --button-text: #1a1a1a;
    --button-shadow: rgba(0,0,0,0.12);

    --ad-bg: #f0f0f0;
    --ad-border: #d0d0d0;
    
    /* Pattern colors for light theme */
    --pattern-color-1: #e8e8e8;
    --pattern-color-2: #e0e0e0;
    
    /* Vignette for light theme */
    --vignette-color: rgba(0,0,0,0.08);
    
    /* Footer gradient for light theme */
    --footer-gradient: rgba(0,0,0,0.15);
    
    /* Footer colors for light theme */
    --footer-bg: #f5f5f5;
    --footer-text: #1a1a1a;
    --footer-text-light: #666666;
}

/* ===========================
   DARK THEME (auto)
=========================== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-hero: #2d2d2d;
        --bg-footer: #131518;

        --text-color: #f5f5f5;
        --text-color-light: #bbbbbb;

        --button-bg: #333333;
        --button-text: #ffffff;
        --button-shadow: rgba(255,255,255,0.08);

        --ad-bg: #333;
        --ad-border: #777;
        
        /* Pattern colors for dark theme */
        --pattern-color-1: #3a3a3a;
        --pattern-color-2: #373737;
        
        /* Vignette for dark theme */
        --vignette-color: rgba(0,0,0,0.25);
        
        /* Footer gradient for dark theme */
        --footer-gradient: rgba(0,0,0,0.35);
        
        /* Footer colors for dark theme */
        --footer-bg: #202020;
        --footer-text: #f5f5f5;
        --footer-text-light: #bbbbbb;
    }
}

/* ===========================
   GLOBAL BASE
=========================== */

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background: var(--bg-hero);
    color: var(--text-color);
    font-family: sans-serif;
}

/* ===========================
   LANGUAGE SWITCHER
=========================== */

.language-switcher {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    gap: 5px;
    background: var(--button-bg);
    padding: 4px;
    border-radius: 6px;
    box-shadow: 0px 2px 5px var(--button-shadow);
}

.lang-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: sans-serif;
}

.lang-btn:hover {
    background: var(--button-bg);
    color: var(--text-color);
}

.lang-btn.active {
    background: var(--text-color);
    color: var(--button-bg);
}

@media (prefers-color-scheme: light) {
    .lang-btn.active {
        background: #4d4d4d; /* На 25% светлее для светлой темы */
        color: #ffffff;
    }
}

@media (prefers-color-scheme: dark) {
    .lang-btn.active {
        background: var(--text-color);
        color: var(--bg-hero);
    }
}

/* ВИНЬЕТКА */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;

    background: radial-gradient(
        circle at center,
        rgba(0,0,0,0) 55%,
        rgba(0,0,0,0.25) 100%
    );
}

.layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-wrapper {
    display: flex;
    flex: 1;
    padding: 98px 40px 40px 40px;
    align-items: flex-start;
    gap: 40px;
    position: relative;
}



.recbin-container {
    position: fixed;
    left: calc(50vw - 50px - 32px); 
    top: calc(50vh + 100px - 32px); 
    z-index: 100;
}

.recbin-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
}



.left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 90px;
    position: relative;
}

.logo {
    width: 150px;
    margin-bottom: 20px;
    margin-top: 0;
}

.title {
    font-size: 40px;
    margin: 10px 0 0 0;
    color: var(--text-color);
}

@media (prefers-color-scheme: light) {
    .title {
        color: #4d4d4d !important; 
    }
}

.subtitle {
    font-size: 16px;
    margin-bottom: 20px;
    margin-top: 0;
    color: var(--text-color-light);
}

.buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}


.btn {
    padding: 10px 20px;
    background: var(--button-bg);
    color: var(--button-text);
    border-radius: 8px;
    text-decoration: none;
    box-shadow: 0px 2px 5px var(--button-shadow);
    transition: all 0.2s ease;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0px 4px 8px var(--button-shadow);
}

@media (prefers-color-scheme: light) {
    .btn:hover {
        background: #f8f8f8;
    }
}

@media (prefers-color-scheme: dark) {
    .btn:hover {
        background: #3a3a3a;
    }
}



.divider {
    width: 1px;
    height: 80%;
    background: rgba(0,0,0,0.12);
}

@media (prefers-color-scheme: dark) {
    .divider {
        background: rgba(255,255,255,0.15);
    }
}



.right-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.content-row {
    position: relative;
}

.text-block {
    white-space: normal;
    margin-top: -40px; 
}

.feature-title {
    font-size: 24px;
    margin: 0 0 5px 0; 
}

@media (prefers-color-scheme: light) {
    .feature-title {
        color: var(--text-color-heading);
    }
}

.feature-text {
    font-size: 15px;
    color: var(--text-color-light);
    margin-bottom: 10px;
    margin-top: 0; 
}

.feature-text h3 {
    font-size: 18px;
    color: var(--text-color);
    margin: 15px 0 10px 0;
    font-weight: 600;
}

.feature-text h4 {
    font-size: 16px;
    color: var(--text-color);
    margin: 12px 0 5px 0;
    font-weight: 600;
}

@media (prefers-color-scheme: light) {
    .feature-text h3,
    .feature-text h4 {
        color: var(--text-color-heading);
    }
}

.feature-text a {
    color: var(--text-color);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.feature-text a:hover {
    opacity: 0.7;
}

.screenshot-container {
    float: right;
    margin-left: 30px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.screenshot-title {
    font-size: 14px;
    color: var(--text-color-light);
    margin-bottom: 8px;
    text-align: center;
    font-weight: 500;
    position: relative;
    display: inline-block;
    padding: 0 10px 4px 10px;
    text-transform: capitalize;
}

.screenshot-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5px;
    right: -5px;
    height: 1px;
    background: var(--text-color-light);
    opacity: 0.3;
}

@media (prefers-color-scheme: dark) {
    .screenshot-title::after {
        opacity: 0.4;
    }
}

.screenshot {
    float: right;
    max-width: 650px;
    width: auto;
    height: auto;
    border-radius: 10px;
    margin-left: 0;
    margin-bottom: 0;
    display: block;
}

.screenshots-divider {
    width: 100%;
    height: 1px;
    background: rgba(0,0,0,0.12);
    margin: 15px 0;
    clear: both;
}

.screenshot-container-inline {
    float: right;
    margin-left: 20px;
    margin-bottom: 15px;
    margin-top: 10px;
    text-align: center;
}

.screenshot-inline {
    max-width: 400px;
    width: auto;
    height: auto;
    border-radius: 10px;
    display: block;
}

@media (prefers-color-scheme: dark) {
    .screenshots-divider {
        background: rgba(255,255,255,0.15);
    }
}



.ad-placeholder {
    width: 100%;
    height: 140px;
    background: var(--ad-bg);
    border: 1px dashed var(--ad-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color-light);
    margin-top: 10px;
    border-radius: 8px;
}



.footer-gradient {
    width: 100%;
    height: 100px;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0) 0%,
        var(--footer-gradient) 100%
    );
}



.footer {
    background: var(--footer-bg);
    color: var(--footer-text);

    width: 100%;            
    max-width: 96vw;      
    margin: 0 auto 10px auto;

    padding: 12px 25px;    

    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    .footer {
        box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.3);
    }
}

.footer h3 {
    color: var(--footer-text);
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

@media (prefers-color-scheme: light) {
    .footer h3 {
        color: #333333 !important; 
    }
}

.footer p {
    color: var(--footer-text-light);
    margin: 0;
    line-height: 1.5;
}

.footer-requirements {
    font-size: 14px;
}

.footer > div {
    display: flex;
    flex-direction: column;
}

.footer a {
    color: var(--footer-text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--footer-text);
    text-decoration: underline;
}

.footer-copyright-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.footer-copyright {
    margin: 0;
    font-size: 12px;
    color: var(--footer-text-light);
    text-align: center;
}



body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: sans-serif;

    background:
        radial-gradient(circle at 100% 50%, var(--pattern-color-1) 0% 2%, var(--pattern-color-2) 3% 5%, transparent 6%),
        radial-gradient(circle at 0% 50%,   var(--pattern-color-1) 0% 2%, var(--pattern-color-2) 3% 5%, transparent 6%),
        radial-gradient(ellipse at 50% 0%, var(--pattern-color-1) 0% 3%, transparent 4%) 10px 10px,
        radial-gradient(circle at 50% 50%, var(--pattern-color-1) 0% 1%, var(--pattern-color-2) 2% 3%, var(--pattern-color-1) 4% 5%, transparent 6%) 20px 20px,
        var(--bg-hero);

    background-size:
        50px 50px,
        50px 50px,
        40px 40px,
        60px 60px,
        100% 100%;

    animation: popbgshift 18s linear infinite;
}

@keyframes popbgshift {
    0% {
        background-position:
            0px 0px,
            0px 0px,
            10px 10px,
            20px 20px,
            0px 0px;
    }
    25% {
        background-position:
            12px -8px,
            -15px 18px,
            28px 4px,
            35px 32px,
            0px 0px;
    }
    50% {
        background-position:
            30px 22px,
            -32px -18px,
            46px 30px,
            55px 10px,
            0px 0px;
    }
    75% {
        background-position:
            44px -10px,
            -5px 40px,
            20px 52px,
            70px 36px,
            0px 0px;
    }
    100% {
        background-position:
            50px 50px,
            -50px -50px,
            60px 60px,
            80px 80px,
            0px 0px;
    }
}


body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 999;

    background: radial-gradient(
        circle at center,
        rgba(0,0,0,0) 55%,
        var(--vignette-color) 100%
    );
}



.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

@media (prefers-color-scheme: light) {
    .modal {
        background-color: rgba(0, 0, 0, 0.4);
    }
}

.modal-content {
    background: var(--button-bg);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.25);
    position: relative;
    color: var(--text-color);
}

@media (prefers-color-scheme: light) {
    .modal-content {
        box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.15);
    }
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-color-light);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-ad {
    margin-bottom: 20px;
}

.modal-ad .ad-placeholder {
    margin-top: 0;
    height: 160px;
}

.download-timer {
    text-align: center;
    padding: 20px 0;
    font-size: 18px;
    color: var(--text-color);
}

.download-timer #timer-countdown {
    font-weight: bold;
    font-size: 24px;
    color: var(--button-text);
}

.download-fallback {
    text-align: center;
    padding: 15px 0;
}

.download-link {
    color: var(--button-text);
    text-decoration: underline;
    font-size: 16px;
}

.download-link:hover {
    color: var(--text-color-light);
}



.error-modal {
    display: none;
    position: fixed;
    z-index: 20000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.error-modal-content {
    background: #ffffff;
    border: 1px solid #808080;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    width: 450px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    margin: auto;
    pointer-events: auto;
}

.error-modal-header {
    background: #ece9d8;
    color: #000000;
    padding: 4px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    height: 22px;
    box-sizing: border-box;
    cursor: move;
    user-select: none;
    border-bottom: 1px solid #808080;
}

.error-title {
    flex: 1;
    font-weight: normal;
}

.error-close-btn {
    background: transparent;
    border: none;
    color: #000000;
    font-size: 12px;
    cursor: pointer;
    width: 20px;
    height: 18px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.error-close-btn:hover {
    background: #c42b1c;
    color: white;
}

.error-close-btn:active {
    background: #a02010;
}

.error-modal-body {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    flex: 1;
    min-height: 100px;
    background: #ffffff;
}

.error-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #c42b1c;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
    font-family: Arial, sans-serif;
}

.error-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.error-text-line {
    color: #000000;
    font-size: 12px;
    line-height: 1.4;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.error-modal-footer {
    padding: 8px 10px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #d0d0d0;
    background: #ece9d8;
}

.error-ok-btn {
    background: #ece9d8;
    border: 1px solid #808080;
    padding: 2px 20px;
    font-size: 11px;
    cursor: pointer;
    min-width: 75px;
    height: 23px;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: inset -1px -1px 0px #000000, inset 1px 1px 0px #ffffff;
}

.error-ok-btn:hover {
    background: #d4d0c0;
}

.error-ok-btn:active {
    background: #c4c0b0;
    box-shadow: inset 1px 1px 0px #000000, inset -1px -1px 0px #ffffff;
}

.error-ok-btn:focus {
    outline: 1px dotted #000000;
    outline-offset: -4px;
}



.library-window {
    position: fixed;
    top: 100px;
    left: 100px;
    z-index: 10000;
    user-select: none;
}

.library-window-border {
    width: 492px;
    height: 450px;
    background: #1E1E1E;
    border: 1px solid #3E3E42;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.library-title-bar {
    height: 24px;
    background: #2A2A2A;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.library-title-text {
    color: #CCCCCC;
    font-size: 12px;
    margin-left: 12px;
    flex: 1;
}

.library-title-buttons {
    display: flex;
    flex-direction: row;
    cursor: default;
}

.library-title-btn {
    width: 36px;
    height: 24px;
    background: transparent;
    border: none;
    color: #CCCCCC;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.library-title-btn:hover {
    background: #3A3A3A;
    color: white;
}

.library-title-btn:active {
    background: #2A2A2A;
}

.library-close-btn:hover {
    background: #E81123 !important;
    color: white !important;
}

.library-close-btn:active {
    background: #C50E1F !important;
}

.library-content {
    flex: 1;
    background: #1E1E1E;
    padding: 12px;
    overflow-y: auto;
    overflow-x: hidden;
}

.library-icons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.library-icon-item {
    width: 100px;
    height: 100px;
    margin: 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.library-icon-item:hover {
    background: #2A2A2A;
    border-color: #3A3A3A;
}

.library-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    position: absolute;
    transition: opacity 0.2s ease;
}

.library-icon-default {
    opacity: 1;
}

.library-icon-hover {
    opacity: 0;
}

.library-icon-item:hover .library-icon-default {
    opacity: 0;
}

.library-icon-item:hover .library-icon-hover {
    opacity: 1;
}


.library-window.collapsed .library-content {
    display: none;
}

.library-window.collapsed .library-window-border {
    height: 24px;
}


.library-window.hidden {
    display: none;
}


@media (prefers-color-scheme: light) {
    .library-window-border {
        background: #f5f5f5;
        border-color: #d0d0d0;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
    
    .library-title-bar {
        background: #e8e8e8;
    }
    
    .library-title-text {
        color: #1a1a1a;
    }
    
    .library-title-btn {
        color: #666666;
    }
    
    .library-title-btn:hover {
        background: #d0d0d0;
        color: #1a1a1a;
    }
    
    .library-content {
        background: #f5f5f5;
    }
    
    .library-icon-item:hover {
        background: #e8e8e8;
        border-color: #d0d0d0;
    }
}