:root {
  --accent: #00adb5;
  --accent-hover: #028f98;
  --bs-primary: #00adb5;
  --bs-primary-rgb: 0, 173, 181;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

#hero h2,
#hero p,
#hero a.btn {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}
#hero h2 { animation-delay: 0.1s; }
#hero p { animation-delay: 0.25s; }
#hero a.btn { animation-delay: 0.4s; }

#hero .lead {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 173, 181, 0.3);
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 0s;
  border: 4px solid var(--bs-primary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-photo:hover {
  transform: scale(1.15);
  box-shadow: 0 15px 40px rgba(0, 173, 181, 0.4);
}

html[data-bs-theme="dark"] .profile-photo {
  box-shadow: 0 10px 30px rgba(0, 173, 181, 0.4);
}

html[data-bs-theme="dark"] .profile-photo:hover {
  box-shadow: 0 15px 40px rgba(0, 173, 181, 0.5);
}

.card-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease, box-shadow .3s ease;
}
.card-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.card:hover {
  box-shadow: 0 1rem 2rem rgba(0,0,0,.15) !important;
}
html[data-bs-theme="dark"] .card:hover {
  box-shadow: 0 0.5rem 1.5rem rgba(0, 173, 181, 0.15), 0 0.5rem 1rem rgba(0, 173, 181, 0.1) !important;
}

.btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
}
.link-primary { color: var(--bs-primary) !important; }
.link-primary:hover { color: var(--accent-hover) !important; }

.toggle-theme {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  cursor: pointer;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, background .2s ease;
  z-index: 1050;
}
.toggle-theme:hover { transform: scale(1.06); background: var(--accent-hover); }

section h2.h3 { letter-spacing: .2px; }

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

.progress-bar.skill-fill {
  width: 0%;
  transition: width 1.5s ease-out;
}

#certificates .card {
  position: relative;
}
#certificates .card-body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 2.5rem;
}
#certificates .certificate-link {
  position: absolute;
  top: 12px;
  right: 16px;
  padding: 0.25rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.08);
  color: var(--bs-primary);
  text-decoration: none;
  background-color: rgba(0,0,0,0.02);
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
html[data-bs-theme="dark"] #certificates .certificate-link {
  border-color: rgba(255,255,255,0.12);
  background-color: rgba(255,255,255,0.05);
}
#certificates .certificate-link:hover {
  color: var(--accent-hover);
  border-color: rgba(0,0,0,0.18);
  background-color: rgba(0,0,0,0.04);
}
html[data-bs-theme="dark"] #certificates .certificate-link:hover {
  border-color: rgba(255,255,255,0.2);
  background-color: rgba(255,255,255,0.09);
}

header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1030;
  border-bottom: 1px solid rgba(108,117,125,.25);
  backdrop-filter: blur(10px);
}

html[data-bs-theme="dark"] header { background-color: rgba(10,10,10,0.95); }
html[data-bs-theme="light"] header { background-color: rgba(245,245,245,0.95); }

.custom-nav { max-width: 1200px; margin: 0 auto; padding: 1rem 1.25rem; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand {
  position: relative;
  color: var(--bs-primary);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .4px;
  transition: color .3s ease;
}
.brand::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
  opacity: .85;
}
.brand:hover { color: var(--accent-hover); }
.brand:hover::after { transform: scaleX(1); }

.nav-links { list-style: none; display: flex; gap: 1.5rem; margin: 0; }
.nav-links li { position: relative; }
.nav-links li::before {
  content: "";
  position: absolute;
  inset: -.35rem -.8rem;
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
html[data-bs-theme="dark"] .nav-links li::before {
  background: linear-gradient(135deg, rgba(0,173,181,0.18), rgba(2,143,152,0.12));
}
html[data-bs-theme="light"] .nav-links li::before {
  background: linear-gradient(135deg, rgba(0,173,181,0.15), rgba(2,143,152,0.1));
}
.nav-links li:hover::before {
  opacity: 1;
  transform: scale(1);
}
.nav-links a {
  position: relative;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  padding: .35rem 0;
  transition: color .3s ease;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .25s ease;
  opacity: .85;
}
.nav-links a:hover { color: var(--accent-hover); }
.nav-links a:hover::after { transform: scaleX(1); }

html[data-bs-theme="dark"] .nav-links a { color: #f5f5f5; }
html[data-bs-theme="light"] .nav-links a { color: #111; }

.hamburger { display: none; flex-direction: column; gap: 5px; cursor: pointer; }
.hamburger div { width: 24px; height: 3px; border-radius: 2px; }
html[data-bs-theme="dark"] .hamburger div { background-color: #f5f5f5; }
html[data-bs-theme="light"] .hamburger div { background-color: #111; }

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    padding: 1.1rem 1.4rem;
    border-radius: 0 0 8px 8px;
    flex-direction: column;
    gap: .75rem;
    box-shadow: 0 1.4rem 2.4rem rgba(15,23,42,0.32);
  }
  html[data-bs-theme="dark"] .nav-links { background: rgba(10,10,10,0.98); }
  html[data-bs-theme="light"] .nav-links { background: rgba(245,245,245,0.98); }
  .nav-links.active { display: flex; }
  .hamburger { display: flex; }
  .nav-links li::before { display: none; }
  .nav-links a {
    padding: .5rem 0;
  }
  .nav-links a::after {
    bottom: -4px;
    transform-origin: left;
  }
}

.scroll-to-top {
  position: fixed;
  bottom: 80px;
  right: 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  font-size: 1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity .3s ease, transform .3s ease;
  z-index: 1049;
  opacity: 0;
}

.scroll-to-top.show {
  display: inline-flex;
  opacity: 1;
}

.scroll-to-top:hover {
  transform: translateY(-3px);
  background: var(--accent-hover);
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

section {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

section:nth-child(1) { animation-delay: 0s; opacity: 1; }
section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }

.card {
  transition: all 0.3s ease;
}

footer {
  animation: slideInFromRight 0.8s ease-out 0.5s forwards;
  opacity: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Contact Form Styles */
.contact-form {
  max-width: 100%;
}

.contact-form .form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.contact-form .form-control,
.contact-form textarea {
  border-radius: 8px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

html[data-bs-theme="dark"] .contact-form .form-control,
html[data-bs-theme="dark"] .contact-form textarea {
  border-color: rgba(255, 255, 255, 0.15);
  background-color: rgba(255, 255, 255, 0.05);
  color: #f5f5f5;
}

.contact-form .form-control:focus,
.contact-form textarea:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(0, 173, 181, 0.25);
  outline: none;
}

html[data-bs-theme="dark"] .contact-form .form-control:focus,
html[data-bs-theme="dark"] .contact-form textarea:focus {
  border-color: var(--bs-primary);
  background-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 0.2rem rgba(0, 173, 181, 0.3);
}

.contact-form .form-control::placeholder,
.contact-form textarea::placeholder {
  color: rgba(0, 0, 0, 0.4);
}

html[data-bs-theme="dark"] .contact-form .form-control::placeholder,
html[data-bs-theme="dark"] .contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.contact-form .form-control.is-invalid,
.contact-form textarea.is-invalid {
  border-color: #dc3545;
}

.contact-form .form-control.is-valid,
.contact-form textarea.is-valid {
  border-color: #28a745;
}

.contact-form .invalid-feedback {
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.contact-form .form-text {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.contact-form .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 173, 181, 0.3);
}

.contact-form .btn-primary:active {
  transform: translateY(0);
}

.contact-form .button-text,
.contact-form .button-loader {
  display: inline-block;
}

.contact-form .button-loader.d-none {
  display: none !important;
}

@media (max-width: 576px) {
  .contact-form .btn-lg {
    width: 100%;
  }
}
