:root {
    --bg-main: #0a0a0a;
    --bg-card: rgba(30, 30, 30, 0.6);
    --text-main: #ffffff;
    --text-muted: #a8b2d1;
    --accent: #64ffda;
    --glow-color: rgba(100, 255, 218, 0.15);
    --nav-bg: rgba(10, 10, 10, 0.8);
    --border-color: rgba(100, 255, 218, 0.1);
    --img-glow: rgba(100, 255, 218, 0.4);
    --chat-bg: #1e1e1e;
    --chat-user: rgba(100, 255, 218, 0.2);
    --chat-bot: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] {
    --bg-main: #f0f2f5;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #121212;
    --text-muted: #444444;
    --accent: #00796b;
    --glow-color: rgba(0, 121, 107, 0.2);
    --nav-bg: rgba(240, 242, 245, 0.9);
    --border-color: rgba(0, 121, 107, 0.2);
    --img-glow: rgba(0, 121, 107, 0.4);
    --chat-bg: #ffffff;
    --chat-user: rgba(0, 121, 107, 0.1);
    --chat-bot: #f0f2f5;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
}

#particles-bg {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(255,255,255,0.02) 0%, transparent 1%),
        radial-gradient(circle at 85% 30%, rgba(255,255,255,0.03) 0%, transparent 1%);
    background-size: 100px 100px;
    z-index: -2;
    pointer-events: none;
}

.highlight { color: var(--accent); transition: color 0.4s; }

.navbar {
    position: fixed; top: 0; width: 100%; padding: 20px 50px;
    display: flex; justify-content: space-between; align-items: center;
    transition: 0.3s ease; z-index: 1000; background: transparent;
}

.navbar.scrolled {
    background: var(--nav-bg); backdrop-filter: blur(15px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1); padding: 15px 50px;
}

.nav-controls { display: flex; gap: 15px; }
.icon-btn {
    background: var(--bg-card); border: 1px solid var(--border-color);
    color: var(--text-main); width: 40px; height: 40px;
    border-radius: 50%; cursor: pointer; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.icon-btn:hover { background: var(--accent); color: #fff; transform: scale(1.1); }
.nav-links { display: flex; list-style: none; gap: 30px; }
.nav-links a { text-decoration: none; color: var(--text-main); font-weight: 500; transition: 0.3s; }
.nav-links a:hover { color: var(--accent); }

.glow-effect { position: relative; }
.glow-effect::before {
    content: ''; position: absolute; top: -5px; left: -5px; right: -5px; bottom: -5px;
    background: var(--glow-color); filter: blur(25px);
    border-radius: inherit; z-index: -1; transition: all 0.4s ease;
}
.glow-effect:hover::before { filter: blur(35px); background: var(--accent); opacity: 0.3; }

.hero {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: space-between; padding: 0 10%; position: relative;
}
.hero-content { max-width: 600px; z-index: 2; }
.subtitle { color: var(--text-muted); font-weight: 400; margin-bottom: 10px; font-size: 1.2rem; }
.title { font-size: 4.5rem; font-weight: 800; margin-bottom: 20px; color: var(--text-main); }
.description { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 30px; }

.btn-group { display: flex; gap: 20px; }
.btn {
    padding: 12px 30px; border-radius: 30px; font-weight: 600;
    text-decoration: none; transition: all 0.3s ease; font-size: 1rem; cursor: pointer;
}
.btn-outline { border: 2px solid var(--accent); color: var(--accent); background: transparent; }
.btn-outline:hover { background: var(--glow-color); }
.btn-filled { background: var(--accent); color: #fff; border: 2px solid var(--accent); }
.btn-filled:hover { background: transparent; color: var(--accent); }

.hero-image-wrapper {
    width: 400px; height: 400px; border-radius: 30px;
    border: 2px solid var(--border-color); z-index: 2;
}
.profile-img {
    width: 100%; height: 100%; object-fit: cover;
    border-radius: 30px; filter: grayscale(50%); transition: 0.5s ease;
}
.hero-image-wrapper:hover .profile-img { filter: grayscale(0%); transform: scale(1.02); }

.section-title { text-align: center; font-size: 2.5rem; font-weight: 800; margin-bottom: 40px; }
.about, .skills, .projects, .contact { padding: 100px 10%; }

.about-container {
    background: var(--bg-card); backdrop-filter: blur(10px);
    padding: 40px; border-radius: 20px; border: 1px solid var(--border-color);
}
.about-details h3 { font-size: 2rem; color: var(--accent); margin-bottom: 15px; }
.about-details p { color: var(--text-muted); margin-bottom: 25px; }
.info-list { list-style: none; margin-bottom: 30px; }
.info-list li { margin-bottom: 10px; font-size: 1.1rem; }
.info-list i { color: var(--accent); width: 25px; }

.stats-grid { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-box {
    background: rgba(0, 0, 0, 0.1); padding: 20px; border-radius: 10px;
    text-align: center; flex: 1; min-width: 120px; border: 1px solid var(--border-color); transition: 0.3s;
}
.stat-box:hover { transform: translateY(-5px); border-color: var(--accent); }
.stat-box h4 { font-size: 2rem; color: var(--accent); }

.skills-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; }
.skill-card {
    background: var(--bg-card); padding: 30px; border-radius: 15px; width: 180px;
    text-align: center; border: 1px solid var(--border-color); transition: all 0.3s;
}
.skill-card:hover { transform: translateY(-10px); border-color: var(--accent); }
.skill-card i { font-size: 3.5rem; color: var(--accent); margin-bottom: 15px; }
.progress-bar { width: 100%; height: 6px; background: rgba(128, 128, 128, 0.2); border-radius: 5px; overflow: hidden; }
.progress { height: 100%; background: var(--accent); border-radius: 5px; }

.carousel-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.carousel-track-wrapper {
    overflow: hidden;
    width: 100%;
    border-radius: 20px;
}

.carousel-track {
    display: flex;
    transition: transform 0.6s ease-in-out;
}

.project-slide {
    min-width: 100%;
    padding: 20px;
}

.carousel-btn {
    background: var(--bg-card); border: 1px solid var(--accent); color: var(--text-main);
    width: 50px; height: 50px; border-radius: 50%; cursor: pointer;
    position: absolute; z-index: 10; font-size: 1.5rem; display: flex;
    align-items: center; justify-content: center; transition: 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.carousel-btn:hover { background: var(--accent); color: #fff; transform: scale(1.1); }
.prev-btn { left: -60px; }
.next-btn { right: -60px; }

.project-card {
    background: var(--bg-card); border-radius: 20px; border: 1px solid var(--border-color);
    position: relative; width: 100%;
}

.project-img { position: relative; width: 100%; height: 350px; border-radius: 20px 20px 0 0; }
.project-img::after {
    content: ''; position: absolute; bottom: -15px; left: 10%; width: 80%; height: 30px;
    background: var(--img-glow); filter: blur(20px); z-index: -1; transition: all 0.4s ease; opacity: 0.5;
}
.project-card:hover .project-img::after { background: var(--accent); opacity: 0.8; filter: blur(25px); }

.project-img img, .placeholder-img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 20px 20px 0 0;
}
.placeholder-img {
    background: #222; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: #555; font-weight: bold;
}
.overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.4s ease; backdrop-filter: blur(3px); border-radius: 20px 20px 0 0;
}
.project-card:hover .overlay { opacity: 1; }
.live-btn {
    background: var(--accent); color: #fff; padding: 12px 25px; border-radius: 30px;
    font-weight: bold; text-decoration: none; transform: translateY(20px); transition: 0.4s ease;
}
.project-card:hover .live-btn { transform: translateY(0); }

.project-info { padding: 30px; background: var(--bg-card); border-radius: 0 0 20px 20px; }
.project-info h3 { font-size: 1.8rem; margin-bottom: 10px; }
.project-info p { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 20px; }
.tech-stack { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-stack span {
    background: var(--glow-color); padding: 8px 18px; border-radius: 20px;
    font-size: 0.9rem; color: var(--accent); font-weight: bold;
}

.contact-container {
    display: flex; gap: 50px; background: var(--bg-card); padding: 40px;
    border-radius: 20px; border: 1px solid var(--border-color);
}
.contact-info { flex: 1; }
.info-item { display: flex; align-items: center; margin-bottom: 25px; }
.info-item i {
    font-size: 1.5rem; color: var(--accent); background: var(--glow-color);
    width: 50px; height: 50px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; margin-right: 20px; margin-left: 10px;
}
.info-item a { color: var(--text-muted); text-decoration: none; transition: 0.3s; }
.info-item a:hover { color: var(--accent); }
.contact-form { flex: 1.5; }
.input-group { margin-bottom: 20px; }
.input-group input {
    width: 100%; padding: 15px; background: rgba(128, 128, 128, 0.1);
    border: 1px solid var(--border-color); border-radius: 10px; color: var(--text-main); transition: 0.3s;
}
.input-group input:focus { outline: none; border-color: var(--accent); background: rgba(128, 128, 128, 0.2); }
.submit-btn {
    background: var(--accent); color: #fff; border: none; padding: 15px 30px;
    border-radius: 10px; font-weight: bold; font-size: 1.1rem; cursor: pointer; width: 100%; transition: 0.3s;
}
.submit-btn:hover { background: #00bfa5; }

.scroll-top {
    position: fixed; bottom: 30px; right: 30px; background: var(--accent); color: #fff;
    width: 50px; height: 50px; border-radius: 50%; border: none; font-size: 1.5rem;
    cursor: pointer; opacity: 0; visibility: hidden; transition: 0.3s; z-index: 100;
}
.scroll-top.show { opacity: 1; visibility: visible; }
.scroll-top:hover { transform: translateY(-5px); box-shadow: 0 5px 15px var(--glow-color); }

.ai-chat-wrapper { position: fixed; bottom: 30px; left: 30px; z-index: 1000; }
.ai-chat-btn {
    background: var(--bg-card); color: var(--accent); border: 2px solid var(--accent);
    width: 60px; height: 60px; border-radius: 50%; font-size: 1.8rem; cursor: pointer;
    box-shadow: 0 0 20px var(--glow-color); transition: all 0.3s ease; display: flex; align-items: center; justify-content: center;
}
.ai-chat-btn:hover { background: var(--accent); color: #fff; transform: scale(1.1); }

.ai-chat-window {
    position: absolute; bottom: 80px; left: 0; width: 350px; height: 450px;
    background: var(--chat-bg); border: 1px solid var(--border-color); border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: flex; flex-direction: column;
    opacity: 0; visibility: hidden; transform: translateY(20px); transition: all 0.3s ease;
    overflow: hidden;
}
.ai-chat-window.active { opacity: 1; visibility: visible; transform: translateY(0); }

.chat-header {
    background: var(--glow-color); padding: 15px 20px; display: flex;
    justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color);
}
.chat-header h3 { font-size: 1.1rem; color: var(--accent); }
.chat-header button { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; transition: 0.3s; }
.chat-header button:hover { color: #ff6b6b; }

.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.message { max-width: 85%; padding: 10px 15px; border-radius: 15px; font-size: 0.95rem; }
.message.bot { background: var(--chat-bot); align-self: flex-start; border-bottom-left-radius: 5px; color: var(--text-main); }
.message.user { background: var(--chat-user); align-self: flex-end; border-bottom-right-radius: 5px; color: var(--text-main); border: 1px solid var(--accent); }

.chat-controls { padding: 0 20px 10px; display: flex; justify-content: center; }
.dev-btn {
    background: transparent; border: 1px solid var(--accent); color: var(--accent);
    padding: 5px 15px; border-radius: 15px; font-size: 0.8rem; cursor: pointer; transition: 0.3s;
}
.dev-btn:hover { background: var(--accent); color: var(--bg-main); }

.chat-input-area {
    padding: 15px; border-top: 1px solid var(--border-color); display: flex; gap: 10px; background: var(--bg-card);
}
.chat-input-area input {
    flex: 1; background: transparent; border: 1px solid var(--border-color); padding: 10px 15px;
    border-radius: 20px; color: var(--text-main); outline: none; transition: 0.3s;
}
.chat-input-area input:focus { border-color: var(--accent); }
.chat-input-area button {
    background: var(--accent); color: #fff; border: none; width: 40px; height: 40px;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s;
}
.chat-input-area button:hover { transform: scale(1.1); }

@media screen and (max-width: 1024px) {
    .navbar { flex-direction: column; gap: 15px; padding: 15px; }
    .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
    .hero { flex-direction: column-reverse; text-align: center; gap: 50px; padding-top: 150px; justify-content: center;}
    .hero-image-wrapper { width: 300px; height: 300px; }
    .btn-group { justify-content: center; }
    .about-container, .contact-container { flex-direction: column; }
    .title { font-size: 3rem; }
    .ai-chat-wrapper { bottom: 20px; left: 20px; z-index: 1001; }
    .ai-chat-window { width: calc(100vw - 40px); height: 60vh; max-height: 500px; }
    .scroll-top { bottom: 20px; right: 20px; }
    .prev-btn { left: -10px; }
    .next-btn { right: -10px; }
}