/* --- Global Styles & Variables --- */
:root {
    --primary-color: #00aaff;
    --secondary-color: #0077b3;
    --background-color: #0a192f;
    --text-color: #ccd6f6;
    --light-text-color: #8892b0;
    --card-bg-color: #112240;
    --border-color: #233554;
    --white-color: #ffffff;
    --font-family: 'Poppins', sans-serif;
}

/* --- Base Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

h1, h2, h3, h4 {
    color: var(--white-color);
    font-weight: 600;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.5rem; }

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 10px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
}

.section-title p {
    color: var(--light-text-color);
    font-size: 1.1rem;
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    transition: box-shadow 0.3s ease, padding 0.3s ease;
}

header.scrolled {
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    padding: 5px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--white-color);
}

.logo i {
    color: var(--primary-color);
    margin-right: 8px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin: 0 15px;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-links a.active, .nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-links a.active::after, .nav-links a:hover::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Language Switcher --- */
.language-switcher {
    position: relative;
    margin-left: 20px;
}

.language-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.language-btn:hover, .language-btn.active {
    background: var(--card-bg-color);
}

.language-options {
    display: none;
    position: absolute;
    top: 120%;
    right: 0;
    background: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    overflow: hidden;
    z-index: 10;
}

.language-options.active {
    display: block;
}

.language-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
}

.language-option i {
    margin-right: 8px;
}

.language-option:hover {
    background: var(--secondary-color);
}


/* --- Home Section --- */
#home {
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text {
    max-width: 60%;
}

.hero-text p {
    margin: 20px 0;
    color: var(--light-text-color);
    font-size: 1.1rem;
}

.hero-btns {
    display: flex;
    gap: 15px;
}

.hero-image {
    max-width: 30%;
}
.hero-image img {
    width: 100%;
    border-radius: 100%;
    border: 0px solid var(--primary-color);
    box-shadow: 0 0 30px rgba(0, 170, 255, 0.5);
}

.typing-animation {
    color: var(--primary-color);
    border-right: 2px solid var(--primary-color);
    animation: typing 3s steps(30, end) infinite, blink-caret .75s step-end infinite;
    white-space: nowrap;
    overflow: hidden;
}

/* Typing animation */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color); }
}


/* --- Robot Animation --- */
.robot-container {
    position: absolute;
    top: 20%;
    left: 5%;
    transform: scale(0.6);
}

.robot {
    position: relative;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* ... (add all robot part styles here) ... */
.robot-head {
    width: 100px; height: 80px; background: #c0c0c0; border-radius: 20px 20px 0 0; position: relative;
}
.robot-antenna {
    width: 4px; height: 30px; background: #888; position: absolute; top: -30px; left: 48px;
}
.robot-antenna::after {
    content: ''; width: 10px; height: 10px; background: var(--primary-color); border-radius: 50%; position: absolute; top: -10px; left: -3px; animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 170, 255, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 170, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 170, 255, 0); }
}
.robot-eye {
    width: 20px; height: 20px; background: var(--primary-color); border-radius: 50%; position: absolute; top: 30px;
}
.robot-eye:first-of-type { left: 20px; }
.robot-eye:last-of-type { right: 20px; }
.robot-body {
    width: 120px; height: 120px; background: #a9a9a9; position: relative; left: -10px;
}
.robot-screen {
    position: absolute; top: 20px; left: 20px; width: 80px; height: 40px; background: #000; color: #0f0; font-family: 'Courier New', monospace; text-align: center; line-height: 40px;
}
.robot-arm {
    width: 20px; height: 80px; background: #888; position: absolute; top: 10px;
}
.robot-arm.left { left: -20px; }
.robot-arm.right { right: -20px; }
.robot-leg {
    width: 30px; height: 80px; background: #888; position: absolute; top: 120px;
}
.robot-leg.left { left: 20px; }
.robot-leg.right { right: 70px; }


/* --- Snowflake Animation --- */
#snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}
.snowflake {
    position: absolute;
    color: var(--primary-color);
    animation: fall linear infinite;
}
@keyframes fall {
    to { transform: translateY(100vh); }
}


/* --- About Section --- */
.about-content {
    display: flex;
    align-items: center;
    gap: 50px;
}
.about-image {
    flex-basis: 40%;
}
.about-image img {
    width: 100%;
    border-radius: 10px;
}
.about-text {
    flex-basis: 60%;
}
.about-text p {
    margin: 15px 0;
    color: var(--light-text-color);
}

/* Skills */
.skills { margin-top: 30px; }
.skill { margin-bottom: 20px; }
.skill-info { display: flex; justify-content: space-between; margin-bottom: 5px; }
.skill-bar {
    width: 100%; height: 10px; background: var(--border-color); border-radius: 5px;
}
.skill-progress {
    height: 100%; background: var(--primary-color); border-radius: 5px; width: 0;
    transition: width 1.5s ease-in-out;
}
.skill-progress.animate {
    width: var(--skill-width);
}


/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.service-card {
    background: var(--card-bg-color);
    padding: 30px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.service-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}
.service-card p {
    color: var(--light-text-color);
}

/* --- Portfolio Section --- */
.portfolio-filters {
    text-align: center;
    margin-bottom: 40px;
}
.filter-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1rem;
    margin: 0 15px;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.3s;
}
.filter-btn.active, .filter-btn:hover {
    color: var(--primary-color);
}
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}
.portfolio-image {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    transition: transform 0.4s ease;
}
.portfolio-item:hover .portfolio-image {
    transform: scale(1.1);
}
.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 47, 0.9);
    color: var(--white-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
}
.portfolio-overlay p {
    margin: 10px 0;
}
.portfolio-overlay a {
    margin-top: 15px;
    font-weight: 600;
}

/* --- Contact Section --- */
.contact-container {
    display: flex;
    gap: 50px;
    background: var(--card-bg-color);
    padding: 40px;
    border-radius: 10px;
}
.contact-info, .contact-form {
    flex: 1;
}
.contact-info p {
    color: var(--light-text-color);
    margin: 15px 0;
}
.contact-method {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.contact-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
}
.social-links { margin-top: 30px; }
.social-links a {
    font-size: 1.5rem;
    margin-right: 20px;
}

.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
}
.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* --- Footer --- */
footer {
    background: var(--card-bg-color);
    padding: 40px 0;
    text-align: center;
}
.footer-logo { font-size: 1.8rem; font-weight: 700; color: var(--white-color); }
.footer-logo span { color: var(--primary-color); }
.footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}
.footer-links li { margin: 0 15px; }
.copyright { color: var(--light-text-color); }

/* --- Scroll Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* --- Chatbot Styles --- */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
}
.chatbot-toggle {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.4);
    animation: pulse-chat 2s infinite;
}
@keyframes pulse-chat {
    0% { transform: scale(0.95); }
    70% { transform: scale(1); }
    100% { transform: scale(0.95); }
}
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.chatbot-container.active .chatbot-window {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.chatbot-header {
    background: var(--card-bg-color);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--white-color);
}
.chatbot-header h3 { font-size: 1.1rem; }
.chatbot-close { background: none; border: none; color: var(--text-color); font-size: 1.2rem; cursor: pointer; }
.chatbot-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
}
.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    line-height: 1.4;
}
.bot-message {
    background: var(--card-bg-color);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}
.user-message {
    background: var(--primary-color);
    color: var(--white-color);
    margin-left: auto;
    border-bottom-right-radius: 2px;
}
.quick-replies { margin-top: 10px; }
.quick-reply {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    margin: 5px 5px 0 0;
    transition: background 0.2s;
}
.quick-reply:hover { background: var(--primary-color); color: var(--white-color); }

.chatbot-input {
    display: flex;
    padding: 10px;
    border-top: 1px solid var(--border-color);
}
.chatbot-input input {
    flex-grow: 1;
    background: var(--card-bg-color);
    border: none;
    padding: 10px;
    border-radius: 20px;
    color: var(--text-color);
    margin-right: 10px;
}
.chatbot-input input:focus { outline: none; }
.chatbot-input button {
    background: var(--primary-color);
    border: none;
    color: var(--white-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
}
.typing-indicator { display: flex; align-items: center; }
.typing-dot {
    width: 8px; height: 8px; background: var(--light-text-color); border-radius: 50%; margin: 0 2px; animation: bounce 1s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}


/* --- Responsive Design --- */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }
    .hero-text {
        max-width: 100%;
    }
    .hero-btns {
        justify-content: center;
    }
    .about-content {
        flex-direction: column;
    }
    .contact-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--background-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }
    .nav-links.active {
        transform: translateX(0);
    }
    .nav-links li {
        margin: 20px 0;
    }
    .menu-toggle {
        display: block;
    }
    .language-switcher {
        margin-left: 0;
    }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .robot-container {
        display: none; /* Hide complex animation on small screens */
    }
}