:root {
  /* Base Colors */
  --yellow: #f4a300;
  --red: #f44336;
  --blue: #00bcd4;

  /* Semantic Variables (Light Mode Default) */
  --bg-body: #f2f2f2;
  --bg-nav: #f2f2f2;
  --text-main: #111;
  --text-secondary: #333;
  --text-muted: gray;
  --shadow-color: rgba(0, 0, 0, 0.2);
  --border-color: #ccc;
  --nav-border: #eee;
  --card-bg: #fff;
  /* For preloader or potential cards */
}

[data-theme="dark"] {
  /* Dark Mode Overrides */
  --bg-body: #121212;
  --bg-nav: #1e1e1e;
  --text-main: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-muted: #888;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --border-color: #333;
  --nav-border: #333;
  --card-bg: #1e1e1e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
  /* Smooth theme transition */
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  padding: 40px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 20px;
  font-weight: 600;
  z-index: 1001;
  color: var(--text-main);
}

.logo-dot {
  background-color: var(--yellow);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 10px;
}

.logo span.role {
  font-weight: normal;
  font-size: 14px;
  margin-left: 8px;
  color: var(--text-muted);
}

nav a {
  text-decoration: none;
  color: var(--text-main);
  margin-left: 25px;
  font-size: 16px;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  background-color: var(--text-main);
  left: 0;
  bottom: -5px;
  transition: 0.3s;
}

nav a:hover::after {
  width: 100%;
}

.menu-toggle {
  display: none;
  font-size: 24px;
  cursor: pointer;
  z-index: 1001;
  color: var(--text-main);
}

.main {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 60px;
}

.profile-img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 8px 20px var(--shadow-color);
  transition: transform 0.3s;
}

.profile-img:hover {
  transform: scale(1.03);
}

.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.info {
  max-width: 450px;
}

.info h1 {
  font-size: 64px;
  margin-bottom: 20px;
  animation: fadeInDown 1s ease forwards;
  color: var(--text-main);
}

.info h3 {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 10px;
  color: var(--text-main);
}

.info p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.buttons {
  margin-top: 30px;
  display: flex;
  gap: 25px;
  flex-wrap: wrap;
}

.buttons a {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  text-decoration: none;
  color: white;
  /* Always white on colored buttons */
  font-weight: bold;
  text-align: center;
  line-height: 100px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.buttons a:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px var(--shadow-color);
}

.resume {
  background-color: var(--yellow);
}

.projects {
  background-color: var(--red);
}

.contact {
  background-color: var(--blue);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--card-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}

.loader {
  font-size: 48px;
  animation: bounce 1.2s infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-20px);
  }
}

@media (max-width: 768px) {
  body {
    padding: 20px;
  }

  header {
    margin-bottom: 40px;
  }

  .menu-toggle {
    display: block;
  }

  nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-nav);
    box-shadow: 0 8px 16px var(--shadow-color);
    padding: 20px;
    border-top: 1px solid var(--nav-border);
    z-index: 1000;
  }

  nav.active {
    display: flex;
  }

  nav a {
    margin: 10px 0;
    text-align: center;
  }

  .main {
    flex-direction: column;
    text-align: center;
    gap: 40px;
  }

  .profile-img {
    width: 200px;
    height: 200px;
  }

  .info h1 {
    font-size: 48px;
  }

  .info {
    padding: 0 10px;
  }

  .buttons {
    justify-content: center;
  }

  .buttons a {
    width: 80px;
    height: 80px;
    line-height: 80px;
    font-size: 14px;
  }
}

.social-icons a {
  color: var(--text-main);
  margin-right: 15px;
  font-size: 22px;
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: var(--yellow);
}

.footer-bottom {
  margin-top: 40px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.footer-bottom a {
  color: var(--text-main);
  text-decoration: underline;
}

/* Theme Toggle Button Styles */
.theme-toggle {
  cursor: pointer;
  font-size: 20px;
  margin-left: 20px;
  color: var(--text-main);
  background: none;
  border: none;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--yellow);
}

/* Certificates Section Styles */
.certificates-section {
  margin: 100px auto;
  max-width: 1200px;
  padding: 0 20px;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
  animation: fadeInDown 1s ease;
}

.section-header h2 {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 15px;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 4px;
  background: linear-gradient(90deg, var(--yellow), var(--red), var(--blue));
  bottom: -10px;
  left: 20%;
  border-radius: 2px;
  animation: expandWidth 1.5s ease;
}

@keyframes expandWidth {
  from {
    width: 0;
    left: 50%;
  }

  to {
    width: 60%;
    left: 20%;
  }
}

.section-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  font-weight: 400;
}

.certificates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.certificate-card {
  background: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 30px var(--shadow-color);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  animation: fadeInUp 0.8s ease forwards;
  opacity: 0;
}

.certificate-card:nth-child(1) {
  animation-delay: 0.1s;
}

.certificate-card:nth-child(2) {
  animation-delay: 0.2s;
}

.certificate-card:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.certificate-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 15px 50px var(--shadow-color);
}

.certificate-image {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.certificate-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.certificate-card:hover .certificate-image img {
  transform: scale(1.1) rotate(2deg);
}

.certificate-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.certificate-overlay i {
  font-size: 48px;
  color: white;
  transform: scale(0);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.certificate-card:hover .certificate-overlay {
  opacity: 1;
}

.certificate-card:hover .certificate-overlay i {
  transform: scale(1);
}

.certificate-content {
  padding: 30px;
}

.certificate-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 15px;
  line-height: 1.3;
}

.certificate-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 20px;
}

.certificate-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.certificate-date {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.certificate-date i {
  font-size: 16px;
}

.verify-link {
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--yellow));
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}

.verify-link:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(0, 188, 212, 0.5);
  background: linear-gradient(135deg, var(--yellow), var(--blue));
}

.verify-link i {
  font-size: 16px;
}

/* Responsive Design for Certificates */
@media (max-width: 768px) {
  .certificates-section {
    margin: 60px auto;
  }

  .section-header h2 {
    font-size: 36px;
  }

  .section-subtitle {
    font-size: 16px;
  }

  .certificates-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .certificate-image {
    height: 200px;
  }

  .certificate-content {
    padding: 20px;
  }

  .certificate-content h3 {
    font-size: 20px;
  }

  .certificate-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .verify-link {
    width: 100%;
    justify-content: center;
  }
}