/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Exo', sans-serif;
}

/* Performance optimizations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.particles canvas {
    will-change: transform;
    transform: translateZ(0);
}

img {
    will-change: transform;
    transform: translateZ(0);
    max-width: 100%;
}

.about-card,
.service-card,
.lab-item,
.blog-item {
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

/* Prevent horizontal scroll - critical for mobile */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Orbitron', sans-serif;
}

body {
    background: #000;
    color: #fff;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    padding-top: 65px;
    /* Space for fixed glass navbar */
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><circle cx="16" cy="16" r="8" fill="none" stroke="%2300f3ff" stroke-width="2" stroke-opacity="0.8"/><path d="M16 0 L16 4 M16 28 L16 32 M0 16 L4 16 M28 16 L32 16" stroke="%2300f3ff" stroke-width="1" stroke-opacity="0.6"/></svg>') 16 16, auto;
}







/* User Box - Animated Button Style */
.user-box {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* From Uiverse.io by satyamchaudharydev - User Button */
.user-button {
    --border-right: 6px;
    --text-stroke-color: rgba(255, 255, 255, 0.6);
    --animation-color: #37FF8B;
    --fs-size: 1.5em;
    letter-spacing: 3px;
    text-decoration: none;
    font-size: var(--fs-size);
    font-family: "Orbitron", sans-serif;
    position: relative;
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1px var(--text-stroke-color);
    margin: 0;
    height: auto;
    background: transparent;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.3);
}

/* User button hover text */
.user-button .hover-text {
    position: absolute;
    box-sizing: border-box;
    content: attr(data-text);
    color: var(--animation-color);
    width: 0%;
    inset: 0;
    border-right: var(--border-right) solid var(--animation-color);
    overflow: hidden;
    transition: 0.5s;
    -webkit-text-stroke: 1px var(--animation-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User button hover effect */
.user-button:hover .hover-text {
    width: 100%;
    filter: drop-shadow(0 0 23px var(--animation-color));
}

.user-button .actual-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Logout dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #37FF8B;
    border-radius: 10px;
    padding: 10px;
    margin-top: 10px;
    min-width: 150px;
    display: none;
    box-shadow: 0 0 20px rgba(55, 255, 139, 0.3);
}

.user-dropdown.show {
    display: block;
}

.logout-btn {
    background: #ff0000;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    width: 100%;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #ff3333;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Navigation Menu - Modern Floating Glass Pill */
nav {
    /* Premium Frosted Glass Effect - Translucent */
    background: rgba(20, 20, 30, 0.7);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);

    /* Floating centered position */
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: 95%;
    z-index: 999;

    /* Pill shape - ultra compact fit */
    padding: 5px 20px;
    border-radius: 50px;

    /* Flexbox for centered links */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;

    /* Glass border & glow effect */
    border: 1px solid rgba(0, 243, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 20px rgba(0, 243, 255, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.1) inset;

    /* Smooth transitions */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle gradient overlay for depth */
nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(0, 0, 0, 0.1) 100%);
    pointer-events: none;
    z-index: -1;
}

#particles-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Nav scrolled state - enhanced glow when scrolling */
nav.scrolled {
    background: rgba(10, 10, 15, 0.92);
    border-color: rgba(0, 243, 255, 0.3);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 243, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

nav a {
    color: #ff1a1a;
    margin: 0 1px;
    font-size: 1.15em;
    padding: 6px 12px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    position: relative;
    z-index: 1;
    letter-spacing: 0.3px;
    white-space: nowrap;

    /* Glass link effect */
    background: transparent;
    border: 1px solid transparent;

    /* Smooth transitions */
    transition:
        color 0.3s ease,
        background 0.3s ease,
        border-color 0.3s ease,
        text-shadow 0.3s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

nav a:hover {
    color: #00f3ff;
    background: rgba(0, 243, 255, 0.15);
    border-color: rgba(0, 243, 255, 0.4);
    text-shadow: 0 0 12px rgba(0, 243, 255, 0.6);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 243, 255, 0.25);
}

nav a:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 10px rgba(0, 243, 255, 0.3);
}

/* Section Styles */
section {
    padding: 80px 20px;
    min-height: 100vh;
    position: relative;
    background: #000;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Particle Containers */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Enhanced Cyber Effects - Background Gradients */
html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(0, 243, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 26, 26, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 255, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: cyberAmbient 10s ease-in-out infinite alternate;
}

@keyframes cyberAmbient {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 0.3;
    }
}

/* Cyber Grid Background */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Home Section */
#home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#home h1 {
    font-size: 5em;
    color: #ff1a1a;
    text-shadow: 0 0 15px #ff1a1a;
    animation: glow 3s infinite alternate;
    transition: text-shadow 0.3s;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #ff1a1a;
    }

    to {
        text-shadow: 0 0 15px #ff1a1a;
    }
}

#circuit-pulses {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.pulse-line {
    position: absolute;
    width: 2px;
    height: 0;
    background: #00f3ff;
    animation: pulsePath 2s infinite alternate;
}

.pulse-line:nth-child(1) {
    top: 0;
    left: 0;
    transform: rotate(45deg);
    animation-delay: 0s;
}

.pulse-line:nth-child(2) {
    top: 0;
    right: 0;
    transform: rotate(-45deg);
    animation-delay: 0.5s;
}

.pulse-line:nth-child(3) {
    bottom: 0;
    left: 0;
    transform: rotate(-45deg);
    animation-delay: 1s;
}

.pulse-line:nth-child(4) {
    bottom: 0;
    right: 0;
    transform: rotate(45deg);
    animation-delay: 1.5s;
}

@keyframes pulsePath {
    0% {
        height: 0;
        opacity: 0;
    }

    50% {
        height: 50%;
        opacity: 0.5;
    }

    100% {
        height: 100%;
        opacity: 1;
    }
}

/* About Section */
#about h2 {
    transition: text-shadow 0.3s;
}

.about-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
    justify-content: center;
}

.about-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid #00f3ff;
    box-shadow: 0 0 20px #00f3ff;
    transition: transform 0.3s;
}

.about-image:hover {
    transform: scale(1.1);
}

.about-text {
    max-width: 600px;
}

.about-text p {
    transition: text-shadow 0.3s;
}

.about-cards,
.services-grid,
.lab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.about-card,
.service-card,
.lab-item {
    background: #000;
    padding: 20px;
    border-radius: 10px;
    border: 3px solid transparent;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.4s ease;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.about-card:hover,
.service-card:hover,
.lab-item:hover {
    transform: scale(1.05) rotate(1deg) translateX(0);
    box-shadow: 0 0 20px #00f3ff;
    border: 3px solid #00f3ff;
    animation: wobble 1s ease-in-out, pulseGlow 1.5s infinite alternate;
}

@keyframes wobble {
    0% {
        transform: scale(1.05) rotate(1deg) translateX(0);
    }

    25% {
        transform: scale(1.05) rotate(1deg) translateX(-5px);
    }

    50% {
        transform: scale(1.05) rotate(1deg) translateX(5px);
    }

    75% {
        transform: scale(1.05) rotate(1deg) translateX(-3px);
    }

    100% {
        transform: scale(1.05) rotate(1deg) translateX(0);
    }
}

@keyframes trackGlow {
    0% {
        box-shadow: 0 0 0 rgba(3, 169, 244, 0), 0 0 0 rgba(244, 65, 165, 0);
    }

    100% {
        box-shadow: 0 0 20px rgba(3, 169, 244, 0.8), 0 0 20px rgba(244, 65, 165, 0.8);
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 10px #00f3ff;
    }

    100% {
        box-shadow: 0 0 30px #00f3ff;
    }
}

.about-card img,
.service-card img,
.lab-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    display: block;
}

.about-card h3,
.service-card h3,
.lab-item h3 {
    transition: text-shadow 0.3s;
}

.about-card p,
.service-card p,
.lab-item p {
    transition: text-shadow 0.3s;
}

.skill-item {
    background: #222;
}

.skill-bar {
    height: 5px;
    background: #00f3ff;
    width: 0;
    transition: width 2s ease;
}

.threat-viz {
    width: 100%;
    height: 150px;
    background: #222;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.threat-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff1a1a;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.terminal {
    width: 100%;
    height: 150px;
    background: #000;
    color: #00ff00;
    font-family: 'Exo', sans-serif;
    padding: 10px;
    overflow-y: auto;
    border-radius: 5px;
}

.terminal p {
    transition: text-shadow 0.3s;
}

/* Blog Section */
#blog h2 {
    transition: text-shadow 0.3s;
}

#blog {
    position: relative;
}

#blog p {
    transition: text-shadow 0.3s;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.blog-item {
    background: #000;
    padding: 20px;
    border-radius: 10px;
    border: 3px solid transparent;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border 0.4s ease;
    height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.blog-item:hover {
    transform: scale(1.05) rotate(1deg) translateX(0);
    box-shadow: 0 0 20px #00f3ff;
    border: 3px solid #00f3ff;
    animation: wobble 1s ease-in-out, pulseGlow 1.5s infinite alternate;
}

.blog-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    display: block;
}

.blog-item h3 {
    transition: text-shadow 0.3s;
}

.blog-item p {
    transition: text-shadow 0.3s;
}

/* Contact Form */
#contact h2 {
    color: #fff;
    transition: text-shadow 0.3s;
}

#contact {
    position: relative;
}

.contact-form {
    max-width: 300px;
    margin: 40px auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-control {
    position: relative;
    margin: 0;
    width: 100%;
}

.form-control input,
.form-control textarea {
    background-color: transparent;
    border: 0;
    border-bottom: 2px #fff solid;
    display: block;
    width: 100%;
    padding: 15px 0;
    font-size: 18px;
    color: #fff;
    font-family: 'Exo', sans-serif;
    transition: text-shadow 0.3s;
}

.form-control input:focus,
.form-control input:valid,
.form-control textarea:focus,
.form-control textarea:valid {
    outline: 0;
    border-bottom-color: #00f3ff;
}

.form-control label {
    position: absolute;
    top: 15px;
    left: 0;
    pointer-events: none;
}

.form-control label span {
    display: inline-block;
    font-size: 18px;
    min-width: 5px;
    color: #fff;
    transition: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55), text-shadow 0.3s;
}

.form-control input:focus+label span,
.form-control input:valid+label span,
.form-control textarea:focus+label span,
.form-control textarea:valid+label span {
    color: #00f3ff;
    transform: translateY(-30px);
}

.form-control button {
    font-size: 1.4em;
    padding: 0.6em 0.8em;
    border-radius: 0.5em;
    border: none;
    background-color: #000;
    color: #fff;
    cursor: pointer;
    box-shadow: 2px 2px 3px #000000b4;
    transition: all 0.4s ease, text-shadow 0.3s;
    font-family: 'Orbitron', sans-serif;
    width: 100%;
}

.form-control .container {
    position: relative;
    padding: 3px;
    background: linear-gradient(90deg, #03a9f4, #f441a5);
    border-radius: 0.9em;
    transition: all 0.4s ease;
}

.form-control .container::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    border-radius: 0.9em;
    z-index: -10;
    filter: blur(0);
    transition: filter 0.4s ease;
}

.form-control .container:hover::before {
    background: linear-gradient(90deg, #03a9f4, #f441a5);
    filter: blur(1.2em);
}

.form-control .container:active::before {
    filter: blur(0.2em);
}

/* WhatsApp Section Styling */
.whatsapp-section {
    margin-top: 2rem;
    text-align: center;
}

.whatsapp-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.whatsapp-icon {
    width: 40px;
    height: 40px;
    transition: transform 0.3s ease;
}

.whatsapp-icon:hover {
    transform: scale(1.1) rotate(5deg);
}

/* WhatsApp Button Styling with Animated Border */
.whatsapp-button {
    --border-radius: 15px;
    --border-width: 4px;
    appearance: none;
    position: relative;
    padding: 1em 2em;
    border: 0;
    background-color: transparent;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4em;
    font-weight: 500;
    color: #fff !important;
    z-index: 2;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    border-radius: var(--border-radius);
    transition: all 0.4s ease;
    box-sizing: border-box;
    min-width: 250px;
}

.whatsapp-button::after {
    --m-i: linear-gradient(#000, #000);
    --m-o: content-box, padding-box;
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    padding: var(--border-width);
    border-radius: var(--border-radius);
    background-image: conic-gradient(#488cfb,
            #29dbbc,
            #ddf505,
            #ff9f0e,
            #e440bb,
            #655adc,
            #488cfb);
    -webkit-mask-image: var(--m-i), var(--m-i);
    mask-image: var(--m-i), var(--m-i);
    -webkit-mask-origin: var(--m-o);
    mask-origin: var(--m-o);
    -webkit-mask-clip: var(--m-o);
    mask-composite: exclude;
    -webkit-mask-composite: destination-out;
    filter: hue-rotate(0);
    animation: rotate-hue linear 500ms infinite;
    animation-play-state: paused;
    box-sizing: border-box;
}

.whatsapp-button:hover::after {
    animation-play-state: running;
}

.whatsapp-button:active {
    --border-width: 5px;
}

.whatsapp-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

@keyframes rotate-hue {
    to {
        filter: hue-rotate(1turn);
    }
}

/* Responsive WhatsApp Section */
@media (max-width: 768px) {
    .whatsapp-container {
        flex-direction: column;
        gap: 1rem;
    }

    .whatsapp-button {
        min-width: 200px;
        font-size: 1.2em;
    }

    .whatsapp-icon {
        width: 35px;
        height: 35px;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #000;
}

footer p {
    color: #00f3ff;
    text-shadow: 0 0 5px #00f3ff;
    transition: text-shadow 0.3s ease;
    font-weight: bold;
}

footer p:hover {
    text-shadow: 0 0 10px #00f3ff;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
        /* Space for full-width nav */
    }

    nav {
        /* Full width bar on mobile */
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;

        /* Rounded bottom corners only */
        border-radius: 0 0 25px 25px;
        padding: 12px 15px;
        gap: 4px;
        flex-wrap: wrap;
    }

    nav::before {
        border-radius: 0 0 25px 25px;
    }

    nav a {
        margin: 2px;
        font-size: 0.9em;
        padding: 7px 12px;
        border-radius: 20px;
    }

    #home h1 {
        font-size: 3em;
    }

    .about-cards,
    .services-grid,
    .lab-grid {
        grid-template-columns: 1fr;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .contact-form {
        max-width: 90%;
        padding: 0 10px;
    }

    .hacker-loader {
        width: 80vw;
        height: 20vh;
        max-width: 24em;
        max-height: 6em;
    }

    .about-image {
        width: 150px;
        height: 150px;
    }

    .about-card,
    .service-card,
    .lab-item {
        height: auto;
        min-height: 300px;
    }
}

/* Glow Effect Class */
.glow-text {
    text-shadow: 0 0 10px #00f3ff, 0 0 20px #00f3ff, 0 0 30px #00f3ff;
}