/* Reset default margins and ensure box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base styles */
body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
}

.superscript {
    font-size: 0.5em;
    vertical-align: super;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Header styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.logo {
    display: flex;
    align-items: center;
    font-family: 'NASA';
    font-size: 24px;
}

.logo img {
    height: 50px;
    margin-right: 15px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 12px;
    transition: color 0.3s, background-color 0.3s;
    border-radius: 5px;
}

nav ul li a:hover {
    color: #0066cc;
    background-color: rgba(0, 102, 204, 0.1);
}

nav ul li a.active {
    color: #0066cc;
    background-color: rgba(0, 102, 204, 0.2);
    font-weight: 600;
}

.mobile-menu-btn {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* Back to Top button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0066cc;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background 0.3s;
    z-index: 1000;
}

.back-to-top:hover {
    background: #0055aa;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* Hero section */
.hero {
    padding: 150px 0 100px;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('img/ANESA-24-CLEAR.png');
    background-size: cover;
    color: white;
    text-align: center;
    background-color: #0055aa;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    margin-top: 4rem;
}

.btn {
    display: inline-block;
    background: #0066cc;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 20px;
    transition: background 0.3s;
}

.btn:hover {
    background: #0055aa;
}

/* Features section */
.features {
    padding: 80px 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 50px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature {
    text-align: center;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature img {
    height: 180px;
    margin-bottom: 20px;
}

/* About Device section */
.about-device {
    padding: 80px 0;
    background: #f9f9f9;
}

.device-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.device-image img {
    width: 30%;
    max-width: max-content;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.device-specs ul {
    list-style: none;
    padding: 0;
}

.device-specs li {
    margin-bottom: 2px;
    padding-bottom: 2px;
    border-bottom: 1px solid #eee;
    line-height: 1.3;
    font-size: 0.9rem;
    display: flex;
}

.device-specs strong {
    width: 140px;
    flex-shrink: 0;
}

/* Manual section */
.manual {
    padding: 80px 0;
}

.manual-sections {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.manual-section {
    padding: 30px;
    background: #f9f9f9;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

.manual-section h3 {
    margin-bottom: 15px;
}

.manual-section p {
    flex-grow: 1;
}

.read-more-btn {
    padding: 12px 24px;
    background: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: auto;
    align-self: center;
}

.read-more-btn:hover {
    background: #0056b3;
}

.full-manual-download {
    text-align: center;
}

/* Support section */
.support {
    padding: 80px 0;
    background: #f9f9f9;
}

.support-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.faq-item {
    margin-bottom: 15px;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
}

.faq-answer {
    padding: 15px;
    display: none;
}

.faq-answer.show {
    display: block;
}

/* Downloads section */
.downloads {
    padding: 80px 0;
}

.download-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.download-item {
    text-align: center;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    min-height: 250px; /* Минимальная высота для выравнивания */
}

.download-item h3 {
    margin-bottom: 15px;
}

.download-item p {
    flex-grow: 1; /* Растягивает текст, чтобы кнопка ушла вниз */
}

.download-item .btn {
    margin-top: auto; /* Прижимает кнопку к низу */
}

/* Footer */
footer {
    background: #333;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.eac-mark {
    height: 50px;
    margin-top: 15px;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
}

/* Popup styles */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 2000;
    overflow: auto;
}

.popup-content {
    background: white;
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pdf-viewer {
    width: 100%;
    height: calc(100% - 50px);
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.pdf-canvas {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    cursor: pointer;
    color: #333;
    padding: 10px;
    z-index: 10;
}

.nav-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: #f0f0f0;
}

.nav-btn {
    padding: 8px 16px;
    background: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.nav-btn:hover:not(:disabled) {
    background: #0056b3;
}

body.popup-open {
    overflow: hidden;
}

/* Section animation */
.section-hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Information section */
.information {
    padding: 130px 20px;
    font-family: 'Roboto', sans-serif;
    color: #333;
}

.information-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.information-container h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a3c6d;
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.information-options {
    text-align: left;
    max-width: 800px;
    margin: 0 auto;
}

.information-options p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #4a4a4a;
}

.information-options h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1a3c6d;
    margin: 30px 0 20px;
}

.parameter-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.parameter-list li {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    padding-left: 20px;
    position: relative;
}

.parameter-list li::before {
    content: '✔';
    color: #28a745;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

.parameter-list li:last-child {
    font-style: italic;
    color: #6c757d;
}

.parameter-list li:last-child::before {
    content: none;
}

/* Media queries for responsiveness */
@media (max-width: 1023px) {
    .features-grid,
    .manual-sections,
    .download-items {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .device-info,
    .support-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .mobile-menu-btn {
        display: block;
        order: 1;
    }
    
    nav ul {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }
    
    nav ul.show {
        display: flex;
    }
    
    nav ul li {
        margin: 0;
        padding: 10px 20px;
    }
    
    nav ul li a {
        display: block;
        padding: 10px;
    }
    
    nav ul li a:hover,
    nav ul li a.active {
        background-color: rgba(0, 102, 204, 0.2);
        color: #0066cc;
        border-radius: 0;
    }
    
    .features-grid,
    .manual-sections,
    .download-items,
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 120px 0 80px;
    }
    
    .hero h2 {
        font-size: 2rem;
        margin-top: 5rem;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .manual-section {
        min-height: 300px;
    }

    .download-item {
        min-height: 300px; /* Увеличиваем высоту для мобильных */
    }
}

@media (max-width: 768px) {
    .information-container h2 {
        font-size: 2rem;
    }

    .information-options h3 {
        font-size: 1.5rem;
    }

    .information-options p {
        font-size: 1rem;
    }

    .parameter-list {
        grid-template-columns: 1fr;
    }

    .pdf-canvas {
        width: 100% !important;
        height: auto !important;
    }
}

@media (max-width: 480px) {
    .information {
        padding: 40px 15px;
    }

    .information-container h2 {
        font-size: 1.8rem;
    }

    .information-options p {
        font-size: 0.95rem;
    }

    .popup-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .close-btn {
        top: 5px;
        right: 5px;
        font-size: 32px;
        padding: 12px;
    }

    .nav-buttons {
        padding: 8px;
    }
}