/* Color Palette */
:root {
    --background-dark: #0a0a0a;
    --text-light: #e0e0e0;
    --accent-blue: #00e5ff;
    --accent-green: #00ffcc;
    --accent-purple: #9b59b6;
    --border-glow: 0 0 15px var(--accent-blue);
    --text-glow: 0 0 5px var(--accent-green);
}

/* Base Styles */
body {
    background-color: var(--background-dark);
    color: var(--text-light);
    font-family: 'Roboto Mono', monospace, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}


/* Particle Background */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Main Content Container to Overlay Particles */
.main-container {
    position: relative;
    z-index: 1;
}


/* Offcanvas (Side Menu) */
.offcanvas {
    background-color: var(--background-dark) !important;
    color: white;
    font-family: sans-serif;
}

.offcanvas .btn-close {
    filter: invert(1);
}

.offcanvas-title {
    font-size: 1.5rem;
    color: var(--accent-blue);
    text-shadow: 0 0 8px var(--accent-blue);
}

.offcanvas-body ul li a {
    font-size: 1.2rem;
    color: white; !important;
    transition: color 0.3s, text-shadow 0.3s;
}

.offcanvas-body ul li a:hover {
    color: var(--accent-green) !important;
    text-shadow: 0 0 8px var(--accent-green);
}

/* Navbar */
.navbar {
    background-color: rgba(10, 10, 10, 0.8) !important;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--accent-blue);
}

.navbar-brand {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent-green) !important;
    text-shadow: 0 0 5px var(--accent-green);
}

/* Hero Image */
.hero-image {
    max-width: 550px; /* Increased image size */
    height: auto;
    border-radius: 8px;
    border: 4px solid var(--accent-blue);
    box-shadow: var(--border-glow);
    transition: transform 0.5s;
}

.hero-image:hover {
    transform: scale(1.05);
}

/* Hero Text */
.hero-text {
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1.6;
    color: #white;
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-top: 0.5rem;
    color: var(--accent-green);
    text-shadow: var(--text-glow);
}

.highlight {
    color: var(--accent-blue);
    font-weight: bold;
    font-size: 1.6rem;
    text-shadow: 0 0 8px var(--accent-blue);
}

.display-4, h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.2rem;
    font-weight: bold;
    color: var(--text-light);
    letter-spacing: 2px;
}

/* Section Title */
.section-title {
    color: var(--accent-blue);
    text-shadow: 0 0 8px var(--accent-blue);
    font-family: 'Orbitron', sans-serif;
}


/* Glitch Effect for Title */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--accent-blue);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent-purple);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% { clip-path: inset(30% 0 70% 0); }
    20% { clip-path: inset(10% 0 90% 0); }
    40% { clip-path: inset(80% 0 20% 0); }
    60% { clip-path: inset(40% 0 60% 0); }
    80% { clip-path: inset(90% 0 10% 0); }
    100% { clip-path: inset(20% 0 80% 0); }
}

@keyframes glitch-anim-2 {
    0% { clip-path: inset(60% 0 40% 0); }
    20% { clip-path: inset(90% 0 10% 0); }
    40% { clip-path: inset(10% 0 90% 0); }
    60% { clip-path: inset(70% 0 30% 0); }
    80% { clip-path: inset(30% 0 70% 0); }
    100% { clip-path: inset(50% 0 50% 0); }
}

/* Social Icons */
.social-icons a {
    color: white;
    font-size: 1.5rem;
    margin: 0 10px;
    transition: transform 0.3s, text-shadow 0.3s;
}

.social-icons a:hover {
    transform: translateY(-5px);
    text-shadow: 0 0 15px var(--accent-green);
}

.credit {
    font-size: 0.9rem;
    margin-top: 0.5rem;
    color: white;
}

/* Code Footer Animation */
.code-footer {
    background-color: rgba(10, 10, 10, 0.8);
    color: var(--accent-green);
    font-family: 'Courier New', Courier, monospace;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    overflow: hidden;
    border-top: 2px solid var(--accent-blue);
    text-shadow: var(--text-glow);
}

/* MODIFIED: The code-animation class has been updated to fix alignment issues */
.code-animation {
    display: block; /* Ensures the element takes up full width */
    max-width: 100%; /* Prevents horizontal overflow */
    white-space: pre-wrap; /* Allows text to wrap */
    word-wrap: break-word; /* Prevents long words from overflowing */
    margin: 0 auto; /* Centers the block content */
    border-right: 2px solid var(--accent-green);
    animation: typing 4s steps(40, end), blink 0.75s step-end infinite;
    padding-right: 1rem;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-green) }
}

.code-animation .keyword { color: #ff7b72; }
.code-animation .function { color: #d2a8ff; }
.code-animation .string { color: #79c0ff; }

/* Call to Action Button */
.cta-button {
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    background-color: transparent;
    color: var(--accent-blue);
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
    transition: all 0.3s ease-in-out;
    text-transform: uppercase;
}

.cta-button:hover {
    background-color: var(--accent-blue);
    color: var(--background-dark);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.8);
    transform: scale(1.1);
}

/* Responsive Styles */
@media (max-width: 768px) {
    h2.display-4 { font-size: 2rem; }
    h3 { font-size: 1.4rem; }
    .highlight { font-size: 1.2rem; }
    .hero-image { max-width: 250px; } /* Adjust for smaller screens */
    .offcanvas-body ul li { font-size: 1rem; }
}

/* Card View Styles */
.futuristic-card {
    background-color: #1a1a1a;
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
    border-radius: 1rem;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.5);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
}

.futuristic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 25px rgba(0, 255, 204, 0.8);
}


/* Styles for the preloader/loading screen overlays */
#first-overlay, #second-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#first-overlay {
    background-color: var(--accent-blue);
    transition: transform 1s ease-out;
}

#first-overlay.hidden {
    transform: translateY(-100%);
}

#second-overlay {
    background-color: rgba(10, 10, 10, 0.8);
    z-index: 9998;
    transition: transform 1s ease-out;
}

#second-overlay.hidden {
    transform: translateX(100%);
    pointer-events: none;
}

.loader {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 4px solid var(--accent-green);
    border-top-color: var(--accent-blue);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
