* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- THEME VARIABLES --- */
:root {
  /* Default Dark Mode */
  --bg-color: #0a0a0a;
  --secondary-bg: #111;
  --border-color: #222;
  --text-color: #fff;
  --secondary-text: #aaa;
  --highlight-color: #667eea;
  /* Button Gradient (Standard) */
  --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  /* Text Gradient (Brighter for Dark Mode visibility) */
  --text-gradient: linear-gradient(135deg, #84a9ff 0%, #9c82e6 100%);
  --card-hover-shadow: rgba(118, 75, 162, 0.5);
  --button-text: #fff;
}

/* Light Mode Overrides */
[data-theme="light"] {
  --bg-color: #f8f9fa;
  --secondary-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-color: #2d3748;
  --secondary-text: #4a5568;
  --highlight-color: #4f46e5;
  /* In Light Mode, Text matches Button exactly */
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --text-gradient: var(--accent-gradient);
  --card-hover-shadow: rgba(79, 70, 229, 0.2);
  --button-text: #fff;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background-color: var(--secondary-bg);
  padding: 20px 0;
  border-right: 1px solid var(--border-color);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease-in-out, background-color 0.3s ease, border-color 0.3s ease;
}

.profile,
.nav-item:not(#theme-toggle) {
  width: 90%;
}

.profile {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.profile-info {
  flex: 1;
  margin-left: 15px;
}

.profile-info h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-info p {
  font-size: 0.85rem;
  color: var(--secondary-text);
}

.profile-info .certified-tag {
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 0.6rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 15px 16px;
  margin-bottom: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
  width: 90%;
  color: var(--secondary-text);
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
  color: var(--text-color);
}

[data-theme="light"] .nav-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  border-left: 3px solid var(--highlight-color);
}

[data-theme="light"] .nav-item.active {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-item .icon {
  margin-right: 15px;
  font-size: 1.1rem;
  min-width: 20px;
  text-align: center;
}

/* --- THEME TOGGLE BUTTON STYLES --- */
#theme-toggle {
  margin-top: auto;
  /* Push to bottom */
  margin-bottom: 20px;
  /* Space from bottom edge */
  width: 80%;
  /* Slightly narrower than full width for button look */
  background: var(--accent-gradient);
  /* Gradient background */
  color: #fff !important;
  /* Force white text */
  border: none;
  border-radius: 8px;
  /* Rounded corners */
  justify-content: center;
  /* Center text */
  padding: 8px 16px;
  align-self: center;
  /* Center in sidebar */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-weight: 600;
}

#theme-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  background: var(--accent-gradient);
  color: #fff;
}

#theme-toggle .icon {
  color: #fff !important;
  margin-right: 8px;
  font-size: 0.9rem;
}

[data-theme="light"] #theme-toggle:hover {
  background: var(--accent-gradient);
  color: #fff;
}

/* --- SIDEBAR FOOTER (CTRL + K Hint) --- */
.sidebar-footer {
  padding-bottom: 15px;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--secondary-text);
}

.sidebar-footer kbd {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: "Consolas", monospace;
  font-size: 0.75rem;
  box-shadow: 0 2px 0 var(--border-color);
  margin: 0 2px;
  color: var(--text-color);
}

.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 40px 60px;
  transition: margin-left 0.3s ease;
}

.section {
  display: none;
  animation: fadeIn 0.8s ease-in-out;
  scroll-margin-top: 80px;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(20px);
  }

  100% {
    transform: translateY(0);
  }
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 60px;
  gap: 40px;
  flex-wrap: wrap-reverse;
}

.hero-text {
  flex: 1;
  min-width: 300px;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero h1 .intro-line {
  font-size: 3rem;
}

.hero h1 .title-line {
  font-size: 2.2rem;
  display: inline-block;
  margin-top: 0.3rem;

}

/* UPDATED: Uses --text-gradient for brightness control */
.hero .highlight {
  background: var(--text-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1rem;
  color: var(--secondary-text);
  line-height: 1.8;
  max-width: 600px;
  margin-bottom: 2rem;
  text-align: left;
}

.hero-buttons {
  display: flex;
  gap: 15px;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn i {
  margin-right: 8px;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--highlight-color);
  color: var(--highlight-color);
}

.btn-primary:hover {
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.btn-secondary:hover {
  background-color: var(--highlight-color);
  color: #fff;
  transform: translateY(-2px);
}

.hero-image {
  width: 350px;
  height: 350px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--secondary-bg);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
  animation: float 4s ease-in-out infinite;
}

.skills-section {
  margin-top: 60px;
}

.skills-section h3 {
  font-size: 1.5rem;
  margin-bottom: 30px;
  color: var(--text-color);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.skill-card {
  background-color: var(--secondary-bg);
  padding: 20px;
  border-radius: 12px;
  border: 2px solid transparent;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  z-index: 0;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.skill-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  padding: 2px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.skill-card:hover::before {
  opacity: 1;
}

.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 25px var(--card-hover-shadow);
}

.skill-card .icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
}

[data-theme="dark"] .skill-card .icon i,
[data-theme="dark"] .skill-card .icon img {
  filter: brightness(0) invert(1);
}

[data-theme="light"] .skill-card .icon i,
[data-theme="light"] .skill-card .icon img {
  filter: brightness(0);
  color: #000;
}

.skill-card:hover .icon {
  transform: scale(1.1);
}

.skill-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 20px;
}

.skill-modal.active {
  display: flex;
  animation: simpleFade 0.3s ease;
}

.modal-content {
  background-color: var(--secondary-bg);
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  position: relative;
  border: none;
  overflow: hidden;
  z-index: 0;
  box-shadow: 0 0 25px var(--card-hover-shadow);
  animation: simpleFade 0.3s ease;
  color: var(--text-color);
}

.modal-content h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.modal-content p {
  color: var(--secondary-text);
  font-size: 0.95rem;
  line-height: 1.6;
}

.close-modal {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.3rem;
  color: var(--secondary-text);
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-modal:hover {
  color: var(--highlight-color);
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes simpleFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.projects-grid,
.certificates-grid,
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.project-card.hidden,
.certificate-card.hidden,
.blog-card.hidden {
  display: none;
}

.project-card,
.certificate-card,
.blog-card {
  background-color: var(--secondary-bg);
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: all 0.4s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.project-card {
  cursor: default;
}

.project-card:hover,
.certificate-card:hover,
.blog-card:hover {
  transform: translateY(-8px);
  border-color: var(--highlight-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.project-image {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-color: #000;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card>a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-card>a:hover .project-image img {
  transform: scale(1.05);
}

.project-content {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project-description {
  font-size: 0.875rem;
  color: var(--secondary-text);
  line-height: 1.6;
  margin-bottom: 15px;
  flex-grow: 1;
}

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

.tech-tag {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  color: var(--secondary-text);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.project-buttons {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
  flex-grow: 1;
  justify-content: center;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.blog-card {
  background-color: var(--secondary-bg);
  border-radius: 12px;
  padding: 25px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card:hover {
  transform: translateY(-5px);
  border-color: var(--highlight-color);
}

.blog-date {
  color: var(--highlight-color);
  font-size: 0.75rem;
  margin-bottom: 10px;
}

.blog-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.3;
}

.blog-excerpt {
  color: var(--secondary-text);
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 15px;
  flex-grow: 1;
}

.read-more {
  color: var(--highlight-color);
  font-size: 0.8125rem;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;
  margin-top: auto;
}

.experience-timeline {
  margin-top: 30px;
  position: relative;
  padding-left: 20px;
}

.experience-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 27px;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--highlight-color) 0%, var(--border-color) 100%);
  animation: timelineGrow 1s ease-out forwards;
  transform-origin: top;
}

@keyframes timelineGrow {
  from {
    transform: scaleY(0);
    opacity: 0;
  }

  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

.timeline-item {
  display: flex;
  margin-bottom: 50px;
  position: relative;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.animate-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}



.timeline-item:nth-child(1) {
  transition-delay: 0.1s;
}

.timeline-item:nth-child(2) {
  transition-delay: 0.2s;
}

.timeline-item:nth-child(3) {
  transition-delay: 0.3s;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  background-color: var(--highlight-color);
  border-radius: 50%;
  position: absolute;
  left: 20px;
  top: 6px;
  z-index: 2;
  border: 3px solid var(--bg-color);
  transition: all 0.3s ease;
  box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
}

.timeline-item:hover .timeline-dot {
  transform: scale(1.2);
  box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1);
  animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(102, 126, 234, 0);
  }
}

.timeline-content {
  flex: 1;
  padding-left: 40px;
}

.job-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.job-type-tag {
  display: inline-block;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(118, 75, 162, 0.15));
  color: var(--highlight-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid var(--highlight-color);
}

.company {
  color: var(--highlight-color);
  font-size: 1.05rem;
  margin-bottom: 8px;
  font-weight: 500;
}

.job-duration {
  color: var(--secondary-text);
  font-size: 0.875rem;
  margin-bottom: 20px;
  font-weight: 400;
}

.job-description {
  color: var(--secondary-text);
  line-height: 1.6;
  font-size: 0.9rem;
}

.job-description-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out, margin-top 0.3s ease;
}

/* Expanded state - reveal description */
.timeline-item.expanded .job-description-list {
  max-height: 600px;
  opacity: 1;
  margin-top: 15px;
}

.job-bullet {
  color: var(--secondary-text);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
  opacity: 0;
  transform: translateX(-20px);
  animation: bulletFadeIn 0.5s ease forwards;
}

.job-bullet::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--highlight-color);
  font-weight: bold;
  font-size: 1.1rem;
}

@keyframes bulletFadeIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Ensure bullets animate when parent is visible */
.timeline-item.animate-in .job-bullet {
  animation: bulletFadeIn 0.5s ease forwards;
}

/* Expand/Collapse Indicator */
.expand-indicator {
  position: absolute;
  right: 15px;
  top: 10px;
  color: var(--highlight-color);
  font-size: 0.75rem;
  opacity: 0.6;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.timeline-item:hover .expand-indicator {
  opacity: 1;
}

.timeline-item.expanded .expand-indicator {
  transform: rotate(180deg);
}



.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.certificate-card {
  background-color: var(--secondary-bg);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  transition: all 0.4s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  padding: 30px;
  overflow: hidden;
}

.certificate-card:hover {
  transform: translateY(-8px);
  border-color: var(--highlight-color);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.certificate-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
}

.certificate-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.certificate-icon {
  width: 60px;
  height: 60px;
  background: var(--accent-gradient);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.certificate-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.certificate-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-color);
}

.certified-tag {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 2px;
  vertical-align: middle;
}

.certificate-issuer {
  color: var(--highlight-color);
  font-size: 0.9rem;
  font-weight: 500;
}

.certificate-date {
  color: var(--secondary-text);
  font-size: 0.8rem;
  margin-bottom: 20px;
}

.certificate-description {
  color: var(--secondary-text);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 25px;
  flex-grow: 1;
}

.certificate-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  line-height: 1.2;
}

.certificate-skill-tag {
  background-color: var(--bg-color);
  color: var(--secondary-text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.certificate-links {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.certificate-link {
  padding: 10px 18px;
  background-color: var(--bg-color);
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.certificate-link:hover {
  background-color: var(--highlight-color);
  color: #fff;
}

.certificate-badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #333;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.contact-card {
  background-color: var(--secondary-bg);
  padding: 30px;
  border-radius: 15px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-card:hover {
  transform: translateY(-8px);
  border-color: var(--highlight-color);
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.1);
}

.contact-card .icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  display: block;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.contact-card .icon i {
  color: var(--text-color);
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: var(--text-color);
  background-clip: unset;
}

.contact-card h4 {
  font-size: 1.125rem;
  margin-bottom: 10px;
  font-weight: 600;
}

.contact-card p {
  color: var(--secondary-text);
  font-size: 0.875rem;
}

.section-header {
  margin-bottom: 40px;
}

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 500;
  margin-bottom: 15px;
}

.section-header p {
  font-size: 1.125rem;
  color: var(--secondary-text);
  max-width: 600px;
}

.load-more-btn {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.load-more-btn button {
  background: var(--secondary-bg);
  color: var(--highlight-color);
  border: 2px solid var(--highlight-color);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.load-more-btn button:hover {
  background: var(--highlight-color);
  color: #fff;
}

.mobile-menu-toggle {
  display: none;
}

.certificate-image-container img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* --- COMMAND PALETTE STYLES (Updated for High Z-Index) --- */
.cmd-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
  z-index: 9999;
  /* Ensure top visibility */
  animation: fadeIn 0.2s ease;
}

.cmd-overlay.open {
  display: flex !important;
}

.cmd-palette {
  width: 500px;
  max-width: 90%;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

#cmdInput {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 1rem;
  padding: 10px 5px;
  margin-bottom: 10px;
  font-family: inherit;
}

#cmdInput:focus {
  outline: none;
  border-bottom-color: var(--highlight-color);
}

#cmdList {
  max-height: 300px;
  overflow-y: auto;
}

.cmd-item {
  padding: 12px 15px;
  cursor: pointer;
  color: var(--secondary-text);
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cmd-item:hover {
  background-color: var(--bg-color);
  color: var(--text-color);
  padding-left: 20px;
}

.cmd-shortcut {
  font-size: 0.7rem;
  opacity: 0.5;
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: 4px;
}

@media (max-width: 1024px) {
  .container {
    flex-direction: column;
  }

  .mobile-menu-toggle {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 1001;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    cursor: pointer;
    font-weight: 600;
  }

  .mobile-menu-toggle .menu-icon {
    font-size: 1.5rem;
    transition: transform 0.3s;
  }

  .sidebar {
    /* Sidebar settings: 60% width, right side */
    width: 60%;
    /* FIXED: Calculated height to fit exactly in viewport below the header */
    height: calc(100vh - 60px);
    min-height: 0;
    /* Reset min-height so it doesn't force overflow */
    position: fixed;
    top: 60px;
    left: auto;
    right: 0;
    padding: 0;
    /* Add padding at bottom to ensure button is safe */
    padding-bottom: 20px;
    z-index: 1000;
    background-color: var(--secondary-bg);
    border-right: none;
    border-left: 1px solid var(--border-color);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    overflow-x: hidden;
  }

  .sidebar.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
    overflow-y: auto;
  }

  /* Ensure profile and other nav items are centered in mobile view */
  .profile,
  .nav-item:not(#theme-toggle) {
    width: 100%;
  }

  .nav-item {
    width: 100%;
    padding: 15px 25px;
    margin-bottom: 0;
    /* FIX: Changed from flex-end to flex-start to align icons vertically */
    justify-content: flex-start;
    border-radius: 0;
  }

  /* --- MOBILE THEME TOGGLE UPDATE (Tightened bottom margin) --- */
  #theme-toggle {
    margin-top: 10px;
    /* Place below Contact button */
    margin-bottom: 30px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  .nav-item .icon {
    display: inline-block;
  }

  .nav-item:hover {
    transform: none;
  }

  .nav-item.active {
    border-left: 3px solid var(--highlight-color);
    border-right: none;
    border-bottom: none;
  }

  .profile {
    display: none;
  }

  /* Hide footer (Ctrl + K text) on mobile */
  .sidebar-footer {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 20px;
    padding-top: 80px;
  }

  .hero-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    text-align: center;
  }

  .hero-text {
    margin-right: 0;
  }

  .hero p {
    text-align: center;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero h1 .intro-line {
    font-size: 2.25rem;
  }

  .hero h1 .title-line {
    font-size: 1.6rem;
  }

  .hero-image {
    width: 250px;
    height: 250px;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .projects-grid,
  .blog-grid,
  .contact-grid,
  .certificates-grid {
    grid-template-columns: 1fr;
  }

  /* --- BEGIN MODIFICATION FOR HORIZONTAL BUTTONS --- */
  .job-title {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .hero-buttons {
    gap: 10px;
    /* Slight reduction in gap */
  }

  .hero-buttons a.btn {
    /* Force them to be side-by-side, sharing space */
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
    font-size: 0.9rem;
    /* Smaller text */
    padding: 10px 10px;
    /* Reduced padding */
    min-width: 140px;
    /* Minimum width to prevent them from becoming too small */
    justify-content: center;
    /* Center the content inside the button */
  }

  .hero-buttons a.btn i {
    margin-right: 5px;
    /* Reduced space before icon */
  }

  /* --- END MODIFICATION FOR HORIZONTAL BUTTONS --- */
}

@media (max-width: 500px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .skill-card {
    padding: 15px 10px;
  }

  .skill-card h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
  }

  .skill-card p {
    font-size: 0.7rem;
  }

  .skill-card .icon {
    font-size: 2rem;
    margin-bottom: 5px;
  }
}

/* Added a more aggressive breakpoint for very small phones to ensure fit */
@media (max-width: 480px) {
  .hero-buttons a.btn {
    font-size: 0.8rem;
    /* Even smaller text for tiny screens */
    padding: 8px 8px;
    /* Further reduced padding */
    min-width: 120px;
  }
}