/* --- General Setup & Variables --- */
:root {
    --bg-color: #111111;
    --primary-color: #1e1e1e;
    --secondary-color: #2a2a2a;
    --font-color: #e0e0e0;
    --accent-color: #00aaff;
    --accent-color-darker: #0088cc;
    --shadow-color: rgba(0, 170, 255, 0.2);
    --font-primary: 'Poppins', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Offset for fixed header */
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-color);
    color: var(--font-color);
    line-height: 1.6;
}

/* --- Reusable Components & Utilities --- */
section {
    padding: 80px 10%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.section-title .accent {
    color: var(--accent-color);
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-color-darker);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.btn-secondary {
    background-color: transparent;
    color: var(--font-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: #fff;
}

.accent { color: var(--accent-color); }

/* --- AI Animated Background --- */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -1;
    top: 0;
    left: 0;
}

/* --- Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(17, 17, 17, 0.8);
    backdrop-filter: blur(10px);
    transition: background 0.3s ease;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--font-color);
    text-decoration: none;
}

.navbar a {
    font-size: 1rem;
    color: var(--font-color);
    text-decoration: none;
    margin-left: 30px;
    transition: color 0.3s ease;
    position: relative;
}

.navbar a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

.navbar a:hover, .navbar a.active {
    color: var(--accent-color);
}

.navbar a:hover::after, .navbar a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .line {
    width: 25px;
    height: 2px;
    background-color: var(--font-color);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
}

.hero-content h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: #b0b0b0;
    margin-bottom: 30px;
}

.terminal-container {
    background: var(--primary-color);
    border: 1px solid var(--secondary-color);
    border-radius: 8px;
    text-align: left;
    font-family: var(--font-mono);
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: var(--secondary-color);
    padding: 8px 15px;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
    display: flex;
    align-items: center;
}

.terminal-header .dots {
    margin-right: 15px;
}

.dot {
    height: 12px;
    width: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.terminal-text {
    padding: 20px;
    font-size: 1.1rem;
    color: #a9ff68;
}

#typing-effect::after {
    content: '|';
    animation: blink 0.7s infinite;
}
@keyframes blink {
    50% { opacity: 0; }
}

.cta-buttons .btn {
    margin: 0 10px;
}

/* Initial state for animations */
.fade-in {
    opacity: 0;
    transition: opacity 1s ease-out, transform 0.8s ease-out;
}
.hero-content.loaded .fade-in {
    opacity: 1;
}
.hero-content.loaded .fade-in:nth-child(1) { transition-delay: 0.2s; }
.hero-content.loaded .fade-in:nth-child(2) { transition-delay: 0.4s; }
.hero-content.loaded .fade-in:nth-child(3) { transition-delay: 0.6s; }
.hero-content.loaded .fade-in:nth-child(4) { transition-delay: 0.8s; }

/* --- About Me Section --- */
.about-container {
    display: flex;
    align-items: center;
    gap: 50px;
}

.about-image {
    flex-basis: 35%;
}

.about-image img {
    width: 100%;
    border-radius: 10px;
    border: 2px solid var(--secondary-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.about-image img:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.about-text {
    flex-basis: 65%;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

/* --- Skills Section --- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-category {
    background: var(--primary-color);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--secondary-color);
    transition: transform 0.3s, border-color 0.3s;
}

.skill-category:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.skill-category h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.skill-category ul {
    list-style: none;
}

.skill-category li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.skill-category li i {
    color: var(--accent-color);
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* --- Projects Section --- */
.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.card {
    background: var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--secondary-color);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.card-content p {
    flex-grow: 1;
    margin-bottom: 20px;
    color: #b0b0b0;
}

.tech-stack span {
    background: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    margin-right: 8px;
    margin-bottom: 8px;
    display: inline-block;
}

.project-links {
    margin-top: 20px;
}

.project-links a {
    color: var(--font-color);
    text-decoration: none;
    margin-right: 20px;
    transition: color 0.3s;
}

.project-links a:hover {
    color: var(--accent-color);
}

.project-links a i {
    margin-right: 8px;
}

/* --- Resume CTA Section --- */
.resume-cta {
    text-align: center;
    background: linear-gradient(rgba(30, 30, 30, 0.95), rgba(30, 30, 30, 0.95)), url('https://source.unsplash.com/random/1600x900/?code,technology') no-repeat center center/cover;
    padding: 80px 5%;
    border-radius: 10px;
    margin: 0 10%;
}

.resume-cta h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.resume-cta p {
    margin-bottom: 30px;
    color: #c0c0c0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Contact Section --- */
.contact-subtitle {
    text-align: center;
    max-width: 600px;
    margin: -30px auto 40px;
    color: #b0b0b0;
}
.contact-container {
    display: flex;
    gap: 40px;
    background: var(--primary-color);
    padding: 40px;
    border-radius: 8px;
    border: 1px solid var(--secondary-color);
}
.contact-form {
    flex: 2;
}
.form-group {
    margin-bottom: 20px;
}
.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 15px;
    background: var(--secondary-color);
    border: 1px solid #444;
    border-radius: 5px;
    color: var(--font-color);
    font-family: var(--font-primary);
}
.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}
.contact-info {
    flex: 1;
}
.contact-info h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}
.contact-info p {
    margin-bottom: 20px;
}
.contact-info a {
    color: var(--font-color);
    text-decoration: none;
    transition: color 0.3s;
}
.contact-info a:hover {
    color: var(--accent-color);
}
.contact-info i {
    color: var(--accent-color);
    margin-right: 10px;
}
.social-links {
    margin-bottom: 25px;
}
.social-links a {
    font-size: 1.8rem;
    margin-right: 20px;
}

.hire-me-btn {
    width: 100%;
    text-align: center;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 30px 10%;
    border-top: 1px solid var(--secondary-color);
    font-size: 0.9rem;
    color: #888;
}

/* --- Scroll To Top Button --- */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--accent-color);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
    transform: translateY(10px);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Scroll Animations --- */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .about-container {
        flex-direction: column;
    }
    .contact-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 20px 5%;
    }
    section, .resume-cta {
        padding: 60px 5%;
        margin: 0 5%;
    }
    .hero-content h1 {
        font-size: 3rem;
    }
    .hero-subtitle {
        font-size: 1.2rem;
    }
    .hamburger {
        display: block;
    }
    .navbar {
        position: absolute;
        top: 80px;
        right: -100%;
        width: 100%;
        background: var(--primary-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        transition: right 0.4s ease-in-out;
    }
    .navbar.active {
        right: 0;
    }
    .navbar a {
        margin: 15px 0;
        font-size: 1.2rem;
    }
    .cta-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
}