/* 
 * Optimized CSS Framework
 * - Clean, consolidated selectors
 * - Logical organization
 * - Performance optimized
 * - Dark mode support
 * - Accessibility compliant
 */

/* ====== CSS VARIABLES ====== */
:root {
  /* Color Palette */
  --brand-black: #000000;
  --brand-white: #ffffff;
  --brand-teal: #3b6b5e;
  --brand-teal-hover: #2d5247;

  --primary-color: var(--brand-teal);
  --primary-color-hover: var(--brand-teal-hover);
  --secondary-color: var(--brand-teal);
  --accent-color: var(--brand-teal);
  --success-color: var(--brand-teal);
  --warning-color: var(--brand-teal);
  --error-color: var(--brand-black);
  --info-color: var(--brand-teal);
  --logo-color: var(--brand-teal);
  
  /* UI Colors */
  --text-color: var(--brand-black);
  --text-color-light: var(--brand-teal);
  --background-color: var(--brand-white);
  --background-secondary: var(--brand-white);
  --border-color: rgba(0, 0, 0, 0.12);
  
  /* Dark Theme Colors */
  --dark-text-color: var(--brand-white);
  --dark-text-color-light: rgba(255, 255, 255, 0.88);
  --dark-background-color: var(--brand-black);
  --dark-background-secondary: var(--brand-black);
  --dark-border-color: rgba(255, 255, 255, 0.14);
  
  /* Layout */
  --container-max-width: 1200px;
  --sidebar-width: 280px;
  --section-padding: 80px 20px;
  --card-padding: 25px;
  --border-radius: 8px;
  --box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  --box-shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.15);
  
  /* Typography */
  --font-primary: 'PT Sans', Arial, sans-serif;
  --font-secondary: 'Roboto', Arial, sans-serif;
  --font-heading: 'Montserrat', Arial, sans-serif;
  --font-monospace: 'Consolas', monospace;
  
  /* Z-Index Layers */
  --z-modal: 1050;
  --z-popup: 1000;
  --z-fixed: 900;
  --z-overlay: 100;
  --z-dropdown: 50;
  --z-normal: 1;
  
  /* Transitions & Animations */
  --transition-speed: 0.3s;
  --transition-function: ease;
  --hover-transition: all 0.3s ease;
  --hover-lift: translateY(-5px);
  --card-hover-transform: translateY(-10px) scale(1.02);
  --animation-speed-fast: 0.4s;
  --animation-speed-medium: 0.6s;
  --animation-speed-slow: 0.8s;
  --animation-curve: cubic-bezier(0.25, 0.1, 0.25, 1);
  
  /* Border Styles */
  --border-width-small: 2px;
  --border-width-medium: 2.5px;
  --border-width-large: 3px;
}

/* ====== RESET & BASE STYLES ====== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px));
  font-size: 16px;
  line-height: 1.6;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  color: var(--text-color);
  background-color: var(--background-color);
  overflow-x: hidden;
  min-height: 100%;
  transition: background-color var(--transition-speed), 
              color var(--transition-speed);
}

body.dark-mode {
  /* Remap shared theme variables to their dark values so every element using
     var(--text-color)/var(--background-secondary)/var(--border-color) stays
     readable in dark mode site-wide (fixes white-on-white pills/boxes). */
  --text-color: var(--dark-text-color);
  --text-color-light: var(--dark-text-color-light);
  --background-color: var(--dark-background-color);
  --background-secondary: var(--dark-background-secondary);
  --border-color: var(--dark-border-color);

  color: var(--dark-text-color);
  background-color: var(--dark-background-color);
}

img {
  max-width: 100%;
  height: auto;
}

/* ====== TYPOGRAPHY ====== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.2;
  margin-bottom: 0.75em;
  font-weight: 600;
  transition: color var(--transition-speed);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: color var(--transition-speed), 
              background-color var(--transition-speed);
}

a:hover {
  color: var(--primary-color);
}

body.dark-mode a {
  color: var(--dark-text-color);
}

body.dark-mode a:hover {
  color: var(--primary-color);
}

/* ====== LAYOUT & CONTAINERS ====== */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.container-fluid {
  width: 100%;
  padding: 0 20px;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Enhanced Sections */
section {
  padding: var(--section-padding);
  scroll-margin-top: 80px; /* For smooth scrolling with fixed header */
  position: relative;
  overflow: hidden; /* Prevent potential layout issues */
  transition: background-color 0.3s ease;
}

/* Section divider for better visual separation */
section:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  width: 70%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color) 20%, var(--border-color) 80%, transparent);
  opacity: 0.6;
}

/* Enhanced section title */
.section-title {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  display: inline-block;
  text-align: center;
  width: 100%;
  font-weight: 700;
  letter-spacing: -0.02em;
  transform: translateZ(0); /* Hardware acceleration for smoother rendering */
  backface-visibility: hidden;
}

/* Improved underline effect */
.section-title::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-color-hover));
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Active section indicator */
section.active .section-title::after {
  width: 140px;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

/* Enhanced subtitle styling */
.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-color-light);
  max-width: 700px;
  margin: 1.5rem auto 40px;
  text-align: center;
  line-height: 1.6;
  font-weight: 400;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

/* Hover interactions for better UX */
section:hover .section-subtitle {
  opacity: 1;
}

section:hover .section-title::after {
  width: 140px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

/* Dark mode adjustments with smoother transitions */
body.dark-mode .section-title {
  color: var(--dark-text-color);
}

body.dark-mode .section-subtitle {
  color: var(--dark-text-color-light);
}

body.dark-mode section:not(:last-child)::after {
  background: linear-gradient(90deg, transparent, var(--dark-border-color) 20%, var(--dark-border-color) 80%, transparent);
}

/* Ensure proper spacing for section content */
.section-content {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js-enhanced .section-content {
  opacity: 1;
  transform: translateY(20px);
}

.js-enhanced section.visible .section-content {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
  .js-enhanced .section-content {
    opacity: 1;
    transform: none;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .section-title {
    font-size: 2.2rem;
  }
  
  .section-title::after {
    width: 80px;
    height: 3px;
  }
  
  section:hover .section-title::after,
  section.active .section-title::after {
    width: 120px;
  }
  
  .section-subtitle {
    font-size: 1rem;
    margin: 1.2rem auto 30px;
  }
}

/* For users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  section, .section-title, .section-title::after, .section-subtitle, .section-content {
    transition: none !important;
    transform: none !important;
  }
}

/* ====== NAVIGATION ====== */
.navbar {
  background-color: var(--background-color);
  padding: max(15px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 15px
    max(16px, env(safe-area-inset-left, 0px));
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
}

.navbar.scrolled {
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background-color: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

/* Navbar uses full width (not the 1200px container) so all links fit at 100% zoom */
.navbar > .container.nav-container {
  max-width: 100%;
  padding: 0 24px;
}

.nav-container {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
}

/* Logo pinned to the left */
.nav-container .logo-container {
  flex: 0 0 auto;
}

/* Menu fills the rest of the bar and centers within it.
   flex-basis must be auto (not 0) and min-width 0, otherwise Safari/WebKit
   collapses this nested wrapping flex container to min-content (one link wide)
   and the links stack vertically and overlap. */
.nav-links {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: wrap;
  gap: clamp(0.35rem, 0.85vw, 1.1rem);
  align-items: center;
  justify-content: center;
  row-gap: 0.4rem;
}

.nav-links a {
  color: var(--text-color);
  position: relative;
  padding: 5px 0;
  font-size: clamp(0.72rem, 0.92vw, 0.9rem);
  white-space: nowrap;
}

/* Show only the gem logo — hide the "PARTH PATEL." wordmark in the navbar */
.navbar .logo-container .name-reveal {
  display: none !important;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s;
}

.nav-links a:hover::after, 
.nav-links a.active::after {
  width: 100%;
}

/* Dark mode navbar styles */
body.dark-mode .navbar {
  background-color: var(--dark-background-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark-mode .navbar.scrolled {
  background-color: rgba(34, 34, 34, 0.95);
}

body.dark-mode .nav-links a {
  color: var(--dark-text-color);
}

/* Mobile menu button — teal glass pill in enhancements.css */
.menu-btn,
.mini-bar-menu-btn {
  display: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 2000;
  border: none;
  background: none;
  font: inherit;
  line-height: 1;
  flex-shrink: 0;
}

/* Logo Styles */
.logo-container {
  display: flex;
  align-items: center;
  position: relative;
}

.logo {
  position: relative;
  display: inline-block;
  cursor: pointer;
  transition: transform 0.3s;
}

.logo:hover {
  transform: scale(1.05);
}

#logoSVG {
  width: 50px;
  height: 50px;
}

.name-reveal {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--text-color-light);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.logo:hover + .name-reveal {
  opacity: 1;
}

.letter-highlight {
  opacity: 0;
  font-size: 16px;
  font-weight: bold;
  color: var(--logo-color);
  transition: opacity 0.3s;
}

/* ====== SIDEBAR ====== */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background-color: #222;
  color: #fff;
  overflow-y: auto;
  z-index: var(--z-popup);
  padding: 20px;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1500;
}

.sidebar.active {
  transform: translateX(0);
  box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 992px) {
  .sidebar {
    width: min(var(--sidebar-width), 88vw);
    max-width: 100%;
    padding-top: max(20px, env(safe-area-inset-top, 0px));
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .overlay.active {
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
}

.sidebar-about {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-about .title {
  font-size: 1.5rem;
  margin-bottom: 5px;
  font-weight: 600;
}

.sidebar-about .subtitle {
  font-size: 0.9rem;
  opacity: 0.7;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.sidebar li {
  margin-bottom: 2px;
}

.sidebar ul a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #fff;
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
}

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

.sidebar ul a:hover::before {
  left: 100%;
}

.sidebar ul a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.sidebar li a.active {
  background-color: rgba(255, 255, 255, 0.15);
  border-left: 3px solid white;
  font-weight: bold;
}

.sidebar i {
  margin-right: 10px;
  width: 20px;
  text-align: center;
  transition: transform 0.2s;
}

.sidebar a:hover i {
  transform: scale(1.2);
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 30px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s, background-color 0.3s;
  z-index: 1600;
}

.close-btn:hover {
  transform: rotate(90deg);
  background-color: rgba(255, 255, 255, 0.3);
}

.sidebar-footer {
  text-align: center;
  font-size: 0.8rem;
  padding: 20px 0;
  opacity: 0.7;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1400;
}

.overlay.active {
  visibility: visible;
  opacity: 1;
}

/* Sidebar + overlay = mobile/tablet only; desktop uses top navbar links */
@media (min-width: 993px) {
  .sidebar,
  .overlay {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .menu-btn,
  .mini-bar-menu-btn {
    display: none !important;
  }
}

/* Theme Toggle — glossy icon sits in a teal glass pill (see enhancements.css) */
.theme-toggle,
[data-theme-toggle],
#dark-mode-toggle {
  font-size: 20px;
  cursor: pointer;
  color: var(--text-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.dark-mode .theme-toggle,
body.dark-mode [data-theme-toggle],
body.dark-mode #dark-mode-toggle {
  color: var(--dark-text-color);
}

/* ====== HERO SECTION ====== */
.hero {
  background-color: #0a1628;
  background-image: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  text-align: center;
  padding: 150px 20px 100px;
  position: relative;
  overflow: hidden;
  margin-top: 60px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  animation: fadeIn 1s ease-out;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero h1.logo-cyber-glitch {
  text-shadow: none;
}

.hero p {
  font-size: 1.5rem;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.9;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-buttons {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
  z-index: 2;
  cursor: pointer;
  font-size: 1.5rem;
  border: none;
  background: transparent;
  color: inherit;
  padding: 8px 12px;
  line-height: 1;
}

.hero-scroll-indicator:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
}

.bg-transitioning {
  animation: fadeTransition 1s ease-in-out;
}

/* Typewriter effect */
#typewriter::after {
  content: '|';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typewriter-done::after {
  animation: blink 1s step-end infinite;
}

/* ====== BUTTONS ====== */
.btn,
.button {
  background-color: var(--primary-color);
  color: white;
  padding: 12px 25px;
  border-radius: 50px;
  text-decoration: none;
  display: inline-block;
  font-weight: bold;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before,
.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.7s;
  z-index: -1;
}

.btn:hover,
.button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
  background-color: var(--primary-color-hover);
  color: white;
}

.btn:hover::before,
.button:hover::before {
  left: 100%;
}

.btn-outline {
  background-color: transparent;
  border: 2px solid white;
  color: white;
  box-shadow: none;
}

.btn-outline:hover {
  background-color: white;
  color: var(--primary-color);
}

/* Button Group Styles */
.buttons.has-addons {
  display: flex;
  margin: 0.75rem 0;
  position: relative;
  align-items: center;
  justify-content: center;
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
}

.buttons.has-addons .button {
  margin: 0;
  border-radius: 0;
  border: 1px solid var(--border-color);
  background-color: var(--background-color);
  color: var(--text-color);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  box-shadow: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.buttons.has-addons .button:first-child {
  border-top-left-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
}

.buttons.has-addons .button:last-child {
  border-top-right-radius: var(--border-radius);
  border-bottom-right-radius: var(--border-radius);
}

.buttons.has-addons .button:not(:last-child) {
  border-right: none;
}

.buttons.has-addons .button:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  z-index: 1;
}

body.dark-mode .buttons.has-addons .button {
  background-color: var(--dark-background-secondary);
  color: var(--dark-text-color);
  border-color: var(--dark-border-color);
}

body.dark-mode .buttons.has-addons .button:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ====== ABOUT SECTION ====== */
.about-section {
  background-color: var(--background-secondary);
  padding: 80px 0;
}

body.dark-mode .about-section {
  background-color: var(--dark-background-secondary);
}

.about-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 60px;
  align-items: flex-start;
}

/* Profile Card */
.profile-card,
.profile-card-animated {
  flex: 0 0 300px;
  background-color: var(--background-color);
  box-shadow: var(--box-shadow);
  padding: 30px;
  text-align: center;
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
  transition: var(--hover-transition);
}

body.dark-mode .profile-card,
body.dark-mode .profile-card-animated {
  background-color: var(--dark-background-color);
}

.profile-card-animated:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow-hover);
}

.profile-image-container {
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
  background-color: var(--background-secondary);
  border-radius: 50%;
  overflow: hidden;
}

body.dark-mode .profile-image-container {
  background-color: var(--dark-background-secondary);
}

.profile-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text-color);
}

.profile-divider {
  width: 40px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 15px auto;
}

.profile-title {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-color-light);
  margin-bottom: 20px;
}

/* About Content */
.about-content {
  flex: 1;
  min-width: 300px;
}

.about-heading {
  font-size: 4rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-color);
}

.about-subheading {
  font-size: 1.2rem;
  color: var(--text-color-light);
  margin-bottom: 30px;
}

.about-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.about-skills li {
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  background: rgba(0, 229, 204, 0.06);
}

body.dark-mode .about-skills li {
  border-color: var(--dark-border-color);
  color: var(--dark-text-color);
  background: rgba(0, 229, 204, 0.1);
}

.about-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 30px;
}

.about-cta-secondary {
  padding: 10px 22px;
  font-size: 0.95rem;
}

.about-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-color);
}

.about-text p {
  margin-bottom: 20px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* SVG Animation Styles for Cards */
.profile-card-animated svg,
.project-card-animated svg,
.blog-card-animated svg,
.resource-card-animated svg,
.contact-item-animated svg,
.resume-btn-animated svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.profile-card-animated svg rect,
.project-card-animated svg rect,
.blog-card-animated svg rect,
.resource-card-animated svg rect,
.contact-item-animated svg rect,
.resume-btn-animated svg rect {
  stroke: var(--primary-color);
  stroke-width: var(--border-width-medium);
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  transition: stroke-dashoffset var(--animation-speed-medium) var(--animation-curve);
  fill: transparent;
}

.profile-card-animated:hover svg rect,
.project-card-animated:hover svg rect,
.blog-card-animated:hover svg rect,
.resource-card-animated:hover svg rect,
.contact-item-animated:hover svg rect,
.resume-btn-animated:hover svg rect {
  stroke-dashoffset: 0;
}

/* Resume Button Animation */
.resume-btn-animated {
  display: inline-block;
  position: relative;
  padding: 12px 25px;
  background-color: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  overflow: hidden;
}

.resume-btn-animated:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-5px);
}

.resume-btn-animated svg rect {
  stroke: var(--primary-color);
  stroke-width: var(--border-width-small);
  stroke-dasharray: 200, 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset var(--animation-speed-fast) var(--animation-curve);
  fill: transparent;
}

/* Ensure content is above SVG animations */
.profile-card-content,
.project-card-content,
.blog-card-content,
.resource-card-content,
.contact-item-content {
  position: relative;
  z-index: 2;
}

/* ====== PROJECTS SECTION ====== */
.projects-section {
  padding: 80px 0;
  background-color: var(--background-color);
}

body.dark-mode .projects-section {
  background-color: var(--dark-background-color);
}

.projects-filter-toolbar {
  margin-bottom: 28px;
}

.projects-filter-status {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color-light);
  margin: 14px 0 0;
  min-height: 1.4em;
}

body.dark-mode .projects-filter-status {
  color: var(--dark-text-color-light, rgba(255, 255, 255, 0.65));
}

.projects-empty {
  text-align: center;
  color: var(--text-color-light);
  margin: 0 0 24px;
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  border: 1px dashed var(--border-color);
  background: rgba(0, 0, 0, 0.03);
}

body.dark-mode .projects-empty {
  color: var(--dark-text-color-light, rgba(255, 255, 255, 0.7));
  border-color: var(--dark-border-color);
  background: rgba(255, 255, 255, 0.04);
}

.filter-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0;
}

.projects-section .filter-buttons {
  margin-bottom: 0;
}

.filter-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  padding: 8px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
}

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

.filter-btn:hover,
.filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-3px);
}

body.dark-mode .filter-btn {
  border-color: var(--dark-border-color);
  color: var(--dark-text-color);
}

body.dark-mode .filter-btn:hover,
body.dark-mode .filter-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

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

.project-card-animated.is-filter-hidden,
.blog-card-animated.is-filter-hidden,
.resource-card-animated.is-filter-hidden {
  display: none !important;
}

.resources-toolbar {
  max-width: 520px;
  margin: 0 auto 20px;
}

.resources-search-label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: var(--text-color-light);
}

body.dark-mode .resources-search-label {
  color: var(--dark-text-color-light, rgba(255, 255, 255, 0.65));
}

.resources-search {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border-color);
  border-radius: 30px;
  font-size: 1rem;
  background: var(--background-color)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E")
    no-repeat 14px center / 18px 18px;
  color: var(--text-color);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.resources-search:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 229, 204, 0.2);
}

body.dark-mode .resources-search {
  background-color: var(--dark-background-color);
  border-color: var(--dark-border-color);
  color: var(--dark-text-color);
}

.resources-status {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color-light);
  margin: 12px 0 16px;
  min-height: 1.35em;
}

body.dark-mode .resources-status {
  color: var(--dark-text-color-light, rgba(255, 255, 255, 0.65));
}

.resources-empty {
  text-align: center;
  color: var(--text-color-light);
  margin: 0 0 20px;
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  border: 1px dashed var(--border-color);
}

body.dark-mode .resources-empty {
  border-color: var(--dark-border-color);
}

/* ====== SECTION BACKGROUND IMAGES ====== */
.section-has-bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.section-has-bg > .container,
.section-has-bg > .about-container {
  position: relative;
  z-index: 1;
}

.section-has-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: var(--section-bg-image-opacity, 0.18);
  pointer-events: none;
  z-index: 0;
}

.section-has-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    var(--section-bg-tint-top, rgba(255, 255, 255, 0.94)) 0%,
    var(--section-bg-tint-mid, rgba(249, 249, 249, 0.9)) 45%,
    var(--section-bg-tint-bottom, rgba(255, 255, 255, 0.96)) 100%
  );
  pointer-events: none;
  z-index: 0;
}

body.dark-mode .section-has-bg::after {
  --section-bg-tint-top: rgba(34, 34, 34, 0.94);
  --section-bg-tint-mid: rgba(42, 42, 42, 0.9);
  --section-bg-tint-bottom: rgba(34, 34, 34, 0.96);
}

.section-has-bg--network::before {
  background-image: none;
  background: radial-gradient(ellipse 80% 60% at 50% 40%, rgba(59, 107, 94, 0.12), transparent 70%);
}

.section-has-bg--hacking::before {
  background-image: url('../images/hacking_image1.png');
}

.section-has-bg--soft {
  --section-bg-image-opacity: 0.1;
}

.section-has-bg--accent {
  --section-bg-image-opacity: 0.22;
}

.section-has-bg--soft::after {
  --section-bg-tint-top: rgba(255, 255, 255, 0.97);
  --section-bg-tint-mid: rgba(255, 255, 255, 0.93);
  --section-bg-tint-bottom: rgba(255, 255, 255, 0.98);
}

body.dark-mode .section-has-bg--soft::after {
  --section-bg-tint-top: rgba(34, 34, 34, 0.97);
  --section-bg-tint-mid: rgba(34, 34, 34, 0.93);
  --section-bg-tint-bottom: rgba(34, 34, 34, 0.98);
}

.about-section.section-has-bg,
.projects-section.section-has-bg,
.blog-section.section-has-bg,
.learn-by-role-section.section-has-bg,
.resources-section.section-has-bg,
.contact-section.section-has-bg {
  background-color: transparent;
}

body.dark-mode .about-section.section-has-bg,
body.dark-mode .projects-section.section-has-bg,
body.dark-mode .blog-section.section-has-bg,
body.dark-mode .learn-by-role-section.section-has-bg,
body.dark-mode .resources-section.section-has-bg,
body.dark-mode .contact-section.section-has-bg {
  background-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  .section-has-bg::before {
    opacity: calc(var(--section-bg-image-opacity, 0.18) * 0.85);
  }
}

/* Learn by career role */
.learn-by-role-section {
  padding: 80px 0;
  background: var(--background-secondary);
}

body.dark-mode .learn-by-role-section {
  background: var(--dark-background-secondary);
}

.learn-topic-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.learn-topic-btn {
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  background: var(--background-color);
  color: var(--text-color);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.learn-topic-btn:hover,
.learn-topic-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

body.dark-mode .learn-topic-btn {
  background: var(--dark-background-color);
  border-color: var(--dark-border-color);
  color: var(--dark-text-color);
}

.learn-topic-status {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color-light);
  margin-bottom: 20px;
  min-height: 1.3em;
}

.learn-grid-label {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  margin: 8px 0 14px;
  color: var(--text-color-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.dark-mode .learn-grid-label {
  color: var(--dark-text-color-light, rgba(255, 255, 255, 0.65));
}

.learn-by-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.learn-by-role-grid--topics {
  margin-bottom: 8px;
}

.learn-role-card.is-filter-hidden {
  display: none !important;
}

.learn-role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--background-color);
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

body.dark-mode .learn-role-card {
  background: var(--dark-background-color);
  border-color: var(--dark-border-color);
  color: var(--dark-text-color);
}

.learn-role-card i {
  font-size: 1.4rem;
  color: var(--primary-color);
}

.learn-role-card.cloud i {
  color: #3b82f6;
}

.learn-role-card.ai i {
  color: #8b5cf6;
}

.learn-role-card.emerging i {
  color: #06b6d4;
}

.learn-role-card.security i {
  color: #10b981;
}

.learn-role-card:hover,
.learn-role-card.is-selected {
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--box-shadow);
}

.role-learning-detail {
  margin-top: 8px;
  padding: 24px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background: var(--background-color);
  text-align: left;
}

body.dark-mode .role-learning-detail {
  background: var(--dark-background-color);
  border-color: var(--dark-border-color);
}

.role-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.role-detail-head h3 {
  margin: 0;
  font-size: 1.35rem;
}

.role-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.role-detail-intro {
  color: var(--text-color-light);
  margin: 0 0 16px;
  line-height: 1.6;
}

body.dark-mode .role-detail-intro {
  color: var(--dark-text-color-light, rgba(255, 255, 255, 0.7));
}

.role-picks-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: grid;
  gap: 8px;
}

.role-pick {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  font-size: 0.95rem;
}

body.dark-mode .role-pick {
  background: rgba(255, 255, 255, 0.05);
}

.role-pick-type {
  display: inline-block;
  min-width: 4.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-color);
  margin-right: 8px;
}

.role-pick a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.role-portfolio-links h4 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.role-section-links {
  padding-left: 1.2rem;
  margin: 0;
}

.role-section-links a {
  color: var(--primary-color);
}

.learn-by-role-foot {
  text-align: center;
  margin-top: 20px;
  font-size: 0.95rem;
}

.learn-by-role-foot a {
  color: var(--primary-color);
}

.blog-filter-toolbar {
  margin-bottom: 28px;
}

.blog-filter-status {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color-light);
  margin: 14px 0 0;
  min-height: 1.4em;
}

body.dark-mode .blog-filter-status {
  color: var(--dark-text-color-light, rgba(255, 255, 255, 0.65));
}

.blog-empty {
  text-align: center;
  color: var(--text-color-light);
  margin: 0 0 24px;
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius);
  border: 1px dashed var(--border-color);
  background: rgba(0, 0, 0, 0.03);
}

body.dark-mode .blog-empty {
  color: var(--dark-text-color-light, rgba(255, 255, 255, 0.7));
  border-color: var(--dark-border-color);
  background: rgba(255, 255, 255, 0.04);
}

.project-card,
.project-card-animated {
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  position: relative;
  transition: all 0.3s;
  border: 1px solid var(--border-color);
}

body.dark-mode .project-card,
body.dark-mode .project-card-animated {
  background-color: var(--dark-background-color);
  border-color: var(--dark-border-color);
}

.project-card-animated:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow-hover);
}

.project-image {
  height: 200px;
  overflow: hidden;
}

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

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

.card-content {
  padding: 20px;
}

.card-content h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

body.dark-mode .card-content h3 {
  color: var(--dark-text-color);
}

.card-content p {
  color: var(--text-color-light);
  margin-bottom: 15px;
}

body.dark-mode .card-content p {
  color: var(--dark-text-color-light);
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.card-tag {
  background-color: var(--background-secondary);
  color: var(--text-color);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
}

body.dark-mode .card-tag {
  background-color: var(--dark-background-secondary);
  color: var(--dark-text-color);
}

.view-project {
  color: var(--primary-color);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.3s;
}

.view-project:hover {
  gap: 8px;
}

/* ====== BLOG SECTION ====== */
.blog-section {
  padding: 80px 0;
  background-color: var(--background-secondary);
}

body.dark-mode .blog-section {
  background-color: var(--dark-background-secondary);
}

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

.blog-card-animated {
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
  position: relative;
  transition: all 0.3s;
  border: 1px solid var(--border-color);
}

body.dark-mode .blog-card-animated {
  background-color: var(--dark-background-color);
  border-color: var(--dark-border-color);
}

.blog-card-animated:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow-hover);
}

.blog-img {
  height: 200px;
  overflow: hidden;
}

.blog-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.blog-card-animated:hover .blog-img img {
  transform: scale(1.05);
}

.blog-text {
  padding: 20px;
}

.blog-date {
  color: var(--text-color-light);
  font-size: 0.85rem;
  margin-bottom: 10px;
  display: block;
}

body.dark-mode .blog-date {
  color: var(--dark-text-color-light);
}

.blog-text h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.blog-text h3 a {
  color: var(--text-color);
  transition: color 0.3s;
}

.blog-text h3 a:hover {
  color: var(--primary-color);
}

body.dark-mode .blog-text h3 a {
  color: var(--dark-text-color);
}

.blog-text p {
  color: var(--text-color-light);
  margin-bottom: 15px;
}

body.dark-mode .blog-text p {
  color: var(--dark-text-color-light);
}

.read-more {
  color: var(--primary-color);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.3s;
}

.read-more:hover {
  gap: 8px;
}

/* ====== RESOURCES SECTION ====== */
.resources-section {
  padding: 80px 0;
  background-color: var(--background-color);
}

body.dark-mode .resources-section {
  background-color: var(--dark-background-color);
}

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

/* ====== RESOURCE CARD ====== */
.resource-card-animated {
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 25px;
  position: relative;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.resource-card-animated.has-resource-image {
  padding: 0;
}

.resource-card-animated.has-resource-image .resource-card-content {
  padding: 20px 25px 25px;
}

body.dark-mode .resource-card-animated {
  background-color: var(--dark-background-color);
  border-color: var(--dark-border-color);
}

/* ====== IMAGE STYLES ====== */
.resource-card-animated img.resource-image {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  object-fit: cover;
  border-radius: 0;
  margin: 0 0 16px;
  display: block;
}

.resource-card-animated.has-resource-image img.resource-image {
  max-height: none;
  margin: 0 0 18px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* ====== HOVER EFFECT ====== */
.resource-card-animated:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow-hover);
}

/* ====== CARD CONTENT ====== */
.resource-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.resource-card-content h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.resource-card-content h3 a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

.resource-card-content h3 a:hover {
  color: var(--primary-color);
}

body.dark-mode .resource-card-content h3 a {
  color: var(--dark-text-color);
}

.resource-card-content p {
  color: var(--text-color-light);
  margin-bottom: 15px;
  flex: 1;
}

body.dark-mode .resource-card-content p {
  color: var(--dark-text-color-light);
}

/* ====== RESOURCE TAG ====== */
.resource-tag {
  display: inline-block;
  background-color: var(--primary-color);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-bottom: 15px;
}

/* ====== BUTTONS SECTION ====== */
.resource-card-animated .buttons.has-addons {
  margin-top: auto;
}

/* ====== CONTACT SECTION ====== */
.contact-section {
  padding: 80px 0;
  background-color: var(--background-secondary);
}

body.dark-mode .contact-section {
  background-color: var(--dark-background-secondary);
}

/* Contact Information Grid */
.contact-info-container {
  margin-bottom: 50px;
}

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

.contact-item,
.contact-item-animated {
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  padding: 30px 20px;
  text-align: center;
  box-shadow: var(--box-shadow);
  position: relative;
  transition: all 0.3s;
  border: 1px solid var(--border-color);
}

body.dark-mode .contact-item,
body.dark-mode .contact-item-animated {
  background-color: var(--dark-background-color);
  border-color: var(--dark-border-color);
}

.contact-item-animated:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow-hover);
}

.contact-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.contact-item h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

body.dark-mode .contact-item h3 {
  color: var(--dark-text-color);
}

.contact-item p {
  color: var(--text-color-light);
  margin-bottom: 15px;
}

body.dark-mode .contact-item p {
  color: var(--dark-text-color-light);
}

.contact-link {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: none;
  padding: 5px 15px;
  border: 1px solid var(--primary-color);
  border-radius: 50px;
  transition: all 0.3s;
}

.contact-link:hover {
  background-color: var(--primary-color);
  color: white;
}

.contact-social {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.contact-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  transition: all 0.3s;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

body.dark-mode .contact-social a {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.contact-social a:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.contact-item-animated svg rect {
  stroke: var(--primary-color);
  stroke-width: var(--border-width-small);
  stroke-dasharray: 300, 300;
  stroke-dashoffset: 300;
  transition: stroke-dashoffset var(--animation-speed-fast) var(--animation-curve);
  fill: transparent;
}

/* Honeypot — off-screen, not display:none (bot trap) */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.contact-form-turnstile-wrap {
  min-height: 0;
}

.contact-form-turnstile-wrap:not([hidden]) {
  min-height: 68px;
}

.contact-form .error-hint {
  font-size: 0.9rem;
  margin-top: 8px;
  opacity: 0.9;
}

.contact-form-status:empty {
  display: none;
}

.contact-form button[type="submit"] .loading-spinner {
  margin-left: 8px;
}

.contact-form button[type="submit"] .loading-spinner[hidden] {
  display: none;
}

/* Contact Form */
.contact-form {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px;
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
}

body.dark-mode .contact-form {
  background-color: var(--dark-background-color);
  border-color: var(--dark-border-color);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group {
  position: relative;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

body.dark-mode .form-label {
  color: var(--dark-text-color);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-color);
  transition: border-color 0.3s, box-shadow 0.3s;
  background-color: var(--background-color);
}

body.dark-mode .form-input,
body.dark-mode .form-textarea {
  background-color: var(--dark-background-color);
  color: var(--dark-text-color);
  border-color: var(--dark-border-color);
}

.form-input:focus,
.form-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
  outline: none;
}

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

.form-group.error .form-input,
.form-group.error .form-textarea {
  border-color: var(--error-color);
  background-color: rgba(220, 53, 69, 0.05);
}

/* Real-time Contact Form Styles */
.required {
  color: var(--error-color);
  margin-left: 2px;
}

.success-message {
  display: flex;
  opacity: 0;
  padding: 20px;
  background-color: rgba(40, 167, 69, 0.1);
  border: 1px solid var(--success-color);
  color: var(--success-color);
  border-radius: var(--border-radius);
  margin-top: 20px;
  align-items: center;
  transform: translateY(-20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  max-height: 0;
  overflow: hidden;
  position: relative;
}

.success-message.active {
  opacity: 1;
  transform: translateY(0);
  max-height: 200px;
  animation: slideDown 0.3s forwards;
}

.success-icon {
  font-size: 2rem;
  margin-right: 15px;
  color: var(--success-color);
}

.success-content {
  flex: 1;
}

.success-content h4 {
  margin-bottom: 5px;
  font-size: 1.2rem;
}

.close-message {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.close-message:hover {
  opacity: 1;
}

@keyframes slideDown {
  0% {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    opacity: 0;
  }
  100% {
    max-height: 200px;
    padding: 20px;
    margin-top: 20px;
    opacity: 1;
  }
}

/* Form validation styling */
.form-input:focus, 
.form-textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.form-input.input-error, 
.form-textarea.input-error {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.form-input.input-valid, 
.form-textarea.input-valid {
  border-color: var(--success-color);
  box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

/* Validation icons */
.validation-icon {
  position: absolute;
  right: 10px;
  top: 38px; /* Adjust as needed to align with your inputs */
  pointer-events: none;
}

.form-input.input-valid ~ .validation-icon::before {
  content: '\f058'; /* Font Awesome check circle icon */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: var(--success-color);
  font-size: 16px;
}

.form-input.input-error ~ .validation-icon::before {
  content: '\f057'; /* Font Awesome times circle icon */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: var(--error-color);
  font-size: 16px;
}

.form-textarea.input-valid ~ .validation-icon::before {
  content: '\f058'; /* Font Awesome check circle icon */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: var(--success-color);
  font-size: 16px;
  position: absolute;
  top: 10px;
}

.form-textarea.input-error ~ .validation-icon::before {
  content: '\f057'; /* Font Awesome times circle icon */
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: var(--error-color);
  font-size: 16px;
  position: absolute;
  top: 10px;
}

.form-textarea ~ .validation-icon {
  top: 40px; /* Adjust for textarea */
}

/* Error message styling */
.error-message {
  color: var(--error-color);
  font-size: 0.85rem;
  margin-top: 5px;
  animation: fadeInDown 0.3s forwards;
  padding-left: 5px;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading button state */
.btn.loading {
  position: relative;
  cursor: wait;
}

.loading-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Error container for submission errors */
.error-container {
  display: flex;
  padding: 20px;
  background-color: rgba(220, 53, 69, 0.1);
  border: 1px solid var(--error-color);
  color: var(--error-color);
  border-radius: var(--border-radius);
  margin-top: 20px;
  align-items: center;
  position: relative;
  animation: slideDown 0.3s forwards;
}

.error-icon {
  font-size: 2rem;
  margin-right: 15px;
}

.error-content {
  flex: 1;
}

.error-content h4 {
  margin-bottom: 5px;
  font-size: 1.2rem;
}

body.dark-mode .error-container {
  background-color: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

/* ====== FOOTER ====== */
.footer {
  background-color: #222;
  color: white;
  padding: 60px 0 30px;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 40px;
}

.footer-logo {
  flex: 0 0 100%;
  max-width: 300px;
  margin-bottom: 30px;
}

.footer-logo h3 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.footer-logo p {
  opacity: 0.7;
}

.footer-links {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
}

.footer-links-column {
  flex: 0 0 auto;
  min-width: 160px;
}

.footer-links-column h4 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

.footer-links-column h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background-color: var(--primary-color);
}

.footer-links-column ul {
  list-style: none;
  padding: 0;
}

.footer-links-column ul li {
  margin-bottom: 10px;
}

.footer-links-column ul a {
  color: #ddd;
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
  opacity: 0.7;
}

.footer-links-column ul a:hover {
  color: white;
  opacity: 1;
  transform: translateX(5px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.copyright {
  opacity: 0.7;
  font-size: 0.9rem;
}

.footer .social-links {
  margin: 0;
  padding: 0;
  border-top: none;
}

.back-to-top a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
  transition: all 0.3s;
}

.back-to-top a:hover {
  background-color: var(--primary-color);
  transform: translateY(-5px);
}

/* ====== SOCIAL MEDIA LINKS ====== */
/* Enhanced Social Links Container */
.social-links,
.profile-social,
.contact-social {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  position: relative;
}

/* Base styling for all social media links */
.social-links a,
.profile-social a,
.contact-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #333;
  color: white;
  transition: all 0.3s;
  position: relative;
  overflow: visible;
}

/* Ensure icons are clearly visible */
.social-links a i,
.profile-social a i,
.contact-social a i {
  font-size: 1rem;
}

/* Simple hover effect */
.social-links a:hover,
.profile-social a:hover,
.contact-social a:hover {
  transform: translateY(-3px);
  background-color: #444;
}

/* Make footer social icons match the same style */
.footer .social-links a {
  background-color: #333;
  color: white;
}

body.dark-mode .profile-social a,
body.dark-mode .contact-social a {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--dark-text-color);
}

/* Hover and focus states */
.social-links a:hover,
.profile-social a:hover,
.contact-social a:hover,
.social-links a:focus,
.profile-social a:focus,
.contact-social a:focus {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Platform-specific colors on hover/focus */
a[href*="linkedin.com"]:hover,
a[href*="linkedin.com"]:focus {
  background-color: #0077b5 !important;
  color: white !important;
}

a[href*="github.com"]:hover,
a[href*="github.com"]:focus {
  background-color: #333 !important;
  color: white !important;
}

a[href*="x.com"]:hover,
a[href*="x.com"]:focus,
a[href*="twitter.com"]:hover,
a[href*="twitter.com"]:focus {
  background-color: #000000 !important;
  color: white !important;
}

a[href*="instagram.com"]:hover,
a[href*="instagram.com"]:focus {
  background-color: #e1306c !important;
  color: white !important;
}

a[href*="facebook.com"]:hover,
a[href*="facebook.com"]:focus {
  background-color: #1877f2 !important;
  color: white !important;
}

/* Social link animation */
.social-links a:hover i,
.profile-social a:hover i,
.contact-social a:hover i,
.social-links a:focus i,
.profile-social a:focus i,
.contact-social a:focus i {
  animation: socialBounce 0.4s;
}

@keyframes socialBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ====== SCROLL INDICATOR & NAVIGATION ====== */
.bottom-scrollbar-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-fixed);
  background-color: rgba(0, 0, 0, 0.05);
  height: 30px;
  display: flex;
  flex-direction: column;
}

.scroll-indicator {
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 0;
  transition: width 0.2s;
}

.scroll-nav {
  display: flex;
  justify-content: center;
  gap: 20px;
  height: 26px;
  background-color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .scroll-nav {
  background-color: rgba(34, 34, 34, 0.9);
}

.scroll-nav-item {
  background: none;
  border: none;
  padding: 0 10px;
  font-size: 0.8rem;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
}

body.dark-mode .scroll-nav-item {
  color: var(--dark-text-color);
}

.scroll-nav-item.active,
.scroll-nav-item:hover {
  color: var(--primary-color);
  font-weight: bold;
}

/* Back to top button */
#back-to-top {
  position: fixed;
  bottom: 40px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 50;
}

#back-to-top.active {
  opacity: 1;
  transform: translateY(0);
}

#back-to-top:hover {
  background-color: var(--primary-color-hover);
  transform: translateY(-5px);
}

/* ====== ANIMATIONS ====== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-20px) translateX(-50%);
  }
  60% {
    transform: translateY(-10px) translateX(-50%);
  }
}

@keyframes fadeTransition {
  0% { opacity: 0.3; }
  100% { opacity: 1; }
}

/* SVG animation */
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ====== ACCESSIBILITY & RESPONSIVE DESIGN ====== */
/* Focus styles for better accessibility */
a:focus,
button:focus,
input:focus,
textarea:focus,
select:focus,
[tabindex]:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Skip to content link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

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

/* Tooltip functionality */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  min-width: 120px;
  max-width: 200px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 12px;
  position: absolute;
  z-index: 100;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  font-size: 0.8rem;
  pointer-events: none;
  white-space: nowrap;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Reduced motion preferences */
@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;
  }
  
  .profile-card-animated svg rect,
  .project-card-animated svg rect,
  .blog-card-animated svg rect,
  .resource-card-animated svg rect,
  .contact-item-animated svg rect,
  .resume-btn-animated svg rect {
    transition: none !important;
    stroke-dashoffset: 0 !important;
  }
  
  .profile-card-animated:hover,
  .project-card-animated:hover,
  .blog-card-animated:hover,
  .resource-card-animated:hover,
  .contact-item-animated:hover {
    transform: none !important;
  }
  
  .project-image img:hover,
  .blog-img img:hover {
    transform: none !important;
  }
  
  .hero-scroll-indicator {
    animation: none !important;
  }
}

/* ====== RESPONSIVE DESIGN ====== */
/* Responsive breakpoints */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  
  .hero h1 { font-size: 3rem; }
  .hero p { font-size: 1.2rem; }
  .section-title { font-size: 2.2rem; }
  
  /* Adjust font sizes for better readability on medium screens */
  html { font-size: 15px; }
}

@media (max-width: 992px) {
  /* Hide desktop links only — keep theme toggle + hamburger visible (parent was display:none) */
  .nav-links {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: flex-end;
    align-items: center;
  }

  .nav-links > a.nav-link {
    display: none;
  }

  .nav-links .theme-toggle,
  .nav-links .menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .menu-btn {
    display: flex;
  }

  .nav-container {
    justify-content: space-between;
  }
  
  .about-container { justify-content: center; }
  
  .profile-card, 
  .profile-card-animated {
    flex: 0 0 100%;
    max-width: 350px;
    margin-bottom: 30px;
  }
  
  .about-content {
    text-align: center;
  }
  
  .about-buttons {
    justify-content: center;
  }
  
  .footer-logo {
    flex: 0 0 100%;
    max-width: 100%;
    text-align: center;
    margin-bottom: 30px;
  }
  
  .footer-links {
    flex: 0 0 100%;
    justify-content: space-around;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  /* Optimize for touch devices at this breakpoint */
  .profile-social a,
  .contact-social a,
  .social-links a,
  .btn,
  .button,
  .view-project,
  .read-more {
    padding: 10px;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* More space between items for touch targets */
  .card-tags {
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .grid-3, .grid-4 { 
    grid-template-columns: repeat(2, 1fr); 
  }
  
  .projects-container,
  .blog-container,
  .resources-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  
  .section-title { font-size: 2rem; }
  .about-heading { font-size: 3rem; }
  .hero h1 { font-size: 2.5rem; }
  .hero p { font-size: 1rem; }
  
  .contact-form { padding: 30px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: auto; }
  
  .contact-info-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  /* Simplify layout for mobile */
  .bottom-scrollbar-container { display: none; }
  
  /* Enhance mobile navigation experience */
  .navbar {
    height: 60px;
  }
  
  .menu-btn {
    margin-right: 0;
  }
  
  .logo-container {
    margin-left: 0;
  }
  
  /* Adjust padding for scrolling with fixed header */
  section {
    scroll-margin-top: 60px;
  }
}

@media (max-width: 576px) {
  .grid-2, .grid-3, .grid-4 { 
    grid-template-columns: 1fr; 
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 15px;
  }
  
  .hero-buttons .btn { width: 100%; }
  
  .buttons.has-addons {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .buttons.has-addons .button {
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
  }
  
  .profile-card-animated,
  .project-card-animated,
  .blog-card-animated,
  .resource-card-animated,
  .contact-item-animated {
    padding: 20px;
  }
  
  .about-heading { font-size: 2.5rem; }
  .about-subheading { font-size: 1rem; }
  
  .profile-image-container {
    width: 150px;
    height: 150px;
  }
  
  .resume-btn-animated {
    width: 100%;
    text-align: center;
  }
  
  .section-title { font-size: 1.8rem; }
  .contact-form { padding: 20px; }
  
  #back-to-top {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
  }
  
  .social-links,
  .profile-social,
  .contact-social {
    gap: 10px;
  }
  
  .social-links a,
  .profile-social a,
  .contact-social a {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
  
  /* Improve mobile typography */
  html { font-size: 14px; }
  
  /* Better spacing for mobile */
  section {
    padding: 60px 15px;
  }
  
  /* Simplify animations on small screens for better performance */
  .profile-card-animated:hover,
  .project-card-animated:hover,
  .blog-card-animated:hover,
  .resource-card-animated:hover,
  .contact-item-animated:hover {
    transform: translateY(-5px); /* Reduced animation */
  }
}

/* Print styles */
@media print {
  .sidebar,
  .navbar,
  .bottom-scrollbar-container,
  #back-to-top,
  .theme-toggle,
  .menu-btn,
  .filter-buttons,
  .hero-buttons,
  .hero-scroll-indicator,
  .social-links,
  .footer {
    display: none !important;
  }
  
  body,
  .section,
  .container,
  .content-section {
    margin: 0;
    padding: 0 !important;
    width: 100%;
    color: #000 !important;
    background-color: #fff !important;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }
  
  img, table, pre, blockquote {
    page-break-inside: avoid;
  }
  
  a {
    color: #000 !important;
    text-decoration: underline;
  }
  
  /* Print URLs after links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
  
  /* Don't print URLs for internal links and JavaScript */
  a[href^="#"]:after,
  a[href^="javascript:"]:after {
    content: "";
  }
}

/* High contrast mode support */
@media (forced-colors: active) {
  .social-links a,
  .profile-social a,
  .contact-social a {
    border: 2px solid CanvasText;
  }
  
  .social-links a:hover,
  .profile-social a:hover,
  .contact-social a:hover,
  .social-links a:focus,
  .profile-social a:focus,
  .contact-social a:focus {
    border-color: Highlight;
  }
  
  .btn, .button, .contact-link, .view-project, .read-more {
    border: 2px solid CanvasText;
  }
  
  /* Ensure form elements have good focus indicators */
  input:focus, 
  textarea:focus, 
  select:focus, 
  button:focus {
    outline: 2px solid Highlight;
  }
}
