/* ===========================
   CSS Variables & Reset
   =========================== */
:root {
    --primary-color: #2196F3;
    --secondary-color: #4CAF50;
    --accent-color: #FF5722;
    --text-dark: #212121;
    --text-light: #757575;
    --bg-light: #FAFAFA;
    --bg-white: #FFFFFF;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #42A5F5;
    --secondary-color: #66BB6A;
    --accent-color: #FF7043;
    --text-dark: #E0E0E0;
    --text-light: #B0B0B0;
    --bg-light: #1E1E1E;
    --bg-white: #121212;
    --shadow: 0 2px 10px rgba(0,0,0,0.5);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
    background: var(--bg-white);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

/* ===========================
   Navigation
   =========================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 20px;
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.btn-download {
    background: var(--primary-color);
    color: white !important;
    padding: 0.6rem 1.5rem !important;
    border-radius: 25px;
}

.btn-download::after {
    display: none;
}

.btn-download:hover {
    background: #1976D2;
    transform: translateY(-2px);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-light);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(180deg) scale(1.1);
}

[data-theme="dark"] .theme-toggle i::before {
    content: "\f185"; /* sun icon */
}

/* ===========================
   Hero Section
   =========================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    padding-top: 80px;
    position: relative;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-text {
    animation: fadeInUp 1s ease;
}

.greeting {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.wave {
    display: inline-block;
    animation: wave 2s infinite;
}

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    75% { transform: rotate(-20deg); }
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.name-animation {
    display: inline-block;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.typing-container {
    height: 60px;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.8rem;
    color: var(--text-light);
    font-weight: 400;
}

.cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    padding: 0.8rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px) scale(1.05);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.social-links a:hover {
    transform: translateY(-5px);
    background: var(--primary-color);
    color: white;
}

.hero-image {
    display: flex;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.profile-svg {
    max-width: 400px;
    width: 100%;
    height: auto;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.pulse-animation {
    animation: pulse 2s infinite;
}

.pulse-animation-delay {
    animation: pulse 2s infinite 0.5s;
}

@keyframes pulse {
    0%, 100% { opacity: 0.1; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.05); }
}

.float-animation {
    animation: floatSlow 3s ease-in-out infinite;
}

.float-animation-delay {
    animation: floatSlow 3s ease-in-out infinite 1s;
}

.float-animation-delay-2 {
    animation: floatSlow 3s ease-in-out infinite 2s;
}

@keyframes floatSlow {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(10px, -10px); }
}

.float-slow {
    animation: floatSmall 4s ease-in-out infinite;
}

.float-slow-delay {
    animation: floatSmall 4s ease-in-out infinite 2s;
}

@keyframes floatSmall {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.scroll-indicator span {
    width: 3px;
    height: 15px;
    background: var(--primary-color);
    border-radius: 2px;
    animation: scrollBounce 1.5s infinite;
}

.scroll-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.scroll-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes scrollBounce {
    0%, 100% { opacity: 0.3; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(10px); }
}

/* Fade in animations */
.fade-in {
    animation: fadeIn 1s ease;
}

.fade-in-delay {
    animation: fadeIn 1s ease 0.3s backwards;
}

.fade-in-delay-2 {
    animation: fadeIn 1s ease 0.6s backwards;
}

.fade-in-delay-3 {
    animation: fadeIn 1s ease 0.9s backwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===========================
   Section Titles
   =========================== */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* ===========================
   About Section
   =========================== */
.about {
    background: var(--bg-white);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.about-image svg {
    max-width: 400px;
    width: 100%;
    height: auto;
}

.about-text {
    font-size: 1.1rem;
}

.lead {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.education-highlight {
    background: #E3F2FD;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 2rem 0;
}

.education-highlight h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.education-highlight ul {
    list-style: none;
    padding-left: 0;
}

.education-highlight li {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.education-highlight li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

.highlights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.highlight-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 10px;
    transition: var(--transition);
}

.highlight-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.highlight-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* ===========================
   Projects Section
   =========================== */
.projects {
    background: var(--bg-light);
}

.projects-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border: 2px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 1;
    animation: fadeInUp 0.5s ease;
    position: relative;
    transform-style: preserve-3d;
}

.project-card.hidden {
    display: none;
}

.project-card:hover {
    transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
                var(--primary-color) 0%, 
                var(--secondary-color) 100%);
    opacity: 0;
    border-radius: 15px;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.project-card:hover::before {
    opacity: 0.05;
}

.project-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
}

.project-icon svg {
    width: 100%;
    height: 100%;
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.project-tech {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    flex: 1;
    text-align: center;
    padding: 0.6rem 1rem;
    background: var(--bg-light);
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.project-link:hover {
    background: var(--primary-color);
    color: white;
}

/* ===========================
   Skills Section
   =========================== */
.skills {
    background: white;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: var(--transition);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
}

.skill-category h3 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.skill-tag {
    padding: 0.5rem 1rem;
    background: var(--bg-white);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-dark);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    cursor: pointer;
}

.skill-tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px) scale(1.1);
}

.skill-tag:active {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-10px) scale(1.1); }
    50% { transform: translateY(-5px) scale(1.05); }
    75% { transform: translateY(-7px) scale(1.08); }
}

/* ===========================
   Contact Section
   =========================== */
.contact {
    background: var(--bg-light);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-illustration svg {
    max-width: 300px;
    width: 100%;
    margin: 0 auto 2rem;
    display: block;
}

.contact-description {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.contact-method i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 40px;
    text-align: center;
}

.contact-method h4 {
    margin-bottom: 0.3rem;
    color: var(--text-dark);
}

.contact-method a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-method p {
    color: var(--text-light);
    margin: 0;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-white);
    color: var(--text-dark);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.1);
    transform: translateY(-2px);
}

.form-group input:focus + label,
.form-group textarea:focus + label {
    color: var(--primary-color);
}

/* Animated label on focus */
.form-group {
    position: relative;
}

.form-group label {
    transition: all 0.3s ease;
    transform-origin: left center;
}

.contact-form button {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

/* ===========================
   Chat Widget Styles
   =========================== */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    transition: var(--transition);
    z-index: 1001;
    animation: pulse 2s infinite;
}

.chat-toggle:hover {
    background: #1976D2;
    transform: scale(1.1);
}

.chat-modal {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: var(--shadow-hover);
    display: none;
    flex-direction: column;
    z-index: 1002;
    transition: var(--transition);
    overflow: hidden;
}

.chat-modal.active {
    display: flex;
}

.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    max-width: 80%;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    background: var(--bg-light);
    color: var(--text-dark);
}

.message.user .message-content {
    background: var(--primary-color);
    color: white;
}

.message.bot .message-content {
    background: var(--bg-white);
    border: 1px solid var(--bg-light);
}

.message-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
}

.message.user .message-avatar {
    background: var(--secondary-color);
}

.chat-input-form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--bg-light);
    gap: 0.5rem;
}

#chatInput {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #E0E0E0;
    border-radius: 25px;
    outline: none;
    transition: border-color 0.3s ease;
}

#chatInput:focus {
    border-color: var(--primary-color);
}

.chat-input-form button {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
}

.chat-input-form button:hover {
    background: #1976D2;
}

/* ===========================
   Footer
   =========================== */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 1rem;
}

.footer-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
}

.footer-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* ===========================
   Back to Top Button
   =========================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #1976D2;
    transform: translateY(-3px);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 992px) {
    .hero-content,
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-image {
        order: -1;
    }
    
    .highlights {
        grid-template-columns: 1fr;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        flex-direction: column;
        background: white;
        padding: 2rem;
        box-shadow: var(--shadow);
        transition: var(--transition);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .chat-modal {
        width: 90vw;
        height: 70vh;
        right: 5vw;
        bottom: 5vh;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .profile-svg {
        max-width: 300px;
    }
}