:root {
  /* Light theme default */
  --text-primary: #111;
  --text-secondary: #666;
  --bg-color: #fff;
  --border-color: #eaeaea;
  --sidebar-border: #f5f5f5;
  --link-color: #666;
  --link-hover: #111;
  --tag-bg: #f5f5f5;
  --btn-icon: #111;
  --highlight: #72B01D;
}

[data-theme="dark"] {
  /* Dark theme overrides */
  --text-primary: #f0f0f0;
  --text-secondary: #a0a0a0;
  --bg-color: #111;
  --border-color: #333;
  --sidebar-border: #222;
  --link-color: #a0a0a0;
  --link-hover: #fff;
  --tag-bg: #222;
  --btn-icon: #a0a0a0;
  --highlight: #72B01D;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Page Load Animation */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
}

.sidebar {
  width: 200px;
  padding: 60px 20px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: flex-start;
}

.nav-link {
  text-decoration: none;
  color: var(--link-color);
  font-size: 15px;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
  transform-origin: left;
}

.nav-link:hover, .nav-link.active {
  color: var(--highlight);
  font-weight: bold;
}

/* Micro animation for nav */
.nav-link:hover {
  transform: translateX(4px);
}

/* Theme Toggle Button (Refined) */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color); /* Thin border added back */
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--btn-icon);
  margin-top: 20px;
  margin-left: -1px; /* Slight optical adjustment */
  transition: all 0.2s ease;
  padding: 0;
}

.theme-toggle:hover {
  background: var(--tag-bg);
  color: var(--highlight);
  border-color: var(--highlight);
  transform: translateY(-2px);
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* Icon visibility */
[data-theme="dark"] .moon-icon { display: none !important; }
[data-theme="dark"] .sun-icon { display: block !important; }
:root:not([data-theme="dark"]) .sun-icon { display: none !important; }
:root:not([data-theme="dark"]) .moon-icon { display: block !important; }

.content {
  flex: 1;
  padding: 60px 40px;
  border-left: 1px solid var(--sidebar-border);
}

/* Home page styles */
.profile {
  margin-bottom: 40px;
}

.profile-img {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  margin-bottom: 20px;
  background: var(--tag-bg);
  object-fit: cover;
}

.name {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px 0;
}

.role {
  font-size: 16px;
  margin: 0 0 4px 0;
}

.tagline {
  color: var(--highlight);
  font-size: 15px;
  margin: 0;
}

.section {
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
  display: flex;
  margin-bottom: 40px;
}

.section.no-border {
  border-top: none;
  padding-top: 0;
}

.section-title {
  width: 140px;
  color: var(--highlight);
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
  margin: 0;
}

.section-content {
  flex: 1;
}

.section-content p {
  margin: 0 0 16px 0;
  font-size: 15px;
  max-width: 600px;
}

.section-content p:last-child {
  margin-bottom: 0;
}

/* Project styles */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 100%;
  width: 100%;
}

.project-card {
  display: flex;
  flex-direction: row;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg-color);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--highlight);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .project-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.project-image {
  flex: 0 0 240px;
  width: 240px;
  height: 160px;
  background-color: var(--tag-bg);
  border-radius: 8px;
  margin-right: 20px;
  margin-bottom: 0;
  object-fit: cover;
}

.project-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 6px 0;
  transition: color 0.2s ease;
}

.project-card:hover .project-title {
  color: var(--highlight);
}

.project-desc {
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  font-size: 14px;
  flex: 1;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 12px;
  color: var(--highlight);
  background: var(--tag-bg);
  padding: 3px 10px;
  border-radius: 12px;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: auto;
    padding: 20px 30px;
  }
  
  .nav-links {
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 0;
  }
  
  .nav-link {
    margin-right: 20px;
  }
  
  .theme-toggle {
    margin-top: 0;
    margin-left: auto; /* Push to the right on mobile */
    margin-right: 0;
  }
  
  .content {
    padding: 10px 30px 40px 30px;
    border-left: none;
  }
  
  .section {
    flex-direction: column;
  }
  
  .section-title {
    margin-bottom: 12px;
  }
  
  .project-card {
    flex-direction: column;
  }
  
  .project-image {
    width: 100%;
    flex: none;
    height: 180px;
    margin-right: 0;
    margin-bottom: 16px;
    object-fit: cover;
  }
}
