html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: system-ui, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: center;
    padding: 10px 0px 9px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
}

a {
    text-decoration: none;
    color: #007bff;
}

.language-content-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    box-sizing: border-box;
}

.language-selector {
    position: relative;
}

.video-container {
    padding-left: 0px;
    padding-right: 0px;
}

h1,
h2,
h3,
.language-content-wrapper,
.savings-content,
.cookie-banner,
.footer-content-wrapper,
.review-cards-container-wrapper,
.useful_links_wrapper {
    padding-left: 20px;
    padding-right: 20px;
}

.review-cards-container-wrapper {
    position: relative;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.language-content-wrapper,
.video-container,
.instruction-content,
.footer-content-wrapper,
.review-cards-container-wrapper,
.useful_links_wrapper {
    max-width: 1200px;
}

.content {
    text-align: center;
    padding: 20px 0;
    position: relative;
}

.content-background {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    z-index: -1;
}

.content, .content-background {
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: none;
    -webkit-filter: blur(0px);
    -moz-filter: blur(0px);
    -ms-filter: blur(0px);
    filter: progid:DXImageTransform.Microsoft.Blur(PixelRadius='0');
}

.block {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.header-content {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

.header-content h1 {
    margin: 0;
    font-size: 48px;
}

.header-content p {
    font-size: 18px;
    margin: 20px 0;
    max-width: 500px;
}

.header-content,
.video-container {
    min-height: 75vh;
}

.download-button {
    display: inline-block;
}

.download-button img {
    width: 150px;
    height: 50px;
}

/* Стили для блока инструкции */
.instruction {
    text-align: center;
    margin: 40px 0;
    padding: 40px 0;
    width: 100%;
}

.instruction h2 {
    margin-bottom: 30px;
    padding: 0;
}

.instruction-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.instruction-intro {
    max-width: 520px;
    margin: 0 auto 40px;
    text-align: center;
}

.instruction-intro p {
    font-size: 18px;
    line-height: 1.6;
}

.instruction-cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

.instruction-card {
    background-color: #f9f9f9;
    padding: 25px;
    text-align: left;
    box-sizing: border-box;
    margin-left: -20px;
    margin-right: -20px;
}

.instruction-card h3 {
    font-size: 22px;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    padding: 0;
    font-weight: bolder;
}

.instruction-card ol,
.instruction-card ul {
    margin: 0;
    padding-left: 25px;
}

.instruction-card li {
    font-size: 16px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.instruction-conclusion {
    max-width: 540px;
    margin: 0 auto;
    text-align: center;
    font-size: 18px;
}

.savings {
    text-align: center;
    margin: 40px 0;
    padding: 40px 0;
    background-color: #f8f8f8;
}

.savings-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.savings-input {
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

h2 {
    font-size: 28px;
    margin-bottom: 20px;
}

h3 {
    font-size: 18px;
    font-weight: normal;
}

select {
    padding: 8px;
    padding-right: 30px;
    font-size: 16px;
    color: #000;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns%3D%22http%3A//www.w3.org/2000/svg%22 width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22%3E%3Cpath fill%3D%22%23000%22 d%3D%22M4 6l4 4 4-4z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 12px 12px;
}

select:focus {
    outline: none;
}

/* Устаревшие стили для инструкции - можно удалить после обновления HTML */
.instruction-section {
    text-align: left;
    margin: 40px 0;
    width: 100%;
}

.instruction-intro {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 40px;
}

.video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1.754;
    overflow: hidden;
    margin: 0 auto;
    box-sizing: border-box;
}

#tutorial-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: inherit;
    box-sizing: border-box;
}

.savings-input img {
    cursor: pointer;
}

.savings-input select:first-child {
    margin-right: 10px;
}

.savings-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 50px;
    width: 100%;
}

.savings-results p {
    font-size: 18px;
    margin: 2px 0;
}

.result-block {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
}

.result-block p:first-child {
    margin-right: 10px;
}

.spacer {
    height: 20px;
}

.add-device-button {
    text-align: left;
    width: 100%;
    margin: 10px 0;
}

.add-device-button a {
    font-size: 16px;
}

.reviews {
    padding: 20px 0;
    text-align: center;
    position: relative;
}

.review-cards-container {
    display: flex;
    align-items: center;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.review-cards-container::-webkit-scrollbar {
    display: none;
}

.review-cards-navigation {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
}

.review-card {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 100%;
    padding: 20px;
    border-left: 5px solid white;
    border-right: 5px solid white;
    background-color: #f9f9f9;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.review-card img {
    border-radius: 50%;
    width: 120px;
    height: 120px;
    margin-bottom: 10px;
}

.review-text {
    font-size: 16px;
}

.nav-button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    touch-action: manipulation;
}

.nav-button img {
    width: 32px;
    height: 32px;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.nav-button:active img {
    transform: scale(0.85);
}

#prev-button {
    left: 0;
}

#next-button {
    right: 0;
}

.useful_links {
    text-align: center;
    margin-bottom: 20px;
}

.useful_links_wrapper {
    display: flex;
    margin: 0 auto;
    flex-flow: column;
    align-items: end;
}

.useful_links a {
    color: #080808;
}

footer {
    text-align: center;
    padding-top: 20px;
    padding-bottom: 20px;
    background-color: #f8f8f8;
    border-top: 1px solid #ddd;
}

footer .footer-content-wrapper {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

footer p {
    margin: 5px 0;
    font-size: 16px;
}

.social-icons {
    display: flex;
    align-items: center;
}

.social-icons a {
    margin-left: 10px;
    width: 24px;
    height: 24px;
    display: inline-block;
}

.social-icons img {
    width: 100%;
}

.cookie-banner {
    position: fixed;
    box-sizing: border-box;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 14px;
    z-index: 9999;
    display: none;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-flow: column;
}

.cookie-content p {
    margin-top: 0;
    margin-bottom: 15px;
}

.cookie-banner a {
    color: #f1c40f;
    text-decoration: none;
}

.cookie-banner button {
    background-color: #f1c40f;
    color: #333;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
}

.cookie-banner button:hover {
    background-color: #e1b30f;
}

/* Адаптивность */
@media (min-width: 400px) {
    .cookie-content {
        flex-flow: row;
        align-items: center;
        gap: 16px;
    }

    .cookie-banner button {
        flex: 1;
    }

    .cookie-banner p {
        flex-grow: 1;
        margin: 0;
        text-align: left;
    }
}

@media (min-width: 768px) {
    .review-card {
        width: 50%;
    }
    
    .instruction-cards {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .instruction-card {
        flex: 1 1 calc(50% - 12px);
        max-width: calc(50% - 12px);
        margin-left: 0;
        margin-right: 0;
        border-radius: 10px;
    }
    
    .header-content h1 {
        font-size: 68px;
    }

    .header-content p {
        font-size: 24px;
    }

    h2 {
        font-size: 36px;
    }
}

@media (min-width: 900px) {
    .review-card {
        width: 33.33%;
        width: calc(100%/3);
    }
}

@media (min-width: 1024px) {
    .instruction-card {
        flex: 1 1 calc(33.333% - 16px);
        max-width: calc(33.333% - 16px);
    }
}

@supports (padding-top: env(safe-area-inset-top)) {

    .video-container {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    h1,
    h2,
    h3,
    .language-content-wrapper,
    .instruction-content,
    .savings-content,
    .cookie-banner,
    .useful_links_wrapper,
    .footer-content-wrapper,
    .review-cards-container-wrapper {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    .cookie-content {
        margin-bottom: max(0px, env(safe-area-inset-bottom));
    }

    .review-cards-navigation {
        left: max(10px, env(safe-area-inset-left));
        right: max(10px, env(safe-area-inset-right));
    }
}