* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
    overflow-x: hidden;
}

.container {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    background-color: #121212;
}

/* ========== HEADER SECTION ========== */
.header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-top: 8px;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    flex-shrink: 0;
    object-fit: cover;
    box-shadow: 0 0 0 2px #3a3a3a;
}

.header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffffff;
}

.developer-name {
    font-size: 14px;
    color: #b3b3b3;
    margin-bottom: 8px;
}

/* ========== INSTALL BUTTON & ANIMATION ========== */
.button-container {
    position: relative;
    width: 100%;
    margin-bottom: 24px;
    min-height: 60px;
}

.install-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background-color: #1f88ff;
    color: #ffffff;
    text-align: center;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.install-btn:hover { background-color: #1a7ae8; }
.install-btn:active { background-color: #1570d0; }
.install-btn.installed { background-color: #34a853; }
.install-btn.installed:hover { background-color: #2d9348; }

.install-msg {
    display: none;
    background-color: #1e4a2e;
    color: #4ade80;
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #2e7d4e;
    animation: slideDown 0.3s ease-out;
}

/* ========== CONFIRM BLOCK ========== */
.confirm-block {
    display: none;
    gap: 12px;
    animation: slideDown 0.25s ease-out;
}

.confirm-block.visible {
    display: flex;
    flex-direction: column;
}

.checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    background-color: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #282828;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #555555;
    background-color: #2a2a2a;
    margin-top: 1px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-custom::after {
    content: '';
    display: none;
    width: 5px;
    height: 9px;
    border: 2px solid #ffffff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background-color: #1f88ff;
    border-color: #1f88ff;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    display: block;
}

.checkbox-label.error .checkbox-custom {
    border-color: #e53935;
    background-color: #2a1515;
}

.checkbox-label.error .checkbox-text {
    color: #e53935;
}

.checkbox-text {
    font-size: 13px;
    line-height: 1.5;
    color: #b3b3b3;
    transition: color 0.2s ease;
}

/* Кнопка "Продолжить" */
.continue-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background-color: #3a3a3a;
    color: #888888;
    text-align: center;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.continue-btn.active {
    background-color: #34a853;
    color: #ffffff;
}

.continue-btn.active:hover { background-color: #2d9348; }
.continue-btn.active:active { background-color: #267a3e; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.continue-btn.shake {
    animation: shake 0.5s ease;
}

/* ========== LOADING ANIMATION / ПРОГРЕСС-БАР ========== */
.loading-animation {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background-color: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #282828;
}

.loading-text {
    color: #b3b3b3;
    font-size: 14px;
    font-weight: 500;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-track {
    flex: 1;
    height: 6px;
    background-color: #2e2e2e;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background-color: #1f88ff;
    border-radius: 3px;
    transition: width 0.05s linear;
}

.loading-percent {
    font-size: 13px;
    font-weight: 600;
    color: #1f88ff;
    min-width: 36px;
    text-align: right;
}

.finishing-text {
    display: none;
    padding: 16px;
    background-color: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #282828;
    font-size: 14px;
    font-weight: 500;
    color: #b3b3b3;
    text-align: center;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========== RATING SECTION ========== */
.rating-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 12px 0;
    border-top: 1px solid #282828;
    border-bottom: 1px solid #282828;
}

.rating-stars {
    font-size: 18px;
    font-weight: 600;
    color: #ffc107;
}

.rating-count {
    font-size: 14px;
    color: #b3b3b3;
}

/* ========== APP INFO SECTION ========== */
.app-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    padding: 12px 0;
    border-bottom: 1px solid #282828;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.info-label { color: #b3b3b3; }
.info-value { color: #ffffff; font-weight: 500; }

/* ========== SECTION TITLE ========== */
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

/* ========== DESCRIPTION SECTION ========== */
.description-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #282828;
}

.description-text {
    font-size: 14px;
    line-height: 1.6;
    color: #b3b3b3;
}

/* ========== SCREENSHOTS CAROUSEL ========== */
.screenshots-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #282828;
}

.carousel {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.carousel-inner {
    display: flex;
    gap: 12px;
    padding-bottom: 8px;
}

.carousel-item {
    width: 180px;
    height: 270px;
    border-radius: 12px;
    flex-shrink: 0;
    object-fit: cover;
}

.carousel::-webkit-scrollbar { height: 4px; }
.carousel::-webkit-scrollbar-track { background: #282828; border-radius: 2px; }
.carousel::-webkit-scrollbar-thumb { background: #555555; border-radius: 2px; }

/* ========== WHAT'S NEW SECTION ========== */
.whats-new-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #282828;
}

.whats-new-text {
    font-size: 14px;
    line-height: 1.6;
    color: #b3b3b3;
}

/* ========== REVIEWS SECTION ========== */
.reviews-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #282828;
}

.reviews-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.review {
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #282828;
    margin-bottom: 0;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

/* Хедер без аватарки */
.review-header.no-avatar {
    gap: 0;
}

.review-info { flex: 1; }

.review-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.review-date {
    font-size: 12px;
    color: #b3b3b3;
    margin-top: 2px;
}

.review-rating {
    font-size: 14px;
    font-weight: 600;
    color: #ffc107;
}

.review-text {
    font-size: 13px;
    line-height: 1.5;
    color: #b3b3b3;
}

/* ========== ОТВЕТ РАЗРАБОТЧИКА ========== */
.dev-reply {
    background-color: #181818;
    border: 1px solid #282828;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.dev-reply-text {
    font-size: 13px;
    line-height: 1.5;
    color: #b3b3b3;
}

.dev-reply-text strong {
    color: #ffffff;
}

/* Ответы разработчика внутри hidden-reviews — скрыты по умолчанию */
.hidden-reply {
    display: none;
}

/* Когда hidden-reviews раскрыты — показываем ответы */
#hidden-reviews.show + div,
.hidden-reviews.show .hidden-reply {
    display: block;
}

/* Отзывы внутри hidden-reviews */
.review + .dev-reply {
    border-radius: 0 0 8px 8px;
}

/* ========== ОТЗЫВЫ ПОЛЬЗОВАТЕЛЕЙ ========== */
#user-reviews-container {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.user-review {
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #1f88ff33;
    margin-bottom: 16px;
    animation: slideDown 0.3s ease-out;
}

.user-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.user-review-namedate {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-review-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.user-review-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.user-review-rating {
    font-size: 14px;
    font-weight: 600;
    color: #ffc107;
}

.user-review-date {
    font-size: 12px;
    color: #b3b3b3;
}

.user-review-text {
    font-size: 13px;
    line-height: 1.5;
    color: #b3b3b3;
}

/* ========== КНОПКИ ПОД ОТЗЫВАМИ ========== */
.reviews-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

/* Hidden Reviews */
.hidden-reviews {
    display: none;
}

.hidden-reviews.show {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Показываем hidden-reply когда родитель .show */
.hidden-reviews.show .hidden-reply {
    display: block;
}

/* Show More / Leave Review Button */
.show-more-btn {
    width: 100%;
    padding: 12px 16px;
    background-color: #282828;
    color: #ffffff;
    border: 1px solid #404040;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.show-more-btn:hover { background-color: #333333; }
.show-more-btn:active { background-color: #3a3a3a; }

/* ========== ФОРМА ОТЗЫВА ========== */
.review-form {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    padding: 14px;
    background-color: #1e1e1e;
    border-radius: 8px;
    border: 1px solid #282828;
    animation: slideDown 0.25s ease-out;
    width: 100%;
    box-sizing: border-box;
}

.review-form.visible {
    display: flex;
}

.review-form-field {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.review-input,
.review-textarea {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    background-color: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.review-input::placeholder,
.review-textarea::placeholder {
    color: #666666;
}

.review-input:focus,
.review-textarea:focus {
    border-color: #1f88ff;
}

.review-input.error,
.review-textarea.error {
    border-color: #e53935;
    background-color: #2a1515;
}

.review-stars-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.review-stars-label {
    font-size: 14px;
    color: #b3b3b3;
}

.star-picker {
    display: flex;
    gap: 4px;
}

.star {
    font-size: 28px;
    color: #404040;
    cursor: pointer;
    transition: color 0.15s ease;
    user-select: none;
    line-height: 1;
}

.star.active {
    color: #ffc107;
}

.star:hover {
    color: #ffc107;
}

.review-form-btns {
    display: flex;
    gap: 10px;
}

.review-cancel-btn {
    flex: 1;
    padding: 11px 16px;
    background-color: #2a2a2a;
    color: #b3b3b3;
    border: 1px solid #404040;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.review-cancel-btn:hover { background-color: #333333; }

.review-submit-btn {
    flex: 2;
    padding: 11px 16px;
    background-color: #1f88ff;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.review-submit-btn:hover { background-color: #1a7ae8; }
.review-submit-btn:active { background-color: #1570d0; }

.review-success {
    display: none;
    color: #4ade80;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    padding: 8px 0 0;
    animation: slideDown 0.3s ease-out;
}

/* ========== ПРИКРЕПЛЁННЫЙ ФАЙЛ В ОТЗЫВЕ ========== */
.review-attachment {
    display: inline-block;
    margin-top: 8px;
    font-size: 13px;
    color: #888888;
    cursor: pointer;
    border-bottom: 1px dashed #55555588;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.review-attachment:hover {
    color: #aaaaaa;
    border-color: #aaaaaa88;
}

/* ========== ФОРМА ОТЗЫВА — СТРОКА ИМЕНИ СО СКРЕПКОЙ ========== */
.review-form-name-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
    width: 100%;
}

.review-input-name {
    flex: 1;
    min-width: 0;
}

.attach-btn {
    flex-shrink: 0;
    width: 39px;
    height: 39px;
    background-color: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    padding: 0;
    line-height: 1;
}

.attach-btn:hover {
    background-color: #333333;
}

/* ========== ТОСТ "ФАЙЛЫ ОТСУТСТВУЮТ" ========== */
.no-files-toast {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background-color: #2a2a2a;
    color: #b3b3b3;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid #404040;
    white-space: nowrap;
    z-index: 9999;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.no-files-toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ========== LIGHTBOX ========== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.88);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lightbox.active {
    display: flex;
}

.lightbox-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 100%;
}

.lightbox-close {
    align-self: flex-end;
    background-color: #2a2a2a;
    color: #ffffff;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lightbox-close:hover {
    background-color: #3a3a3a;
}

.lightbox-img-wrap {
    max-width: min(500px, 100%);
    max-height: 70vh;
    overflow: auto;
    border-radius: 10px;
}

.lightbox-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}
.similar-apps-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #282828;
}

.similar-carousel {
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 4px 4px 8px;
    margin: -4px -4px 0;
}

.similar-carousel-inner {
    display: flex;
    gap: 12px;
    padding-bottom: 4px;
}

.similar-app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100px;
    flex-shrink: 0;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.similar-app-card:active { transform: scale(0.95); }

.similar-app-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 0 0 2px #3a3a3a;
}

.similar-app-info { text-align: center; width: 100%; }

.similar-app-name {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.similar-app-rating {
    font-size: 11px;
    color: #ffc107;
}

.similar-carousel::-webkit-scrollbar { height: 4px; }
.similar-carousel::-webkit-scrollbar-track { background: #282828; border-radius: 2px; }
.similar-carousel::-webkit-scrollbar-thumb { background: #555555; border-radius: 2px; }

/* ========== FOOTER ========== */
.footer {
    text-align: center;
    padding: 16px 0;
    border-top: 1px solid #282828;
    font-size: 12px;
    color: #666666;
}

/* ========== SCROLLBAR STYLING ========== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: #404040; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555555; }

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 480px) {
    .container { max-width: 100%; }
    .app-title { font-size: 22px; }
    .carousel-item { width: 160px; height: 240px; }
    .similar-app-card { width: 90px; }
    .similar-app-icon { width: 70px; height: 70px; }

}
