@font-face {
    font-family: 'Montserrat';
    src: url('/assets/tipography/Tipografías/Montserrat/static/Montserrat-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Raleway';
    src: url('/assets/tipography/Tipografías/Raleway/static/Raleway-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

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

body {
    font-family: 'Montserrat', Arial, sans-serif;
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr;
    position: relative;
    background: url('/assets/images/imgs_web/backgrounds/background_home.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Background Network Visualization */
.network-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.6;
}

.network-node {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.network-line {
    position: absolute;
    height: 1px;
    transform-origin: left center;
}

/* Header */
header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    backdrop-filter: blur(10px);
    background-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgba(255, 255, 255, 0.9));
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Raleway', sans-serif;
    font-weight: bold;
    font-size: 1.5rem;
    color: #0388a6;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: #0388a6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: #0388a6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

nav a:hover {
    color: #025a6b;
}

nav a.active {
    color: #025a6b;
    font-weight: bold;
}

nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: #f2b544;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-selector {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    height: 46px;
    width: 125px;
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 24px;
    font-weight: 700;
    color: #0388a6;
    border: transparent;
    cursor: pointer;
    transition: background 0.3s ease;
}

.language-selector:hover {
    background: rgba(3, 136, 166, 0.1);
}

.flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.flag-es {
    background-image: url('/assets/images/SVG/ic_es.png');
}

.flag-en {
    background-image: url('/assets/images/SVG/ic_en.png');
}

.dark-mode-toggle {
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 60px;
    color: #0388a6;
    transition: background 0.3s ease;
}

.dark-mode-toggle:hover {
    background: rgba(3, 136, 166, 0.1);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #0388a6;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

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

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Navigation Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #0388a6 0%, #025a6b 100%);
    z-index: 1000;
    padding: 2rem;
    box-sizing: border-box;
}

.nav-overlay.active {
    display: flex;
    flex-direction: column;
}

.nav-overlay .close-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

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

.nav-overlay .mobile-lang-selector {
    position: absolute;
    top: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 24px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s ease;
}

.nav-overlay .mobile-lang-selector:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-overlay nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-overlay nav ul {
    flex-direction: column;
    gap: 3rem;
    list-style: none;
    text-align: center;
}

.nav-overlay nav a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-overlay nav a:hover {
    color: rgba(255, 255, 255, 0.8);
}

.nav-overlay nav a.active {
    color: white;
    font-weight: bold;
}

.nav-overlay nav a.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #f2b544;
}

.nav-overlay .mobile-dark-mode {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-overlay .mobile-dark-mode:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Main Content */
main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    width: 100%;
    margin: 0 auto;
    gap: 2rem;
    padding: 2rem;
    position: relative;
}

.hero-content {
    position: relative;
    grid-column: 1 / 2;
    grid-row: 1;
    display: flex;
    justify-content: start;
    flex-direction: column;
    flex-wrap: nowrap;
    /* flex-grow: 1;*/
    margin: 0px 40px;
}

.hero-content h1 {
    font-family: 'Raleway', sans-serif;
    font-size: 7.25rem;
    font-weight: 700;
    color: #0388a6;
    line-height: 1.2;
    margin-bottom: 40px;
}

.hero-content p {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.75rem;
    font-weight: 500;
    color: #01303a;
    margin-bottom: 68px;
}

.cta-button {
    font-family: 'Raleway', sans-serif;
    background: #0388a6;
    color: white;
    border: none;
    padding: 24px 200px;
    border-radius: 100px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-start;
    white-space: nowrap;
    min-width: fit-content;
}

.cta-button:hover {
    background: #025a6b;
    transform: translateY(-2px);
}

/* Footer */
/*
.footer-content {
    position: relative;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    width: 100%;
}
    */

footer {
    grid-column: 1 / -1;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 48px;
    background: rgba(255, 255, 255, 0.4);
}

.footer-left {
    color: #0388a6;
    font-size: 0.9rem;
    z-index: 5;
}

.footer-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.footer-button {
    background: rgba(217, 237, 242, 0.8);
    color: #0388a6;
    padding: 12px 48px;
    border-radius: 25px;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}

.footer-button:hover {
    background: #0388a6;
    color: white;
}

.social-icons {
    display: flex;
    gap: 1rem;
    z-index: 5;
}

.social-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0388a6;
    transition: color 0.3s ease;
    cursor: pointer;
}

.social-icon:hover {
    color: #025a6b;
}

/* Dark Mode */
body.dark-mode {
    filter: invert(1) hue-rotate(180deg);
    background: url('/assets/images/imgs_web/backgrounds/background_home.png') no-repeat center center, #121212;
    background-size: cover;
    background-attachment: fixed;
}

/* Invert all main content */
body.dark-mode main,
body.dark-mode .hero-content,
body.dark-mode .hero-content h1,
body.dark-mode .hero-content p,
body.dark-mode .cta-button,
body.dark-mode header,
body.dark-mode footer,
body.dark-mode nav,
body.dark-mode .footer-left,
body.dark-mode .footer-button,
body.dark-mode .social-icons {
    filter: none;
    /* Let parent inversion handle these */
}

/* Counter-invert elements that should maintain their appearance */
body.dark-mode img,
body.dark-mode .logo img,
body.dark-mode .flag,
body.dark-mode .flag-es,
body.dark-mode .flag-en,
body.dark-mode video,
body.dark-mode canvas,
body.dark-mode svg:not(.social-icon svg):not(.dark-mode-toggle svg):not(.mobile-dark-mode svg),
body.dark-mode iframe {
    filter: invert(1) hue-rotate(180deg);
}

/* Keep social icons, dark mode toggles, and hamburger visible */
body.dark-mode .social-icon svg,
body.dark-mode .dark-mode-toggle svg,
body.dark-mode .mobile-dark-mode svg,
body.dark-mode .hamburger span {
    filter: invert(1) hue-rotate(180deg);
}

/* Navigation overlay should not be double-inverted */
body.dark-mode .nav-overlay {
    filter: invert(1) hue-rotate(180deg);
}

/* Close button in mobile nav */
body.dark-mode .nav-overlay .close-btn {
    filter: invert(1) hue-rotate(180deg);
}

/* Network background gets inverted with the body */
body.dark-mode .network-background {
    filter: none;
}

/* Ensure network nodes and lines are visible in dark mode */
body.dark-mode .network-node {
    background: #0388a6 !important;
    /* Will be inverted to light blue */
    opacity: 0.8;
}

body.dark-mode .network-line {
    background: linear-gradient(90deg, rgba(3, 136, 166, 0.3), rgba(2, 90, 107, 0.1)) !important;
    /* Will be inverted */
}

/* Active navigation indicator */
body.dark-mode nav a.active::after {
    filter: invert(1) hue-rotate(180deg);
}

/* Responsive Design */
@media (max-width: 1024px) {
    body {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    main {
        grid-column: 1;
        text-align: center;
    }

    .background-area {
        display: none;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .cta-button {
        align-self: center;
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem 2rem;
    }

    .hamburger {
        display: flex;
    }

    nav {
        display: none;
    }

    .header-controls {
        display: none;
    }

    .hero-content {
        margin: 0px 20px;
        justify-content: flex-start;
    }

    .hero-content h1 {
        font-size: 4rem;
        font-weight: 500;
        line-height: 1.4;
        text-align: left;
    }

    .hero-content p {
        font-size: 1rem;
        font-weight: 400;
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    .cta-button {
        font-family: 'Raleway', sans-serif;
        background: #0388a6;
        color: white;
        border: none;
        padding: 12px 48px;
        border-radius: 25px;
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        align-self: center;
        white-space: nowrap;
        min-width: fit-content;
    }

    main {
        padding: 2rem 1rem;
        grid-template-columns: 1fr;
        min-height: calc(100vh - 160px);
    }

    footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        margin-top: auto;
        position: sticky;
        bottom: 0;
    }

    .footer-center {
        position: static;
        transform: none;
    }

    /* Services page mobile integration */
    main.services-main {
        padding: 0;
        background: none;
    }

    @media (max-width: 768px) {
        main.services-main {
            grid-template-columns: 1fr;
            min-height: auto;
        }

        /* Ensure proper footer positioning for services */
        body:has(.services-content) {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        body:has(.services-content) footer {
            margin-top: auto;
        }
    }
}