/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* ========= LIGHT MODE (default) ========= */
  --primary-color: #2563eb;
  --secondary-color: #3b82f6;
  --accent-color: #60a5fa;
  --accent-warm: #d97706;
  --accent-warm-light: #fde68a;
  --text-dark: #1f2937;
  --text-light: #4b5563;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --border-color: #e5e7eb;
  --hero-gradient: linear-gradient(135deg, #c4dfdf 0%, #d2e9e9 100%);
  --nav-bg-scrolled: rgba(255, 255, 255, 0.95);
  --footer-bg: linear-gradient(135deg, #f0f7ff, #f8fafc);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

  /* Alternating section colors */
  --section-1: #f0f7ff;
  --section-2: #f8fafc;
  --section-3: #f0f7ff;
  --section-4: #f8fafc;
  --section-5: #f0f7ff;
}

/* ========= DARK MODE ========= */
[data-theme="dark"] {
  --primary-color: #60a5fa;
  --secondary-color: #3b82f6;
  --accent-color: #93c5fd;
  --accent-warm: #f59e0b;
  --accent-warm-light: #78350f;
  --text-dark: #f1f5f9;
  --text-light: #94a3b8;
  --bg-light: #0f172a;
  --bg-white: #1e293b;
  --border-color: #334155;
  --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1a2332 100%);
  --nav-bg-scrolled: rgba(15, 23, 42, 0.95);
  --footer-bg: linear-gradient(135deg, #0f172a, #1a2332);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

  /* Alternating section colors */
  --section-1: #0f172a;
  --section-2: #1a2332;
  --section-3: #0f172a;
  --section-4: #1a2332;
  --section-5: #0f172a;
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
  background: var(--bg-light);
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  border-radius: 0 0 8px 8px;
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* Focus-visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
}

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.btn-cv {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  border: 2px solid #1e40af;
  position: relative;
  overflow: hidden;
}

.btn-cv::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.btn-cv:hover::before {
  left: 100%;
}

.btn-cv:hover {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

/* Floating CV Button */
.cv-fab-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 1000;
  animation: fab-bounce 2s ease-in-out infinite;
}

.cv-fab {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 15px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cv-fab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.cv-fab:hover::before {
  left: 100%;
}

.cv-fab:hover {
  background: linear-gradient(135deg, #3b82f6, #1e40af);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

.cv-fab:active {
  transform: translateY(0) scale(0.95);
}

.cv-fab i {
  font-size: 16px;
}

.cv-fab-text {
  font-weight: 600;
}

/* FAB subtle float animation */
@keyframes fab-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.cv-fab-container:hover {
  animation-play-state: paused;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .cv-fab-container {
    bottom: 20px;
    right: 20px;
  }

  .cv-fab {
    padding: 12px 16px;
    font-size: 12px;
  }

  .cv-fab i {
    font-size: 14px;
  }

  .cv-fab-text {
    display: inline;
  }
}

@media (max-width: 480px) {
  .cv-fab {
    padding: 10px 14px;
    border-radius: 25px;
  }

  .cv-fab-text {
    font-size: 11px;
  }
}

.btn:active {
  transform: translateY(0);
}

/* Section Styles */
.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--text-dark);
  position: relative;
  text-wrap: balance;
}

.about-text p {
  max-width: 75ch;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 2px;
}

/* Animations */
.animate-text {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.animate-text:nth-child(1) {
  animation-delay: 0.1s;
}

.animate-text:nth-child(2) {
  animation-delay: 0.3s;
}

.animate-text:nth-child(3) {
  animation-delay: 0.5s;
}

.animate-text:nth-child(4) {
  animation-delay: 0.7s;
}

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

/* Reduced motion — disable all animations */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .animate-text {
    opacity: 1;
    transform: translateY(0);
  }

  .timeline-item,
  section,
  .skill-card,
  .education-card,
  .contact-item,
  .cert-item {
    opacity: 1 !important;
    transform: none !important;
  }

  .cv-fab-container {
    animation: none !important;
  }

  .scroll-indicator {
    animation: none !important;
  }
}

/* Show More Button */
.show-more-btn {
  display: block;
  margin: 2rem auto 0;
  padding: 0.75rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.show-more-btn:hover {
  background: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.show-more-btn:active {
  transform: translateY(0);
}

/* Notification styles */
.notification {
  position: fixed;
  top: 100px;
  right: 20px;
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  color: white;
  font-weight: 500;
  z-index: 1001;
  max-width: 350px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateX(calc(100% + 40px));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.notification.notification-visible {
  transform: translateX(0);
}

.notification.success {
  background: var(--primary-color);
}

.notification.error {
  background: #ef4444;
}

@media (max-width: 480px) {
  .notification {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Simple loading skeleton for initial data load */
.loading-skeleton {
  display: block;
  color: var(--text-light);
  font-style: italic;
  position: relative;
}

.loading-skeleton::after {
  content: "";
  display: inline-block;
  width: 4px;
  height: 1.1rem;
  margin-left: 4px;
  background: var(--primary-color);
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Section scroll reveal animation */
.section-hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-hidden.section-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .section-hidden {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Entrance animation for dynamically added cards */
.card-enter {
  animation: cardFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}

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

.card-enter:nth-child(1) { animation-delay: 0s; }
.card-enter:nth-child(2) { animation-delay: 0.05s; }
.card-enter:nth-child(3) { animation-delay: 0.1s; }
.card-enter:nth-child(4) { animation-delay: 0.15s; }
.card-enter:nth-child(5) { animation-delay: 0.2s; }
.card-enter:nth-child(6) { animation-delay: 0.25s; }
.card-enter:nth-child(7) { animation-delay: 0.3s; }
.card-enter:nth-child(8) { animation-delay: 0.35s; }
