/* --- ГЛОБАЛЬНЫЙ ШРИФТ --- */
body {
    margin: 0;
    padding: 0;
    background-color: #fff;
    font-family: 'Inter', sans-serif;
}

.desktop {
  	width: 100%;
  	position: relative;
  	background-color: #fff;
  	display: flex;
  	flex-direction: column;
  	align-items: flex-start;
  	text-align: left;
  	font-size: 11px;
  	color: #66717f;
}

/* --- ЗАКРЕПЛЕННАЯ ШАПКА --- */
.div {
  	position: sticky;
  	top: 0;
  	z-index: 1000;
  	width: 100%;
  	height: 72px;
  	border-bottom: 1px solid #e1e5e9;
  	box-sizing: border-box;
  	display: flex;
  	align-items: center;
  	justify-content: space-between;
  	padding: 0px 160px;
  	gap: 20px;
  	font-size: 18px;
  	color: #171b21;
  	background-color: #fff;
  	transition: background-color 0.3s ease, border-color 0.3s ease;
}

.div2 { overflow: hidden; display: flex; align-items: center; gap: 40px; }
.div3 { overflow: hidden; display: flex; align-items: center; gap: 10px; }
.div4 {
  	height: 36px; width: 36px; border-radius: 12px; background-color: #f0f2f4;
  	display: flex; align-items: center; justify-content: center;
}
.icon { height: 20px; width: 20px; }
.div5 { position: relative; font-weight: 600; }
.div6 { display: flex; align-items: center; gap: 28px; font-size: 14px; color: #596370; }
.div7 { position: relative; }
.div10 { display: flex; align-items: center; gap: 20px; font-size: 13px; color: #66717f; }
.div12 { height: 6px; width: 6px; border-radius: 50%; background-color: #258456; }

/* --- КНОПКА-ТУМБЛЕР ТЕМЫ --- */
.theme-switch {
    display: flex;
    align-items: center;
    background-color: #f0f3f8;
    border: 1px solid #e1e5e9;
    border-radius: 20px;
    padding: 4px;
    cursor: pointer;
    position: relative;
    width: 64px;
    height: 32px;
    justify-content: space-between;
    box-sizing: border-box;
}
.theme-switch-icon {
    font-size: 14px;
    z-index: 2;
    width: 28px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.theme-switch-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 28px;
    height: 24px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    z-index: 1;
}
body.dark-theme .theme-switch-slider {
    transform: translateX(30px);
    background-color: #2c333d;
}

.hero {
  	align-self: stretch; background-color: #f7f8fa; overflow: hidden;
  	display: flex; flex-direction: column; align-items: center;
  	padding: 100px 160px 50px; position: relative; isolation: isolate;
  	font-size: 12px; color: #171b21;
}
.div15 {
  	width: 1440px; height: 600px; position: absolute; top: 0; left: 0;
  	background: radial-gradient(50% 50% at 50% 50%, rgba(198, 243, 107, 0.13), rgba(255, 255, 255, 0));
  	z-index: 0;
}
.div16 {
  	width: 400px; height: 400px; position: absolute; top: -100px; left: 520px;
  	background: radial-gradient(50% 50% at 50% 50%, rgba(198, 243, 107, 0.16), rgba(198, 243, 107, 0));
  	z-index: 1;
}
.div17 {
  	border-radius: 20px; background-color: #f0f2f4; border: 1px solid #e1e5e9;
  	display: flex; align-items: center; padding: 6px 14px; gap: 8px;
  	z-index: 2; color: #596370;
}
.div18 { height: 6px; width: 6px; border-radius: 50%; background-color: #507718; }
.div19 { position: relative; font-weight: 500; }
.hero2 {
  	align-self: stretch; display: flex; flex-direction: column; align-items: center;
  	padding: 28px 0px 0px; gap: 24px; z-index: 3; text-align: center; font-size: 80px;
}
.b { align-self: stretch; position: relative; line-height: 105%; }
.div20 { width: 560px; font-size: 18px; line-height: 170%; color: #66717f; }
.hero3 { display: flex; align-items: center; padding: 36px 0px 0px; gap: 12px; z-index: 4; font-size: 15px; color: #18210c; }
.div21 {
  	box-shadow: 0px 8px 24px rgba(155, 206, 66, 0.19); border-radius: 14px;
  	background-color: #c6f36b; display: flex; align-items: center; padding: 16px 32px; gap: 10px;
  	cursor: pointer;
}
.div23 {
  	border-radius: 14px; border: 1px solid #e1e5e9; display: flex;
  	align-items: center; padding: 16px 28px; color: #596370; cursor: pointer;
    gap: 10px; 
}
.div25 { display: flex; align-items: center; padding: 60px 0px 0px; gap: 48px; z-index: 5; font-size: 28px; }
.div26, .div29 { display: flex; align-items: center; gap: 48px; }
.div27 { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.div28 { font-size: 12px; color: #66717f; }
.div30 { height: 32px; width: 1px; background-color: #e1e5e9; }

.div41 { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; padding: 80px 160px; gap: 24px; scroll-margin-top: 80px; }
.div42 { align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.workspace-card {
  	width: 100%; max-width: 900px; min-height: 400px; margin: 0 auto;
  	box-shadow: 0px 8px 32px rgba(0, 0, 0, 0.1); border-radius: 16px;
  	background-color: #fff; border: 1px solid #e1e5e9;
  	display: flex; flex-direction: column; align-items: flex-start; padding: 28px;
}

/* Обертки для состояний */
.upload-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.result-wrapper {
    width: 100%;
    display: none; /* Скрыто по умолчанию */
    flex-direction: column;
    gap: 20px;
    text-align: center;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.empty-state {
  	align-self: stretch; flex-grow: 1; border-radius: 16px;
  	background-color: #f9fafc; border: 1px dashed #c9d0d8;
  	display: flex; flex-direction: column; align-items: center; justify-content: center;
  	padding: 32px; gap: 20px; text-align: center; font-size: 14px;
  	cursor: pointer;
  	width: 100%;
  	box-sizing: border-box;
}
.empty-icon {
  	width: 56px; height: 56px; border-radius: 16px; background-color: #eff8df;
  	display: flex; align-items: center; justify-content: center;
}
.icon3 { height: 30px; width: 30px; }
.empty-copy { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.div61 { font-weight: 600; }
.div62 { font-size: 11px; color: #6b7280; }

.result-header { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.empty-badge {
  	border-radius: 8px; background-color: #f5f7fa; border: 1px solid #e4e7ed;
  	display: flex; align-items: flex-start; padding: 4px 8px; font-size: 11px; color: #6b7280;
}

.div55 { width: 100%; display: flex; align-items: flex-start; gap: 12px; }
.compress-btn {
  	height: 52px; flex: 1; max-width: 50%; margin: 0 auto;
  	box-shadow: 0px 6px 16px rgba(89, 173, 31, 0.2); border-radius: 14px;
  	background-color: #c6f36b; display: flex; align-items: center; justify-content: center;
  	gap: 10px; color: #000; cursor: pointer;
  	font-size: 15px;
}
.compress-btn b, .compress-btn .div5 {
    font-size: 15px !important;
    font-weight: 600;
}
.folder-open-icon { height: 18px; width: 18px; }
.reset-btn {
    margin-top: 10px; background: none; border: none; 
    color: #66717f; cursor: pointer; font-size: 14px; text-decoration: underline;
}

.div96 {
  	align-self: stretch; border-top: 1px solid #e1e5e9; display: flex;
  	align-items: center; justify-content: space-between; padding: 32px 160px; gap: 20px; font-size: 14px;
}
.div97 { display: flex; align-items: center; gap: 24px; }
.div99 {
  	height: 28px; width: 28px; border-radius: 10px; background-color: #f0f2f4;
  	display: flex; align-items: center; justify-content: center;
}
.div101 { font-size: 13px; }
.div102 { display: flex; align-items: center; gap: 20px; font-size: 13px; color: #596370; }
.github { display: flex; align-items: center; gap: 7px; }
.gitverse-icon { height: 16px; width: 16px; }

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); display: none; align-items: center; justify-content: center;
    z-index: 2000; backdrop-filter: blur(4px);
}
.modal-content {
    background-color: #fff; padding: 40px; border-radius: 20px;
    max-width: 600px; width: 90%; position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); border: 1px solid #e1e5e9;
    display: flex; flex-direction: column;
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    color: #66717f;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10; /* Добавили, чтобы кнопка была поверх всего окна */
    padding: 10px; /* Увеличили зону клика, чтобы по ней было легче попасть пальцем */
    line-height: 1;
}
.modal-close:hover { color: #000; }

/* ===== ТЕМНАЯ ТЕМА ===== */
body.dark-theme { background-color: #0d0f12; }
body.dark-theme .desktop, body.dark-theme .div41 { background-color: #0d0f12; color: #a0aab5; }
body.dark-theme .div { background-color: #0d0f12; border-bottom-color: #2c333d; }
body.dark-theme .hero { background-color: #13161b; }
body.dark-theme .b, body.dark-theme .div5, body.dark-theme .div7, body.dark-theme .div19,
body.dark-theme .div61, body.dark-theme .div53, body.dark-theme .div101, body.dark-theme #result-state .div5 { color: #ffffff !important; }
body.dark-theme .div20, body.dark-theme .div28, body.dark-theme .div54, body.dark-theme .div62,
body.dark-theme .div6, body.dark-theme .div102, body.dark-theme .div49 { color: #8b949e !important; }
body.dark-theme .workspace-card, body.dark-theme .div46 { background-color: #161a20; border-color: #2c333d; }
body.dark-theme .empty-state, body.dark-theme .div50 { background-color: #1c2128; border-color: #3e4652; }
body.dark-theme .extract-btn, body.dark-theme .div23, body.dark-theme .empty-badge,
body.dark-theme .div17, body.dark-theme .theme-switch { background-color: #1c2128; border-color: #3e4652; color: #a0aab5; }
body.dark-theme .div96 { background-color: #0d0f12; border-top-color: #2c333d; }
body.dark-theme .div99 { background-color: #1c2128; }
body.dark-theme .gitverse-icon, body.dark-theme .icon, body.dark-theme .icon3,
body.dark-theme .folder-open-icon, body.dark-theme .file-archive-icon { filter: invert(1) brightness(2); }
body.dark-theme .compress-btn, body.dark-theme .compress-btn *, body.dark-theme .div21, body.dark-theme .div21 * { color: #000000 !important; }
body.dark-theme .modal-content { background-color: #161a20; border-color: #2c333d; }
body.dark-theme .modal-close { color: #8b949e; }
body.dark-theme .modal-close:hover { color: #ffffff; }

/* ===== АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ ===== */
@media (max-width: 768px) {
    /* Шапка */
    .div { 
        padding: 0 15px; 
        height: 60px; 
        justify-content: space-between;
    }
    .div6 { display: none; }
    .div3 { gap: 8px; }
    .div5 { font-size: 16px; }
    .div4 { height: 32px; width: 32px; }
    .icon { height: 18px; width: 18px; }
    .div10 { gap: 8px; }

    /* Главный экран */
    .hero { padding: 50px 15px 30px; }
    .hero2 { font-size: 40px; gap: 15px; }
    .div20 { width: 100%; font-size: 15px; }
    
    .hero3 { 
        flex-direction: column; 
        width: 100%; 
        padding-top: 25px; 
        gap: 10px;
    }
    .div21, .div23 { 
        width: 100%; 
        justify-content: center; 
        box-sizing: border-box; 
        padding: 14px 20px; 
    }

    /* Статистика */
    .div25 { flex-direction: column; gap: 15px; padding-top: 30px; font-size: 22px; }
    .div29 { gap: 15px; }
    .div30 { display: none; }

    /* Рабочее пространство */
    .div41 { padding: 30px 15px; }
    .div42 { 
        flex-direction: column; 
        align-items: center;
        text-align: center; 
        gap: 5px; 
    }
    .div19 { font-size: 12px; }
    
    .workspace-card { 
        padding: 20px; 
    }
    
    /* Центрирование кнопок и зоны загрузки */
    .div55 { 
        flex-direction: column; 
        align-items: center; 
        gap: 10px; 
        width: 100%;
    }
    .compress-btn {
        width: 100%; 
        max-width: 100%;
        height: 50px; 
        flex: none; 
        font-size: 14px;
        padding: 0 10px;
    }
    
    .empty-state { 
        padding: 24px 15px; 
        min-height: auto; 
        width: 100%;
        box-sizing: border-box;
    }
    .div61 { font-size: 14px; }
    .div62 { font-size: 11px; }
    .icon3 { height: 40px; width: 40px; }
    .empty-icon { width: 48px; height: 48px; }

    /* Подвал */
    .div96 { 
        flex-direction: column; 
        padding: 20px; 
        gap: 15px; 
        text-align: center; 
    }
    .div97 { flex-direction: column; gap: 10px; align-items: center; }
    .div102 { flex-direction: column; gap: 10px; align-items: center; }

    .modal-content { padding: 20px; width: 95%; }
}
/* ===== УЛУЧШЕННАЯ АДАПТАЦИЯ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 768px) {
    /* 1. Убираем горизонтальный скролл (если что-то вылезает) */
    body, html {
        overflow-x: hidden;
        width: 100%;
    }

    /* 2. Шапка сайта (логотип и переключатель темы) */
    .div {
        padding: 0 15px;
        height: 64px;
    }
    .div2 { gap: 15px; }
    
    /* 3. Главный экран (Hero) */
    .hero {
        padding: 60px 15px 40px;
    }
    .div17 {
        padding: 6px 10px;
        font-size: 10px;
    }
    .b {
        font-size: 36px !important; /* Чуть уменьшаем заголовок, чтобы влезал */
        line-height: 1.2;
    }
    .div20 {
        font-size: 14px;
        padding: 0 10px;
    }

    /* 4. Кнопки на главном экране */
    .hero3 {
        width: 100%;
        flex-direction: column;
        padding-top: 20px;
    }
    .div21, .div23 {
        width: 100%;
        justify-content: center;
        box-sizing: border-box;
        padding: 14px 15px;
        font-size: 14px;
    }

    /* 5. Блок статистики (4x, 100 МБ, 0%) */
    .div25 {
        flex-direction: row; /* Оставляем в линию, если влезет */
        flex-wrap: wrap;     /* Если не влезет — переносим */
        justify-content: center;
        gap: 15px;
        padding-top: 30px;
    }
    .div29 {
        gap: 10px;
    }
    .div30 {
        display: none; /* Убираем вертикальные разделители */
    }
    .div27 b {
        font-size: 20px;
    }
    .div28 {
        font-size: 11px;
    }

    /* 6. Рабочее пространство (Карточка) */
    .div41 {
        padding: 40px 15px;
    }
    .workspace-card {
        padding: 15px;
        min-height: 350px;
    }
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* 7. Зона загрузки файла */
    .empty-state {
        padding: 25px 15px;
        gap: 15px;
    }
    .div61 {
        font-size: 14px;
    }
    .div62 {
        font-size: 11px;
        line-height: 1.4;
    }

    /* 8. Кнопка "Скачать архив" на экране результата */
    #result-state .compress-btn {
        width: 100% !important;
        max-width: 100%;
        margin: 10px 0;
    }
    #result-state .div5 {
        font-size: 18px !important;
    }
    #file-size-info {
        font-size: 13px !important;
    }

    /* 9. Подвал сайта */
    .div96 {
        padding: 20px 15px;
        flex-direction: column;
        text-align: center;
    }
    .div97, .div102 {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    .div101 {
        font-size: 12px;
    }
}

/* Для очень узких экранов (iPhone SE, старые Android) */
@media (max-width: 375px) {
    .b {
        font-size: 28px !important;
    }
    .div25 {
        flex-direction: column;
        align-items: center;
    }
    .div29 {
        justify-content: center;
    }
}
/* Фикс для узких экранов, чтобы карточка не вылезала */
@media (max-width: 768px) {
    .workspace-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 15px !important;
    }
    
    .result-header {
        flex-wrap: wrap; /* Позволяет бейджу "Лимит 100 МБ" переноситься на новую строку, если не влезает */
        align-items: flex-start;
    }
    
    .empty-badge {
        margin-left: 0;
        margin-top: 5px;
    }
}
/* ===== ФИНАЛЬНЫЙ ФИКС КАРТОЧКИ И КНОПОК ===== */
@media (max-width: 768px) {
    .workspace-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 15px !important;
    }
    
    .result-header {
        flex-direction: row !important; 
        justify-content: space-between !important; 
        align-items: center !important; 
        gap: 10px;
        width: 100%;
    }
    
    .empty-badge {
        padding: 4px 6px !important;
        font-size: 10px !important;
        flex-shrink: 0; 
    }
    
    .result-header b.div7 {
        font-size: 14px; 
    }

    .div55 {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .compress-btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 12px 15px !important; 
    }
}
/* ===== ФИНАЛЬНЫЙ ФИКС ДЛЯ МОБИЛОК ===== */
@media (max-width: 768px) {
    .workspace-card {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 15px !important;
    }
    
    .result-header {
        flex-direction: row !important; 
        justify-content: space-between !important; 
        align-items: center !important; 
        gap: 10px;
        width: 100%;
    }
    
    .empty-badge {
        padding: 4px 6px !important;
        font-size: 10px !important;
        flex-shrink: 0; 
    }
    
    .result-header b.div7 {
        font-size: 14px; 
    }

    .div55 {
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .compress-btn {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 12px 15px !important; 
    }
}