/* CSS Variables */
:root {
    --bg-color: #ffffff;
    --text-color: #334155;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #eff6ff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-muted: #64748b;
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --secondary-color: #1e293b;
    --card-bg: #1e293b;
    --border-color: #334155;
    --text-muted: #94a3b8;
}

/* Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color); color: var(--text-color);
    line-height: 1.6; transition: all var(--transition-speed);
}
html { scroll-behavior: smooth; }
h1, h2, h3, h4 { font-weight: 700; margin-bottom: 1rem; color: var(--text-color); }
p { margin-bottom: 1rem; }
a { color: var(--primary-color); text-decoration: none; }

/* Navigation */
header {
    position: fixed; top: 0; width: 100%; background-color: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); z-index: 1000;
}
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 5%; max-width: 1200px; margin: 0 auto;
}
.logo { font-size: 1.5rem; font-weight: bold; color: var(--primary-color); }
.nav-links { display: flex; list-style: none; align-items: center; }
.nav-links li { margin-left: 2rem; }
.nav-links a { color: var(--text-color); font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary-color); }
.theme-btn { background: none; border: none; color: var(--text-color); font-size: 1.2rem; cursor: pointer; }
.theme-btn:hover { color: var(--primary-color); }

/* Sections */
.section-padding { padding: 6rem 5%; max-width: 1200px; margin: 0 auto; }
.section-title {
    text-align: center; font-size: 2.2rem; margin-bottom: 3rem; 
    color: var(--primary-color); position: relative;
}
.section-title::after {
    content: ''; display: block; width: 60px; height: 4px;
    background: var(--primary-color); margin: 10px auto 0; border-radius: 2px;
}

/* Hero Section */
.hero {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 100vh; padding: 0 5%; max-width: 1200px; margin: 0 auto; padding-top: 80px;
}
.hero-content { flex: 1; padding-right: 2rem; }
.hero-content h1 { font-size: 3.5rem; margin-bottom: 0.5rem; line-height: 1.2; }
.hero-content h2 { font-size: 1.5rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.hero-image { flex: 1; text-align: center; }
.hero-image img {
    width: 350px; height: 350px; border-radius: 50%; object-fit: cover;
    border: 8px solid var(--secondary-color); box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

/* Buttons */
.btn {
    display: inline-block; padding: 0.8rem 1.8rem; border-radius: 8px;
    font-weight: 600; transition: all 0.3s; border: 2px solid transparent;
}
.btn.primary { background-color: var(--primary-color); color: #fff; }
.btn.primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); }
.btn.secondary { background-color: transparent; border-color: var(--primary-color); color: var(--primary-color); margin-left: 1rem; }
.btn.secondary:hover { background-color: var(--secondary-color); transform: translateY(-2px); }

/* Layout Grids */
.grid-2col {
    display: grid; grid-template-columns: 1fr 1fr; gap: 3rem;
}
.about-content { max-width: 800px; margin: 0 auto; text-align: center; font-size: 1.1rem; }

/* Timeline & Cards */
.timeline-item {
    background: var(--card-bg); padding: 1.5rem; border-radius: 10px;
    border: 1px solid var(--border-color); margin-bottom: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.timeline-item h4 { margin-bottom: 0.2rem; color: var(--primary-color); }
.timeline-item .institution { font-weight: 600; margin-bottom: 0.2rem; }
.timeline-item .date { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.8rem; }

/* Skills */
.skill-category { margin-bottom: 1.5rem; }
.skill-category h4 { margin-bottom: 0.8rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tags span {
    background-color: var(--secondary-color); color: var(--primary-color);
    padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.9rem; font-weight: 600;
}

/* Projects Grid */
.project-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem;
}
.project-card {
    background-color: var(--card-bg); border-radius: 12px; overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color); transition: transform 0.3s;
}
.project-card:hover { transform: translateY(-8px); }
.project-card img { width: 100%; height: 200px; object-fit: cover; }
.project-info { padding: 1.8rem; }
.project-info h3 { font-size: 1.3rem; margin-bottom: 1rem; }
.project-info p { color: var(--text-muted); font-size: 0.95rem; }

/* Contact */
.contact-container {
    max-width: 600px; margin: 0 auto; background: var(--card-bg);
    padding: 3rem; border-radius: 15px; border: 1px solid var(--border-color);
    text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.contact-info p { margin-bottom: 1rem; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; gap: 10px;}
.contact-info i { color: var(--primary-color); font-size: 1.3rem; }

/* Footer */
footer { text-align: center; padding: 2rem; background-color: var(--secondary-color); color: var(--text-muted); }

/* Animations */
.fade-in { opacity: 0; transition: opacity 1s ease-in; }
.fade-in.appear { opacity: 1; }
.slide-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.slide-up.appear { opacity: 1; transform: translateY(0); }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { flex-direction: column-reverse; text-align: center; justify-content: center; padding-top: 120px; }
    .hero-content { padding-right: 0; margin-top: 3rem; }
    .grid-2col { grid-template-columns: 1fr; gap: 2rem; }
    .hero-buttons { display: flex; flex-direction: column; gap: 1rem; }
    .btn.secondary { margin-left: 0; }
}
