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

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

/* NAVBAR */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-container {
    max-width: 1536px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logoImg {
    height: 2.5rem;
    width: auto;
    margin-right: 1rem;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logoImg:hover {
    transform: scale(1.05);
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.3em;
    color: #E0121A;
}

.nav-links {
    display: flex;
    gap: 3rem;
}

.nav-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 0.875rem;
    letter-spacing: 0.3em;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-btn:hover {
    color: #E0121A;
}

/* HAMBURGER MENU */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 100;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: #FFFFFF;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
    transform: translateY(10.5px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
    transform: translateY(-10.5px) rotate(-45deg);
}

/* MOBILE MENU */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(20px);
    z-index: 90;
    transition: right 0.4s ease;
    overflow-y: auto;
    border-left: 1px solid rgba(224, 18, 26, 0.3);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-content {
    padding: 6rem 2rem 2rem;
}

.mobile-menu-section {
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-menu-title {
    width: 100%;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    padding: 1.2rem 1rem;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.mobile-menu-title:hover {
    color: #E0121A;
    background-color: rgba(224, 18, 26, 0.05);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.mobile-menu-section.active .dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background-color: rgba(255, 255, 255, 0.02);
}

.mobile-menu-section.active .mobile-submenu {
    max-height: 500px;
}

.mobile-submenu-link {
    display: block;
    color: #CCCCCC;
    text-decoration: none;
    padding: 1rem 1.5rem 1rem 2rem;
    font-size: 1rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.mobile-submenu-link:hover {
    color: #FFFFFF;
    background-color: rgba(224, 18, 26, 0.1);
    border-left-color: #E0121A;
    padding-left: 2.5rem;
}

.desktop-only {
    display: flex;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }
    
    .desktop-only {
        display: none;
    }
}

@media (max-width: 480px) {
    .mobile-menu {
        width: 90%;
    }
    
    .mobile-menu-title {
        font-size: 1.1rem;
        padding: 1rem 0.8rem;
    }
    
    .mobile-submenu-link {
        font-size: 0.95rem;
        padding: 0.9rem 1.2rem 0.9rem 1.5rem;
    }
}

/* BACKDROP */
.backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background-color: #000000;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.5s ease-in-out;
    padding: 2rem;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.sidebar-title {
    font-size: 1.5rem;
    letter-spacing: 0.3em;
    font-weight: 300;
}

.close-btn {
    background: none;
    border: none;
    color: #FFFFFF;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-link {
    display: block;
    font-size: 1.125rem;
    letter-spacing: 0.05em;
    color: #FFFFFF;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.sidebar-link:hover {
    color: #E0121A;
    border-bottom-color: rgba(224, 18, 26, 0.5);
}

/* COMMON SECTION STYLES */
.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8rem 2rem 4rem;
}

.section-title {
    font-size: 4rem;
    font-weight: bold;
    letter-spacing: 0.3em;
    text-align: center;
    color: #FFFFFF;
    margin-bottom: 1rem;
}

.section-subtitle {
    text-align: center;
    font-size: 1.25rem;
    letter-spacing: 0.15em;
    color: #E0121A;
    font-weight: 300;
    margin-bottom: 4rem;
}

/* GUIDE TECNICHE - MARKDOWN VIEWER */
.docs-section {
    min-height: 100vh;
    background-color: #000000;
}

.markdown-viewer {
    max-width: 900px;
    margin: 0 auto;
    background-color: #0a0a0a;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.markdown-content {
    padding: 3rem;
    max-height: 70vh;
    overflow-y: auto;
    line-height: 1.8;
}

.markdown-content::-webkit-scrollbar {
    width: 10px;
}

.markdown-content::-webkit-scrollbar-track {
    background: #0f0f0f;
}

.markdown-content::-webkit-scrollbar-thumb {
    background: #E0121A;
    border-radius: 5px;
}

.markdown-content::-webkit-scrollbar-thumb:hover {
    background: #b00f15;
}

.loading-spinner {
    text-align: center;
    padding: 4rem;
    color: #888888;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
}

/* Markdown Styling */
.markdown-content h1 {
    font-size: 2.5rem;
    color: #E0121A;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    border-bottom: 2px solid rgba(224, 18, 26, 0.3);
    padding-bottom: 0.5rem;
}

.markdown-content h2 {
    font-size: 2rem;
    color: #FFFFFF;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: 0.08em;
}

.markdown-content h3 {
    font-size: 1.5rem;
    color: #CCCCCC;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    letter-spacing: 0.06em;
}

.markdown-content p {
    margin-bottom: 1.2rem;
    color: #AAAAAA;
    font-size: 1rem;
}

.markdown-content ul, .markdown-content ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    color: #AAAAAA;
}

.markdown-content li {
    margin-bottom: 0.5rem;
}

.markdown-content code {
    background-color: #1a1a1a;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    color: #E0121A;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.markdown-content pre {
    background-color: #1a1a1a;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-left: 4px solid #E0121A;
}

.markdown-content pre code {
    background: none;
    padding: 0;
    color: #CCCCCC;
}

.markdown-content blockquote {
    border-left: 4px solid #E0121A;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #999999;
    font-style: italic;
}

.markdown-content a {
    color: #E0121A;
    text-decoration: none;
    transition: color 0.3s ease;
}

.markdown-content a:hover {
    color: #FF2030;
    text-decoration: underline;
}

/* SCHEMI ELETTRICI */
.schematics-section {
    min-height: 100vh;
    background-color: #0a0a0a;
}

.schematics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
}

.schematic-card {
    background-color: #0f0f0f;
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.4s ease;
}

.schematic-card:hover {
    transform: translateY(-10px);
    border-color: rgba(224, 18, 26, 0.3);
    box-shadow: 0 10px 40px rgba(224, 18, 26, 0.2);
}

.schematic-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.schematic-title {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    color: #FFFFFF;
    text-align: center;
    margin-bottom: 1.5rem;
}

.schematic-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #AAAAAA;
    text-align: center;
    margin-bottom: 2rem;
}

.schematic-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.schematic-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.schematic-card:hover .schematic-image img {
    transform: scale(1.1);
}

.schematic-details {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.detail-badge {
    padding: 0.5rem 1rem;
    background-color: rgba(224, 18, 26, 0.1);
    border: 1px solid rgba(224, 18, 26, 0.3);
    color: #E0121A;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    border-radius: 20px;
    font-weight: 600;
}

/* CODICE SORGENTE */
.code-section {
    min-height: 100vh;
    background-color: #000000;
}

.code-explanation {
    max-width: 1200px;
    margin: 0 auto;
}

.code-info {
    background-color: #0a0a0a;
    border-radius: 12px;
    padding: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 3rem;
}

.code-info-title {
    font-size: 2rem;
    color: #E0121A;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    margin-top: 2.5rem;
}

.code-info-title:first-child {
    margin-top: 0;
}

.code-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #CCCCCC;
    margin-bottom: 2rem;
}

.code-modules {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.module-item {
    background-color: #0f0f0f;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
}

.module-item:hover {
    border-color: rgba(224, 18, 26, 0.3);
    transform: translateX(5px);
}

.module-icon {
    font-size: 2.5rem;
}

.module-content h4 {
    color: #FFFFFF;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.module-content p {
    color: #888888;
    font-size: 0.9rem;
    line-height: 1.5;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tech-badge {
    padding: 0.6rem 1.2rem;
    background-color: rgba(224, 18, 26, 0.1);
    border: 1px solid rgba(224, 18, 26, 0.3);
    color: #E0121A;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border-radius: 20px;
    font-weight: 600;
}

.code-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.step {
    display: flex;
    align-items: start;
    gap: 1.5rem;
    background-color: #0f0f0f;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #E0121A;
}

.step-number {
    min-width: 50px;
    height: 50px;
    background-color: #E0121A;
    color: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.step-content h4 {
    color: #FFFFFF;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.step-content code {
    display: block;
    background-color: #1a1a1a;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    color: #CCCCCC;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    overflow-x: auto;
}

/* GITHUB CTA BUTTON */
.github-cta {
    text-align: center;
}

.github-button {
    display: inline-flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem 4rem;
    background: linear-gradient(135deg, #E0121A 0%, #b00f15 100%);
    color: #FFFFFF;
    text-decoration: none;
    border-radius: 12px;
    font-size: 1.8rem;
    font-weight: bold;
    letter-spacing: 0.2em;
    transition: all 0.4s ease;
    box-shadow: 0 10px 30px rgba(224, 18, 26, 0.3);
}

.github-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(224, 18, 26, 0.5);
}

.github-logo {
    width: 60px;
    height: 60px;
    color: #FFFFFF;
}

.github-text {
    flex: 1;
}

/* DOWNLOAD SECTION */
.download-section {
    min-height: 100vh;
    background-color: #0a0a0a;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
}

.download-card {
    background-color: #0f0f0f;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    min-height: 450px;
}

.download-card:hover {
    transform: translateY(-10px);
    border-color: rgba(224, 18, 26, 0.3);
    box-shadow: 0 10px 40px rgba(224, 18, 26, 0.2);
}

.download-icon {
    margin-bottom: 1.5rem;
    color: #E0121A;
}

.download-title {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 0.15em;
    color: #FFFFFF;
    margin-bottom: 1.5rem;
}

.download-description {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #AAAAAA;
    margin-bottom: 2rem;
    flex: 1;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-decoration: none;
    transition: all 0.3s ease;
}

.download-btn.primary {
    background-color: #E0121A;
    color: #FFFFFF;
}

.download-btn.primary:hover {
    background-color: #b00f15;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(224, 18, 26, 0.4);
}

.download-btn.secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.download-btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(224, 18, 26, 0.5);
}

.btn-logo {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

/* FOOTER */
footer {
    background-color: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem;
    text-align: center;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    color: #888888;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .schematics-grid {
        grid-template-columns: 1fr;
    }

    .download-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2.5rem;
        letter-spacing: 0.2em;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .sidebar {
        width: 80%;
    }

    .markdown-content {
        padding: 2rem;
    }

    .code-info {
        padding: 2rem;
    }

    .code-modules {
        grid-template-columns: 1fr;
    }

    .github-button {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem 2rem;
        font-size: 1.3rem;
    }

    .github-logo {
        width: 40px;
        height: 40px;
    }

    .github-logo-left {
        order: -1;
    }

    .download-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        gap: 1.5rem;
    }

    .nav-btn {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2rem;
    }

    .code-info-title {
        font-size: 1.5rem;
    }

    .github-button {
        font-size: 1.1rem;
        padding: 1.2rem 1.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logoImg {
        height: 2rem;
    }

    .download-card {
        min-height: auto;
    }
}