/* --- Global Styles --- */
body {
    font-family: 'Montserrat', sans-serif;
    background-color: #000000;
    color: #ffffff;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6,
.navbar-brand,
.nav-link {
    font-family: 'Orbitron', sans-serif;
}

/* --- Preloader --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-atom {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-core {
    width: 20px;
    height: 20px;
    background-color: #FF5E00;
    border-radius: 50%;
    box-shadow: 0 0 20px #FF5E00;
    z-index: 10;
}

.loader-orbit {
    position: absolute;
    border: 2px solid rgba(255, 94, 0, 0.5);
    border-radius: 50%;
    width: 100%;
    height: 30%;
    /* Oval shape */
}

.loader-orbit:nth-child(1) {
    transform: rotate(0deg);
    animation: spin-orbit 1s linear infinite;
}

.loader-orbit:nth-child(2) {
    transform: rotate(60deg);
    animation: spin-orbit 1s linear infinite;
}

.loader-orbit:nth-child(3) {
    transform: rotate(120deg);
    animation: spin-orbit 1s linear infinite;
}

@keyframes spin-orbit {
    0% {
        transform: rotate(var(--angle)) rotateX(0deg);
    }

    100% {
        transform: rotate(var(--angle)) rotateX(360deg);
    }
}

/* --- Animated Atom Background --- */
.atom-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: #000000;
    background: radial-gradient(ellipse at bottom, #0a0a0a 0%, #000000 100%);
}

.atom-solar-system {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.6;
}

.atom-sun {
    position: absolute;
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, #FF5E00, #ff8c00);
    border-radius: 50%;
    box-shadow: 0 0 30px #FF5E00, 0 0 60px #FF5E00;
    z-index: 10;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(255, 94, 0, 0.2);
    border-radius: 50%;
    animation: rotate linear infinite;
}

.orbit-1 {
    width: 300px;
    height: 300px;
    animation-duration: 10s;
}

.orbit-2 {
    width: 500px;
    height: 500px;
    animation-duration: 15s;
}

.orbit-3 {
    width: 700px;
    height: 700px;
    animation-duration: 20s;
}

.atom-planet {
    position: absolute;
    top: 50%;
    left: -10px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px #FF5E00;
    transform: translateY(-50%);
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* --- Particle Rain --- */
.atom-particle {
    position: absolute;
    top: -10px;
    background: radial-gradient(circle, #ffffff, #FF5E00);
    border-radius: 50%;
    opacity: 0;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(110vh);
        opacity: 0;
    }
}

/* --- Neon Effects (Orange) --- */
.neon-text {
    color: #fff;
    text-shadow: 0 0 7px #fff, 0 0 10px #fff, 0 0 21px #fff, 0 0 42px #FF5E00, 0 0 82px #FF5E00, 0 0 92px #FF5E00, 0 0 102px #FF5E00;
}

/* --- Buttons --- */
.btn-neon {
    background-color: transparent;
    border: 2px solid #FF5E00;
    color: #FF5E00;
    border-radius: 5px;
    padding: 10px 20px;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-neon:hover {
    background-color: #FF5E00;
    color: #000000;
    box-shadow: 0 0 10px #FF5E00, 0 0 20px #FF5E00, 0 0 40px #FF5E00;
}

/* --- Cards --- */
.card-futuristic {
    background-color: rgba(20, 20, 20, 0.85);
    border: 1px solid #FF5E00;
    backdrop-filter: blur(5px);
    border-radius: 10px;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-futuristic:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(255, 94, 0, 0.3), inset 0 0 10px rgba(255, 94, 0, 0.1);
}

.card-futuristic .card-body,
.card-futuristic .card-title {
    color: #ffffff;
}

.card-futuristic .card-title {
    font-family: 'Orbitron', sans-serif;
    color: #FF5E00;
    margin-bottom: 1.5rem;
}

/* --- Animations --- */
@keyframes neon-pulse {

    0%,
    100% {
        box-shadow: 0 0 5px #FF5E00, 0 0 10px #FF5E00, 0 0 15px #FF5E00;
    }

    50% {
        box-shadow: 0 0 10px #FF5E00, 0 0 20px #FF5E00, 0 0 40px #FF5E00;
    }
}

.pulse-animation {
    animation: neon-pulse 2s infinite;
}

/* --- Typewriter Cursor --- */
.cursor {
    display: inline-block;
    width: 10px;
    background-color: #FF5E00;
    animation: blink 1s infinite;
    vertical-align: bottom;
    height: 1em;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- Navbar --- */
.navbar {
    background-color: rgba(0, 0, 0, 0.95) !important;
    border-bottom: 1px solid #FF5E00;
    transition: padding 0.3s;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #FF5E00 !important;
}

.navbar-logo {
    height: 40px;
    width: auto;
    transition: transform 0.3s ease;
}

.navbar-brand:hover .navbar-logo {
    transform: rotate(360deg);
}

.nav-link {
    color: #ffffff !important;
    transition: color 0.3s ease, text-shadow 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #FF5E00 !important;
    text-shadow: 0 0 5px #FF5E00;
}

/* Indicator dot for active link */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background-color: #FF5E00;
    border-radius: 50%;
    box-shadow: 0 0 5px #FF5E00;
}


/* --- Sections --- */
section {
    padding: 80px 0;
}

#inicio {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 100px;
}

/* --- Scroll to Top --- */
#scrollTopButton {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    line-height: 46px;
    text-align: center;
    padding: 0;
    animation: neon-pulse 2s infinite;
    background-color: rgba(20, 20, 20, 0.9);
    border: 1px solid #FF5E00;
    color: #FF5E00;
}

#scrollTopButton:hover {
    background-color: #FF5E00;
    color: #000;
}

/* --- Footer --- */
footer {
    background-color: #000000;
    padding: 50px 0 30px;
    border-top: 1px solid #FF5E00;
    text-align: center;
}

.social-icons {
    margin-bottom: 20px;
}

.social-icon {
    font-size: 1.5rem;
    color: #fff;
    margin: 0 10px;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

.social-icon:hover {
    color: #FF5E00;
    transform: scale(1.2);
    text-shadow: 0 0 10px #FF5E00;
}

.bi {
    /* General bootstrap icon styling override if necessary */
}

/* --- Video Modal & Animations --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.video-modal-container {
    position: relative;
    width: 80%;
    max-width: 900px;
    aspect-ratio: 16/9;
}

/* SVG Border Animation */
.modal-border-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.modal-border-svg rect {
    fill: none;
    stroke: #FF5E00;
    stroke-width: 4;
    stroke-dasharray: 3000;
    stroke-dashoffset: 3000;
}

.animate-border rect {
    animation: drawBorder 1.5s ease-out forwards;
}

@keyframes drawBorder {
    to {
        stroke-dashoffset: 0;
    }
}

/* Video Reveal Animation */
.video-wrapper {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    opacity: 0;
    transform: scale(0.1);
    z-index: 1;
}

.animate-video {
    animation: videoReveal 0.8s ease-out forwards;
    animation-delay: 1s;
}

@keyframes videoReveal {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Exit Animations */
.exit-border rect {
    animation: undrawBorder 0.8s ease-out forwards;
    /* No delay: Border undraws first */
}

@keyframes undrawBorder {
    from {
        stroke-dashoffset: 0;
    }

    to {
        stroke-dashoffset: 3000;
        opacity: 0;
        /* Fade out border at end */
    }
}

.exit-video {
    animation: videoHide 0.3s ease-in forwards;
    /* Faster video fade (0.3s) while border undraws (0.8s) */
}

@keyframes videoHide {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.1);
    }
}

.modal-close {
    position: absolute;
    top: -50px;
    right: -50px;
    background: none;
    border: none;
    color: #FF5E00;
    font-size: 3rem;
    cursor: pointer;
    z-index: 3;
    font-family: 'Orbitron', sans-serif;
    transition: transform 0.3s;
}

.modal-close:hover {
    transform: scale(1.2) rotate(90deg);
    text-shadow: 0 0 10px #FF5E00;
}

/* Video Thumbnail Hover */
.video-thumbnail-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid #FF5E00;
    border-radius: 10px;
}

.video-thumbnail-card img {
    transition: transform 0.5s;
    width: 100%;
    display: block;
}

.video-thumbnail-card:hover img {
    transform: scale(1.1);
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: rgba(255, 94, 0, 0.8);
    transition: all 0.3s;
}

.video-thumbnail-card:hover .play-icon {
    color: #fff;
    text-shadow: 0 0 20px #FF5E00;
    transform: translate(-50%, -50%) scale(1.2);
}

/* --- Chatbot Widget --- */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    /* Adjusted to not overlap with scroll top button if present, or replaces it positionally */
    z-index: 10000;
    font-family: 'Montserrat', sans-serif;
}

/* Adjust scroll top button position if chatbot is present to avoid overlap */
#scrollTopButton {
    right: 100px;
    /* Move scroll button to the left of chat button */
}

.btn-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #000;
    border: 2px solid #FF5E00;
    color: #FF5E00;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 94, 0, 0.4);
    transition: all 0.3s ease;
}

.btn-chat-toggle:hover {
    background-color: #FF5E00;
    color: #000;
    transform: scale(1.1);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #FF5E00;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
    /* Animation for opening */
    transform-origin: bottom right;
    animation: openChat 0.3s ease-out forwards;
}

.chat-window.d-none {
    display: none !important;
}

@keyframes openChat {
    from {
        opacity: 0;
        transform: scale(0.1);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-header {
    background: linear-gradient(45deg, #FF5E00, #ff8c00);
    padding: 15px;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #FF5E00;
}

.chat-header h6 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background-color: #000;
    color: #FF5E00;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.btn-close-chat {
    background: none;
    border: none;
    color: #000;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-close-chat:hover {
    opacity: 1;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-body::-webkit-scrollbar {
    width: 8px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.bot-message {
    background-color: rgba(255, 94, 0, 0.1);
    border: 1px solid rgba(255, 94, 0, 0.3);
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.user-message {
    background-color: #FF5E00;
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.message a {
    color: #fff;
    text-decoration: underline;
    font-weight: bold;
}

.chat-footer {
    padding: 15px;
    border-top: 1px solid rgba(255, 94, 0, 0.2);
    background-color: rgba(0, 0, 0, 0.5);
}

.chat-footer input {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 94, 0, 0.3);
    color: #fff;
}

.chat-footer input:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #FF5E00;
    color: #fff;
    box-shadow: none;
}

.chat-footer .btn-neon {
    padding: 5px 15px;
    border-width: 1px;
}

/* --- Futuristic Accordion --- */
.accordion-item {
    background-color: #000000;
    border: 1px solid #FF5E00;
    margin-bottom: 1rem;
    border-radius: 10px !important;
    overflow: hidden;
}

.accordion-button {
    background-color: #000000;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    text-shadow: 0 0 5px #FF5E00;
    border-bottom: 1px solid rgba(255, 94, 0, 0.3);
}

.accordion-button:not(.collapsed) {
    background-color: rgba(255, 94, 0, 0.1);
    color: #FF5E00;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: #FF5E00;
}

.accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23FF5E00'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23FF5E00'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(-180deg);
}

.accordion-body {
    background-color: #000000;
    color: #eee;
}