/* =======================
   CSS RESET & BASE STYLES
   ======================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  /* Modern dark background with subtle warmth */
  background: linear-gradient(135deg, #121212 0%, #1a1a1a 100%);

  /* Typography: Inter font for modern, clean look */
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif;
  color: #f0f0f0;
  line-height: 1.6;

  /* Flexbox layout for viewport fit */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =======================
   LAYOUT & CONTAINER
   ======================= */

.container {
  /* Single-column responsive layout */
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px 20px 20px;

  /* Flexbox for vertical spacing control */
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .container {
    padding: 40px 24px;
    gap: 40px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 40px 20px;
    gap: 20px;
  }
}

/* =======================
   ANIMATION SYSTEM
   ======================= */

/* Initial state for scroll animations - elements start invisible and shifted */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Active state when elements come into view */
.animate-on-scroll.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered animation delays for multiple elements */
.animate-on-scroll:nth-child(2) {
  transition-delay: 0.1s;
}

.animate-on-scroll:nth-child(3) {
  transition-delay: 0.2s;
}

/* =======================
   HERO SECTION
   ======================= */

.hero-section {
  text-align: center;
  padding: 20px 0 40px 0;
}

.profile-image-container {
  margin-bottom: 24px;

  /* Subtle hover animation for profile image */
  transition: transform 0.3s ease-in-out;
}

.profile-image-container:hover {
  transform: scale(1.02);
}

.profile-image {
  width: 120px;
  height: 120px;

  /* Modern circular crop with subtle border */
  border-radius: 50%;
  border: 3px solid rgba(0, 167, 157, 0.3); /* Teal accent with transparency */

  /* Smooth image rendering */
  object-fit: cover;

  /* Elegant shadow for depth */
  box-shadow: 0 20px 60px rgba(0, 167, 157, 0.1);

  transition: all 0.3s ease-in-out;
}

.profile-image:hover {
  border-color: #00a79d; /* Full teal on hover */
  box-shadow: 0 25px 80px rgba(0, 167, 157, 0.2);
}

/* Mobile responsive image sizing */
@media (max-width: 480px) {
  .profile-image {
    width: 140px;
    height: 140px;
  }
}

/* =======================
   TYPOGRAPHY HIERARCHY
   ======================= */

.name {
  font-size: 2.5rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;

  /* Subtle text shadow for depth */
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);

  /* Letter spacing for elegance */
  letter-spacing: -0.02em;
}

.title {
  font-size: 1.1rem;
  font-weight: 400;
  color: #00a79d; /* Teal accent color */
  margin-bottom: 16px;

  /* Subtle animation on load */
  animation: fadeInUp 1s ease-out 0.3s both;
}

.description {
  font-size: 0.95rem;
  font-weight: 400;
  color: #c8c8c8;
  max-width: 500px;
  margin: 0 auto;

  /* Optimal line height for readability */
  line-height: 1.6;
}

.description-sub {
  color: rgb(73, 73, 73); 
}

/* Mobile typography adjustments */
@media (max-width: 768px) {
  .name {
    font-size: 2.8rem;
  }

  .title {
    font-size: 1.3rem;
  }

  .description {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .name {
    font-size: 2.2rem;
  }

  .title {
    font-size: 1.1rem;
  }
}

/* =======================
   SECTION STYLING
   ======================= */

.section-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 16px;
  text-align: center;

  /* Elegant underline effect */
  position: relative;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #00a79d, #00d4c7);
  border-radius: 2px;
}

.about-text {
  font-size: 1.125rem;
  color: #c8c8c8; /* Improved contrast */
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.download-section {
  margin-top: 40px;
  text-align: center;
}

/* =======================
   SOCIAL LINKS & DOWNLOAD LINKS (General Link Styling)
   ======================= */

/* Remove list styling for accessibility */
.social-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 0 auto;
  list-style: none; /* Remove default list bullets */
  padding: 0;
}

.social-link {
  /* Modern card-style button design */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px 32px;

  /* Typography */
  color: #f0f0f0; /* Improved contrast */
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;

  /* Layout */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;

  /* Smooth transitions for all interactive states */
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Subtle initial transform for hover effect */
  transform: translateY(0);
}

.download-link {
  /* Modern card-style button design */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px 32px;
  flex-direction: column;

  /* Typography */
  color: #f0f0f0; /* Improved contrast */
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;

  /* Layout */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  height: 320px;

  /* Smooth transitions for all interactive states */
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Subtle initial transform for hover effect */
  transform: translateY(0);
}

.social-icon {
  width: 20px;
  height: 20px;
  color: #00a79d;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.download-icon {
  width: 80px;
  height: 80px;
  color: #00a79d;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.social-link:hover {
  /* Hover effects: lift, glow, and color change */
  transform: translateY(-4px);
  background: rgba(
    0,
    167,
    157,
    0.15
  ); /* Increased opacity for better visibility */
  border-color: rgba(0, 167, 157, 0.5); /* Stronger border */
  color: #00d4c7; /* Brighter teal for better contrast */

  /* Enhanced shadow for lifted appearance */
  box-shadow: 0 20px 40px rgba(0, 167, 157, 0.2);
}

.social-link:hover .social-icon {
  color: #00d4c7;
  transform: scale(1.1);
}

.social-link:active {
  /* Subtle press effect */
  transform: translateY(-2px);
}

.download-link:hover {
  /* Hover effects: lift, glow, and color change */
  transform: translateY(-4px);
  background: rgba(
    0,
    167,
    157,
    0.15
  ); /* Increased opacity for better visibility */
  border-color: rgba(0, 167, 157, 0.5); /* Stronger border */
  color: #00d4c7; /* Brighter teal for better contrast */

  /* Enhanced shadow for lifted appearance */
  box-shadow: 0 20px 40px rgba(0, 167, 157, 0.2);
}

.download-link:hover .download-icon {
  color: #00d4c7;
  transform: scale(1.1);
}

.download-link:active {
  /* Subtle press effect */
  transform: translateY(-2px);
}

/* Mobile responsive grid */
@media (max-width: 600px) {
  .social-links {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* =======================
   PORTFOLIO PAGE STYLES (Used by webdev.html)
   ======================= */

.portfolio-page-header {
  padding: 40px 0 20px 0;
  text-align: center;
  position: relative;
}

.portfolio-page-header .section-heading {
  margin-top: 20px;
}

.back-link {
  position: absolute;
  top: 40px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #00a79d;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s, transform 0.2s;
}

.back-link:hover {
  color: #00d4c7;
  transform: translateX(-4px);
}

@media (max-width: 768px) {
  .back-link {
    position: static;
    margin-bottom: 20px;
    justify-content: center;
  }
  .portfolio-page-header {
    padding-top: 20px;
  }
}

.portfolio-section {
  padding: 40px 0;
}

.portfolio-grid {
  display: grid;
  gap: 20px;
  /* Default for mobile: 1 column */
  grid-template-columns: 1fr;
}

/* Tablet: 2 columns */
@media (min-width: 600px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: 3 columns (Optimized for larger screens on portfolio page) */
@media (min-width: 1024px) {
  /* Overrides max-width from .container for the grid section */
  .portfolio-section {
    max-width: 1000px;
    margin: 0 auto;
  }
  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Portfolio Card Styling */

.portfolio-card {
  /* Card styling to match social-link design principles */
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px; /* Consistent border radius */
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);

  /* Smooth transitions for interactive state */
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
  cursor: default; /* Changed from pointer since it's no longer a link */
}

.portfolio-card:hover {
  transform: translateY(-4px); /* Subtle lift on hover */
  border-color: rgba(0, 167, 157, 0.3);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4); /* Subtle shadow */
  background: linear-gradient(
    135deg,
    rgba(22, 249, 230, 0.3),
    rgba(0, 78, 73, 0.1)
  );
}

.portfolio-image-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative; /* For absolute positioning of links */
}

/* Portfolio Links Container */
.portfolio-links {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 10;
  transition: all 0.3s ease;
}

.portfolio-links:hover {
  /* Slightly increase visibility of links on hover */
  transform: scale(1.1);
}

/* Portfolio Link Icons */
.portfolio-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px; /* 75% of 36px */
  height: 27px; /* 75% of 36px */
  background: rgba(0, 83, 78, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px; /* Proportionally smaller */
  color: #f0f0f0;
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.portfolio-link-icon:hover {
  background: rgba(0, 189, 176, 0.9);
  border-color: #00d4c7;
  color: #ffffff;
  transition: all 0.3s ease;
  transform: scale(1.1);
}

.portfolio-link-icon svg {
  width: 14px; /* 75% of 18px */
  height: 14px; /* 75% of 18px */
}

.portfolio-link-icon .icon-sm {
  width: 14px; /* 75% of 18px */
  height: 14px; /* 75% of 18px */
}

.portfolio-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.portfolio-card:hover .portfolio-image {
  transform: scale(1.05); /* Subtle zoom effect */
}

.portfolio-caption {
  padding: 16px; /* Increased padding */
  font-size: 0.9rem;
  font-weight: 600;
  color: #f0f0f0;
  text-align: left;
  line-height: 1.4;

  flex-grow: 1;
  display: flex;
  align-items: center;
  min-height: 4.2em;
}

/* =======================
   LOADING SPINNER
   ======================= */

.loading-spinner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(26, 26, 26, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 999; /* Below header (1000) but above content */
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #00a79d;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: #f0f0f0;
  font-size: 1rem;
  font-weight: 500;
  margin: 0;
}

/* Content blur effect during loading */
.page-content {
  transition: filter 0.3s ease;
}

.page-content.is-loading {
  filter: blur(8px);
  pointer-events: none;
}

/* =======================
   KEYFRAME ANIMATIONS
   ======================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =======================
   ACCESSIBILITY & PERFORMANCE
   ======================= */

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* Focus styles for keyboard navigation */
.social-link:focus-visible,
.portfolio-card:focus-visible {
  outline: 3px solid #00d4c7; /* Stronger outline */
  outline-offset: 4px;
}

/* Additional focus styles for skip link */
a:focus-visible {
  outline: 3px solid #00d4c7;
  outline-offset: 2px;
}

/* =======================
   FOOTER (Minimalist)
   ======================= */

.footer {
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px 20px;
  margin-top: auto; /* Push footer to bottom */
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #888888;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.footer-link:hover {
  color: #00a79d;
  background: rgba(0, 167, 157, 0.1);
  transform: translateY(-2px);
}

.footer-icon {
  width: 18px;
  height: 18px;
}

.footer-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
}

.footer-location {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666666;
  font-size: 0.8rem;
}

.footer-location .footer-icon {
  width: 14px;
  height: 14px;
  color: #555555;
}

.footer-copy {
  font-size: 0.75rem;
  color: #555555;
  margin: 0;
}

/* Mobile responsive footer */
@media (max-width: 768px) {
  .footer {
    padding: 32px 24px 24px;
    margin-top: 60px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 24px 20px;
  }

  .header-content a.nav-link {
    font-size: 0.8rem;
  }

  .footer {
    padding: 24px 20px 20px;
    margin-top: 40px;
  }

  .contact-item {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .contact-icon {
    width: 16px;
    height: 16px;
  }

  .contact-text {
    font-size: 0.8rem;
  }
}

/* =======================
   VIDEO MODAL
   ======================= */

.video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.video-modal.active {
  display: flex;
}

.video-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  cursor: pointer;
}

.video-modal-content {
  position: relative;
  width: 90%;
  max-width: 1200px;
  background: rgba(18, 18, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 24px;
  z-index: 10000;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.video-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #f0f0f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
}

.video-modal-close:hover {
  background: rgba(255, 59, 48, 0.9);
  border-color: rgba(255, 59, 48, 1);
  transform: scale(1.1);
}

.video-modal-close .icon-close {
  width: 20px;
  height: 20px;
}

.video-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #f0f0f0;
  margin-bottom: 16px;
  padding-right: 40px;
}

.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #000000;
  border-radius: 8px;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Mobile responsive modal */
@media (max-width: 768px) {
  .video-modal-content {
    width: 95%;
    padding: 20px;
  }

  .video-modal-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  .video-modal-close {
    width: 32px;
    height: 32px;
    top: 12px;
    right: 12px;
  }

  .video-modal-close .icon-close {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 480px) {
  .video-modal-content {
    width: 98%;
    padding: 16px;
  }

  .video-modal-title {
    font-size: 1rem;
    margin-bottom: 10px;
  }
}

/* =======================
   HEADER STYLES
   ======================= */
.header-content {
  width: 100vw;
  margin: 0 auto;
  padding: 20px 10px;
  text-align: center;
  background: linear-gradient(
    90deg,
    rgb(13, 72, 68) 0%,
    rgb(0, 107, 100) 50%,
    rgb(13, 72, 68) 100%
  );
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  border-bottom: solid 4px rgba(32, 171, 162, 0.4);
  backdrop-filter: blur(20px);
}

.header-content nav.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1px;
}

.header-content nav a {
  color: #ffffff;
  text-decoration: none;
  margin: 0 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-content nav a:hover {
  color: #00d4c7; /* Brighter teal on hover */
  transform: translateY(-2px);
}

.header-content nav a i,
.header-content nav a svg {
  width: 18px;
  height: 18px;
}

.adjust-link {
  transform: translateY(2px);
}
