/* Animated Mesh Background */
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;

    /* Dynamic Gradient Colors */
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #581c87, #1e293b);
    background-size: 400% 400%;
    /* Important: makes background bigger than screen to allow movement */
    animation: gradientFlow 15s ease infinite;

    min-height: 100vh;
    color: white;
}

/*Using CSS Variables (Recommended): In your custom CSS file, add a rule to set the --bs-body-font-family CSS variable  */
/*This applies the font globally to the <body> element and all inherited elements.  */
:root {
    --bs-body-font-family: 'Roboto', system-ui, -apple-system, "Segoe UI", Helvetica Neue, Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

/*If you only want to apply the font to specific elements, you can create a custom CSS class.   */
/*You would then apply the roboto-font class to the desired HTML elements (e.g., <p class="roboto-font">... text ...</p>).  */

.roboto-font {
    font-family: 'Roboto', sans-serif;
}


/* The Animation Logic */
@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Navigation Overrides for Glassmorphism */
.custom-glass-nav {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.navbar-brand img {
    height: 40px;
    transition: transform 0.3s ease;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: bold;
    letter-spacing: 0.5px;
    padding: 10px 15px;
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 2px solid transparent; /* Prevent layout shift on hover/focus */
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-bottom: 2px solid #a855f7;
}

/* Hamburger color fix */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}


/* Video Section */
.video-container {
    width: 100%;
    height: 100vh;
    margin: 0;
    line-height: 0;
    overflow: hidden;
    position: relative;
}

/* Dark Overlay for Video */
.video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 5;
}

/* Seamless Video Background */
.video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s linear;
    z-index: 0;
}

.video-bg.active {
    opacity: 1;
    z-index: 1;
}

.video-overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    color: white;
    text-align: center;
    font-family: sans-serif;
    text-shadow: 2px 2px 4px #000000;
    pointer-events: none;
    width: 100%;
}

#welcometext {
    /* Font size handled by Bootstrap 'display-1' etc, but can enforce overrides here if needed */
    letter-spacing: 2px;
}

/* Typewriter Cursor Effect */
.typing-cursor::after {
    content: '|';
    animation: blink 1s ease-in-out infinite;
}

#typewriter {
    font-size: 2.5rem;
    /* Increased font size */
    font-weight: 600;
    min-height: 3.5rem;
    /* Prevent layout shift */
    display: block;
    /* Ensure it takes up space */
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}


/* Footer */
footer {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 80px;
    padding-bottom: 40px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: auto;
}

footer h3 {
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 25px;
    font-weight: 600;
}

footer a {
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.6) !important;
}

footer a:hover {
    color: #a855f7 !important;
    padding-left: 8px;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.social-icons a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white !important;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.2rem;
    padding: 0;
}

.social-icons a:hover {
    background: #a855f7;
    border-color: #a855f7;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 5px 15px rgba(168, 85, 247, 0.4);
    padding-left: 0 !important;
    /* Override footer link hover padding */
}

/* Mission Section */
.mission-section h1 {
    font-weight: bold;
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.mission-section {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* System Overview Section */
.system-overview-section {
    background: rgba(0, 0, 0, 0.25);
    /* Slightly darker, semi-transparent background */
    padding: 4rem 2rem;
    margin-top: 4rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    list-style: none;
    padding: 0;
}

.feature-grid li {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    /* Card shadow for depth */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
}

.feature-grid li:hover {
    transform: translateY(-5px) scale(1.02);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Feature Grid Icons */
.feature-grid li i {
    font-size: 1.5rem;
    margin-right: 15px;
    color: #a855f7;
    /* Purple accent */
    background: rgba(168, 85, 247, 0.1);
    padding: 12px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.feature-grid li:hover i {
    background: #a855f7;
    color: white;
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

/* Devices & Components Section */
.devices-section {
    margin-top: 5rem;
    margin-bottom: 5rem;
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.device-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.device-card:hover {
    transform: translateY(-10px);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 15px rgba(168, 85, 247, 0.2);
}

.card-img-wrapper {
    height: 200px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.card-img-wrapper img,
.card-img-wrapper .lazy-video-container {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.device-card:hover .card-img-wrapper img,
.device-card:hover .card-img-wrapper .lazy-video-container {
    transform: scale(1.1);
}

.card-content {
    padding: 25px;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #fff;
    display: flex;
    align-items: center;
}

.text-purple {
    color: #a855f7;
    filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.4));
}

.card-content ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
}

.card-content ul li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-content ul li::before {
    content: '›';
    position: absolute;
    color: #a855f7;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1.2;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grid items */
.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.delay-400 {
    transition-delay: 0.4s;
}

/* --- Responsiveness --- */
@media (max-width: 768px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .display-1 {
        font-size: 3rem;
        /* Smaller hero title */
    }

    #typewriter {
        font-size: 1.5rem;
        min-height: 2.5rem;
    }

    .mission-section h1,
    .system-overview-section h2,
    .devices-section h2 {
        font-size: 2rem;
    }

    .system-overview-section,
    .devices-section {
        padding: 2rem 1.5rem;
        margin-top: 3rem;
    }

    .card-img-wrapper {
        height: 180px;
    }
}

/* Contact Section */
.contact-section {
    position: relative;
    padding: 6rem 0;
}

.contact-form-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.form-control {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    padding: 15px 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.2) !important;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.btn-gradient {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    padding: 15px 40px;
    border-radius: 12px;
    border: none;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.5);
    color: white;
}

.contact-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.contact-info-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(10px);
}

.contact-icon-box {
    width: 50px;
    height: 50px;
    background: rgba(168, 85, 247, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: #a855f7;
    font-size: 1.2rem;
}