/* Reset & Base Styles */
:root {
    --bg-color: #0f0f0f;
    --card-bg: #1a1a1a;
    --text-color: #e0e0e0;
    --accent-color: #00A8FF;
    --accent-hover: #008ecc;
    --font-main: 'Inter', sans-serif;
    --font-header: 'Orbitron', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 15px 0;
    border-bottom: 1px solid rgba(0, 168, 255, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.logo img {
    height: 30px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-header);
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
    background: radial-gradient(circle at center, #1a1a1a 0%, #0f0f0f 100%);
    overflow: hidden;
}

#background-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
}

.hero::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 168, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 168, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
}

/* Logo Fix */
.hero-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    filter: drop-shadow(0 0 10px rgba(0, 168, 255, 0.5));
}

.hero h1 {
    font-family: var(--font-header);
    font-size: 4rem;
    margin-bottom: 10px;
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 168, 255, 0.5);
}

.hero .subtitle {
    font-size: 1.5rem;
    color: #aaa;
    margin-bottom: 30px;
}

.cta-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 5px;
    font-weight: 600;
    font-family: var(--font-header);
    box-shadow: 0 0 15px rgba(0, 168, 255, 0.4);
    transition: all 0.3s ease;
}

.cta-btn:hover {
    transform: scale(1.05);
    background-color: #00A8FF;
    box-shadow: 0 0 25px rgba(0, 168, 255, 0.6);
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 #00fff9;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    5% {
        clip: rect(80px, 9999px, 90px, 0);
    }

    10% {
        clip: rect(10px, 9999px, 40px, 0);
    }

    15% {
        clip: rect(50px, 9999px, 20px, 0);
    }

    20% {
        clip: rect(60px, 9999px, 70px, 0);
    }

    100% {
        clip: rect(70px, 9999px, 30px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(10px, 9999px, 80px, 0);
    }

    5% {
        clip: rect(30px, 9999px, 10px, 0);
    }

    10% {
        clip: rect(90px, 9999px, 20px, 0);
    }

    15% {
        clip: rect(10px, 9999px, 50px, 0);
    }

    20% {
        clip: rect(50px, 9999px, 10px, 0);
    }

    100% {
        clip: rect(20px, 9999px, 60px, 0);
    }
}

/* About Section */
.about {
    padding: 100px 0;
    background: #121212;
}

.about-container {
    display: flex;
    align-items: center;
    gap: 50px;
}

.profile-img {
    flex: 1;
    display: flex;
    justify-content: center;
}

.placeholder-img {
    width: 250px;
    height: 250px;
    background: #252525;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 20px rgba(0, 168, 255, 0.2);
}

.about-text {
    flex: 2;
}

.about-text h2 {
    font-family: var(--font-header);
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.about-text p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #ccc;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.tech-stack span {
    background: rgba(0, 168, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(0, 168, 255, 0.3);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tech-stack i {
    color: var(--accent-color);
}

/* Projects Section */
.projects {
    padding: 100px 0;
    background: #0f0f0f;
    border-top: 1px solid #252525;
}

.section-title {
    font-family: var(--font-header);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    color: #fff;
}

.project-category {
    margin-bottom: 60px;
}

.project-category h3 {
    font-family: var(--font-header);
    font-size: 1.5rem;
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid var(--accent-color);
    color: #fff;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #333;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.card-header i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.card-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.project-card p {
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: 20px;
}

.card-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.card-tags span {
    font-size: 0.8rem;
    background: #252525;
    padding: 4px 10px;
    border-radius: 4px;
    color: #ccc;
}

/* Status Colors */
.ongoing {
    border-top: 3px solid #f1c40f;
}

.planned {
    border-top: 3px solid #95a5a6;
}

.completed {
    border-top: 3px solid #2ecc71;
}

/* Contact Section */
.contact {
    padding: 100px 0;
    background: #121212;
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    margin-bottom: 30px;
    font-size: 1.2rem;
    color: #ccc;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    background: #00A8FF;
    transform: scale(1.05);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    width: 50px;
    height: 50px;
    background: #252525;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

/* Footer */
footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #333;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* To be implemented with JS for mobile menu */
    }

    .mobile-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
    }

    .tech-stack {
        justify-content: center;
    }
}

/* Matrix Canvas Overlay */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    pointer-events: auto;
    /* Allow clicking to close */
    cursor: pointer;
}

/* Infinite Tech Scroll */
.tech-scroll-container {
    background: #121212;
    padding: 40px 0;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #252525;
}

.tech-scroll-container::before,
.tech-scroll-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
}

.tech-scroll-container::before {
    left: 0;
    background: linear-gradient(to right, #121212, transparent);
}

.tech-scroll-container::after {
    right: 0;
    background: linear-gradient(to left, #121212, transparent);
}

.tech-track {
    display: flex;
    width: calc(100px * 20);
    /* 100px per item * 20 items (10 original + 10 duplicate) */
    animation: scroll 20s linear infinite;
}

.tech-item {
    width: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tech-item i {
    font-size: 3rem;
    color: #444;
    /* Dark Tech theme: grey/white */
    transition: all 0.3s ease;
    filter: grayscale(100%);
}

.tech-item:hover i {
    color: var(--accent-color);
    /* Original color on hover (using accent for consistency, or specific colors below) */
    filter: grayscale(0%);
    transform: scale(1.2);
    text-shadow: 0 0 15px rgba(0, 168, 255, 0.5);
}

/* Specific Brand Colors on Hover (Optional, overrides accent color) */
.tech-item:hover .fa-python {
    color: #3776AB;
}

.tech-item:hover .fa-js {
    color: #F7DF1E;
}

.tech-item:hover .fa-html5 {
    color: #E34F26;
}

.tech-item:hover .fa-css3-alt {
    color: #1572B6;
}

.tech-item:hover .fa-node-js {
    color: #339933;
}

.tech-item:hover .fa-react {
    color: #61DAFB;
}

.tech-item:hover .fa-git-alt {
    color: #F05032;
}

.tech-item:hover .fa-raspberry-pi {
    color: #C51A4A;
}

.tech-item:hover .fa-microchip {
    color: #00979D;
}

/* Arduino Teal */
.tech-item:hover .fa-linux {
    color: #FCC624;
}

.contact-content p {
    margin-bottom: 30px;
    font-size: 1.2rem;
    color: #ccc;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

.contact-btn:hover {
    background: #00A8FF;
    transform: scale(1.05);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links a {
    width: 50px;
    height: 50px;
    background: #252525;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

/* Footer */
footer {
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #333;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* To be implemented with JS for mobile menu */
    }

    .mobile-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .about-container {
        flex-direction: column;
        text-align: center;
    }

    .tech-stack {
        justify-content: center;
    }
}

/* Matrix Canvas Overlay */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    pointer-events: auto;
    /* Allow clicking to close */
    cursor: pointer;
}

/* Infinite Tech Scroll */
.tech-scroll-container {
    background: #121212;
    padding: 40px 0;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #252525;
}

.tech-scroll-container::before,
.tech-scroll-container::after {
    content: "";
    position: absolute;
    top: 0;
    width: 100px;
    height: 100%;
    z-index: 2;
}

.tech-scroll-container::before {
    left: 0;
    background: linear-gradient(to right, #121212, transparent);
}

.tech-scroll-container::after {
    right: 0;
    background: linear-gradient(to left, #121212, transparent);
}

.tech-track {
    display: flex;
    width: calc(100px * 20);
    /* 100px per item * 20 items (10 original + 10 duplicate) */
    animation: scroll 20s linear infinite;
}

.tech-item {
    width: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tech-item i {
    font-size: 3rem;
    color: #444;
    /* Dark Tech theme: grey/white */
    transition: all 0.3s ease;
    filter: grayscale(100%);
}

.tech-item:hover i {
    color: var(--accent-color);
    /* Original color on hover (using accent for consistency, or specific colors below) */
    filter: grayscale(0%);
    transform: scale(1.2);
    text-shadow: 0 0 15px rgba(0, 168, 255, 0.5);
}

/* Specific Brand Colors on Hover (Optional, overrides accent color) */
.tech-item:hover .fa-python {
    color: #3776AB;
}

.tech-item:hover .fa-js {
    color: #F7DF1E;
}

.tech-item:hover .fa-html5 {
    color: #E34F26;
}

.tech-item:hover .fa-css3-alt {
    color: #1572B6;
}

.tech-item:hover .fa-node-js {
    color: #339933;
}

.tech-item:hover .fa-react {
    color: #61DAFB;
}

.tech-item:hover .fa-git-alt {
    color: #F05032;
}

.tech-item:hover .fa-raspberry-pi {
    color: #C51A4A;
}

.tech-item:hover .fa-microchip {
    color: #00979D;
}

/* Arduino Teal */
.tech-item:hover .fa-linux {
    color: #FCC624;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(calc(-100px * 10));
        /* Move by half the width (10 items) */
    }
}

/* Contact Form */
#contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
    text-align: left;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 5px;
    color: #fff;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.2);
}

.form-submit-btn {
    align-self: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Success Message */
#form-success {
    text-align: center;
    padding: 40px;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid #2ecc71;
    border-radius: 10px;
    margin-bottom: 40px;
    animation: fadeIn 0.5s ease;
}

.success-content i {
    font-size: 3rem;
    color: #2ecc71;
    margin-bottom: 20px;
}

.success-content p {
    font-size: 1.2rem;
    color: #fff;
    font-family: var(--font-header);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}