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

/* ====== CSS VARIABLES ====== */
:root {
  /* Color Palette */
  --primary-color: #0d6efd;
  --primary-color-hover: #0b5ed7;
  --secondary-color: #6c757d;
  --accent-color: #ff6b6b;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  --info-color: #17a2b8;
  --logo-color: #FF4500;

  /* UI Colors */
  --text-color: #333;
  --text-color-light: #6c757d;
  --background-color: #fff;
  --background-secondary: #f9f9f9;
  --border-color: #e0e0e0;

  /* Dark Theme Colors */
  --dark-text-color: #eee;
  --dark-text-color-light: #aaa;
  --dark-background-color: #222;
  --dark-background-secondary: #2a2a2a;
  --dark-border-color: #444;

  /* 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-family-base: 'PT Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-monospace: 'Consolas', 'Monaco', 'Courier New', 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);

  /* Modern CSS features */
  --backdrop-blur: blur(10px);
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);

  /* 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;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Modern CSS features */
  scroll-padding-top: 80px;
  scrollbar-width: thin;
  scrollbar-color: var(--primary-color) transparent;
}

/* Modern scrollbar styling for webkit browsers */
html::-webkit-scrollbar {
  width: 8px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  background-color: var(--primary-color);
  border-radius: 4px;
}

html::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-color-hover);
}

body {
  font-family: var(--font-family-base);
  color: var(--text-color);
  background-color: var(--background-color);
  overflow-x: hidden;
  transition: background-color var(--transition-speed),
              color var(--transition-speed);
  /* Modern CSS features */
  overscroll-behavior: contain;
  -webkit-tap-highlight-color: transparent;
  /* Improve font rendering */
  font-feature-settings: "kern" 1, "liga" 1;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  /* Performance optimizations */
  will-change: scroll-position;
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}

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

/* ====== 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); }

/* Sections */
section {
  padding: var(--section-padding);
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.5px;
  /* Title only takes up text width, not full container width */
  /* This allows underline to center below the text */
}

/* Center the section title in its container */
.container > .section-title,
section > .container > .section-title {
  /* Keep as inline-block so it only takes text width */
  /* Container's text-align: center will center it */
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
  border-radius: 2px;
  /* This will now center relative to the text width, not container width */
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-color-light);
  max-width: 700px;
  margin: 0 auto 40px;
  text-align: center;
  line-height: 1.7;
  font-weight: 400;
}

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

/* ====== NAVIGATION ====== */
.navbar {
  background-color: var(--background-color);
  padding: 15px 0;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 10000 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* Performance optimization */
  will-change: transform, background-color;
  transform: translateZ(0);
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  /* Safari fix - ensure clickable */
  pointer-events: auto !important;
  -webkit-transform: translateZ(0);
  /* Ensure navbar stays fixed at top */
  margin: 0 !important;
  max-width: none !important;
}

.navbar.scrolled {
  padding: 10px 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  -webkit-display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
  pointer-events: auto !important;
  z-index: 10001 !important;
  position: relative;
}

.nav-links a {
  color: var(--text-color);
  position: relative;
  padding: 5px 0;
  pointer-events: auto !important;
  cursor: pointer !important;
  z-index: 10002 !important;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

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

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

/* 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);
}

/* Menu button styles */
.menu-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  display: none;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 8px;
  margin: 5px;
  cursor: pointer;
  position: relative;
  z-index: 2000;
  border-radius: 5px;
}

.menu-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

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

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

.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;
  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);
}

.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: 20px;
  right: 20px;
  width: 35px;
  height: 35px;
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 24px;
  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-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 15px 20px;
  opacity: 0.5;
}

.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.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1400;
}

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

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 8px;
  margin: 5px;
  border-radius: 5px;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s, background-color 0.3s, border-color 0.3s;
}

.theme-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: scale(1.1);
}

body.dark-mode .theme-toggle {
  color: var(--dark-text-color);
  border-color: var(--dark-border-color);
}

.theme-toggle:hover {
  transform: rotate(360deg);
  background-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode .theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ====== HERO SECTION ====== */
.hero {
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-color: #1a1a2e; /* Fallback dark background */
  background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Fallback gradient */
  color: white;
  text-align: center;
  padding: 150px 20px 100px;
  position: relative;
  overflow: hidden;
  margin-top: 60px;
  min-height: 100vh;
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  visibility: visible !important;
  opacity: 1 !important;
  /* Performance optimization */
  will-change: transform;
  transform: translateZ(0);
}

/* Video background styling - OPTIMIZED */
#hero-background-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%) translateZ(0); /* Hardware acceleration */
  z-index: 0;
  object-fit: cover;
  pointer-events: none;
  will-change: opacity; /* Performance hint */
  backface-visibility: hidden; /* Smooth rendering */
  -webkit-backface-visibility: hidden;
  /* Optimize for large files */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* Reduce video quality on mobile for performance */
@media (max-width: 768px) {
  #hero-background-video {
    /* Lower quality on mobile to save bandwidth */
    image-rendering: auto;
  }
}

/* Video loading state */
#hero-background-video:not(.video-ready) {
  opacity: 0;
  transition: opacity 0.5s ease-in;
}

#hero-background-video.video-ready {
  opacity: 1;
}

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

.hero-content {
  position: relative;
  z-index: 2;
  animation: fadeInUp 1s ease-out;
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
  /* Performance optimization */
  will-change: transform, opacity;
}

/* Ensure video doesn't interfere with content */
.hero video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  transform: translateZ(0);
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 700;
  letter-spacing: -1px;
  animation: fadeInUp 1s ease-out;
  color: white !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
}

.hero p {
  font-size: 1.5rem;
  margin-bottom: 30px;
  max-width: 700px;
  font-weight: 500;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
  margin-left: auto;
  margin-right: auto;
  opacity: 1 !important;
  color: white !important;
  visibility: visible !important;
  display: block !important;
  animation: fadeInUp 1.2s ease-out 0.2s both;
}

.hero-buttons {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 1rem;
  animation: fadeInUp 1.4s ease-out 0.4s both;
}

.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;
}

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

/* ====== BUTTONS ====== */
.btn,
.button {
  background-color: var(--primary-color);
  color: white;
  padding: 12px 25px;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-decoration: none;
  display: inline-block;
  font-weight: bold;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  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;
  /* Performance optimization */
  will-change: transform;
  transform: translateZ(0);
}

.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-buttons {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
}

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

.about-text p {
  margin-bottom: 20px;
  line-height: 1.8;
  font-size: 1.05rem;
  text-align: justify;
}

.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 {
  stroke: var(--primary-color);
  stroke-width: var(--border-width-medium);
  stroke-dasharray: 800, 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);
}

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

.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: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: 40px;
}

.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) scale(1.02);
  box-shadow: var(--box-shadow-hover);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
  border-color: var(--primary-color);
}

.project-image {
  height: 200px;
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  position: relative;
}

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

.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;
}

.project-card-animated svg rect {
  stroke: var(--primary-color);
  stroke-width: var(--border-width-medium);
  stroke-dasharray: 1000, 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset var(--animation-speed-slow) var(--animation-curve);
  fill: transparent;
}

/* ====== 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: 40px;
}

.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) scale(1.02);
  box-shadow: var(--box-shadow-hover);
  border-color: var(--primary-color);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.blog-img {
  height: 200px;
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  position: relative;
}

.blog-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
  display: block;
}

.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;
}

.blog-card-animated svg rect {
  stroke: var(--primary-color);
  stroke-width: var(--border-width-medium);
  stroke-dasharray: 1000, 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset var(--animation-speed-slow) var(--animation-curve);
  fill: transparent;
}

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

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

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

.language-preview-card {
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  padding: 30px;
  text-align: center;
  box-shadow: var(--box-shadow);
  transition: var(--hover-transition);
  border: 2px solid var(--border-color);
}

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

.language-preview-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow-hover);
  border-color: var(--primary-color);
}

.language-icon {
  font-size: 3.5rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.language-preview-card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: var(--text-color);
}

.language-preview-card p {
  color: var(--text-color-light);
  margin-bottom: 20px;
  line-height: 1.6;
}

.language-preview-card .btn {
  margin-top: 10px;
}

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

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

/* ====== 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-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  width: 100%;
}

.resource-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);
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 400px;
}

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

.resource-card-animated:hover {
  transform: translateY(-10px);
  box-shadow: var(--box-shadow-hover);
  border-color: var(--primary-color);
}

.resource-card-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

.resource-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  position: relative;
  margin: 0;
  padding: 0;
  background-color: #f0f0f0;
}

body.dark-mode .resource-image {
  background-color: #2a2a2a;
}

.resource-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.5s ease;
  display: block;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
}

.resource-text {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

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

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

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

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

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

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

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

.resource-tag {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  margin-bottom: 15px;
}

.resource-card-animated .buttons.has-addons {
  margin-top: auto;
}

.resource-card-animated svg rect {
  stroke: var(--primary-color);
  stroke-width: var(--border-width-medium);
  stroke-dasharray: 600, 600;
  stroke-dashoffset: 600;
  transition: stroke-dashoffset var(--animation-speed-medium) var(--animation-curve);
  fill: transparent;
}

/* ====== 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) scale(1.02);
  box-shadow: var(--box-shadow-hover);
  border-color: var(--primary-color);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

.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;
}

/* 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-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:not(.active) {
  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); }
}

/* Dark mode support */
body.dark-mode .success-message {
  background-color: rgba(40, 167, 69, 0.15);
  color: #2ecc71;
  border-color: rgba(46, 204, 113, 0.4);
}

body.dark-mode .error-message {
  color: #ff6b6b;
}

/* Form input padding adjustment for validation icons */
.form-input, .form-textarea {
  padding-right: 35px; /* Make room for validation icons */
}

/* 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);
}

input.input-valid,
textarea.input-valid {
  border-color: var(--success-color);
  background-color: rgba(40, 167, 69, 0.05);
}

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

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

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

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

/* Responsive styles for contact section */
@media (max-width: 768px) {
  .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));
  }
}

@media (max-width: 576px) {
  .contact-form {
    padding: 20px;
  }

  .contact-item-animated {
    padding: 20px;
  }

  .contact-social a {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

/* ====== 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;
  flex-wrap: wrap;
}

/* Base styling for all social media links */
.social-links a,
.profile-social a,
.contact-social a {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  background-color: #333 !important;
  color: white !important;
  transition: all 0.3s ease !important;
  position: relative !important;
  overflow: visible !important;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* Ensure icons are clearly visible and properly sized */
.social-links a i,
.profile-social a i,
.contact-social a i {
  font-size: 1.2rem !important;
  line-height: 1 !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit !important;
  width: auto !important;
  height: auto !important;
}

/* Simple hover effect */
.social-links a:hover,
.profile-social a:hover,
.contact-social a:hover {
  transform: translateY(-3px) scale(1.1) !important;
  background-color: #444 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

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

body.dark-mode .social-links a,
body.dark-mode .profile-social a,
body.dark-mode .contact-social a {
  background-color: rgba(255, 255, 255, 0.15) !important;
  color: var(--dark-text-color) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

body.dark-mode .social-links a:hover,
body.dark-mode .profile-social a:hover,
body.dark-mode .contact-social a:hover {
  background-color: rgba(255, 255, 255, 0.25) !important;
}

/* 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;
  border-color: #0077b5 !important;
}

a[href*="github.com"]:hover,
a[href*="github.com"]:focus {
  background-color: #333 !important;
  color: white !important;
  border-color: #333 !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;
  border-color: #000000 !important;
}

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

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

/* X icon styling - ensure it's visible */
.fa-x-twitter,
.fab.fa-x-twitter {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: inherit !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;
}

/* ====== UTILITY CLASSES ====== */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }
.full-width { width: 100%; }

/* ====== 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 fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

@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; }
}

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

/* ====== 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;
}

/* 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 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; }
}

@media (max-width: 992px) {
  .nav-links { 
    display: none !important; 
  }
  .menu-btn { 
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  .theme-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .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;
  }
}

@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-fit, 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));
  }

  .bottom-scrollbar-container { display: none; }
}

@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;
  }
}

/* ====== CONTENT SECTION (for resource pages) ====== */
.content-section {
  padding: 120px 20px 80px;
  max-width: 1200px;
  margin: 0 auto;
  line-height: 1.8;
}

.content-section h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.content-section h2 {
  font-size: 2rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--text-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
}

.content-section h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.content-section p {
  margin-bottom: 1.25rem;
  color: var(--text-color);
}

.content-section ul,
.content-section ol {
  margin-bottom: 1.25rem;
  padding-left: 2rem;
}

.content-section li {
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.content-section pre {
  background-color: var(--background-secondary);
  padding: 1rem;
  border-radius: var(--border-radius);
  overflow-x: auto;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-color);
}

.content-section code {
  font-family: var(--font-monospace);
  background-color: var(--background-secondary);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.content-section pre code {
  background-color: transparent;
  padding: 0;
}

.content-section a {
  color: var(--primary-color);
  text-decoration: underline;
}

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

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

body.dark-mode .content-section h1,
body.dark-mode .content-section h2,
body.dark-mode .content-section h3,
body.dark-mode .content-section p,
body.dark-mode .content-section li {
  color: var(--dark-text-color);
}

/* ====== AI AGENT STYLES ====== */
#ai-agent-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  font-family: var(--font-family-base);
}

.ai-agent-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ai-agent-toggle:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

.ai-agent-toggle.active {
  background: linear-gradient(135deg, #764ba2 0%, var(--primary-color) 100%);
  box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

.ai-agent-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 10px;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.ai-agent-widget {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 400px;
  max-width: calc(100vw - 40px);
  height: 650px;
  max-height: calc(100vh - 120px);
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-agent-widget.active {
  display: flex;
  transform: translateY(0) scale(1);
  opacity: 1;
}

body.dark-mode .ai-agent-widget {
  background: var(--dark-background-color);
  border: 1px solid var(--dark-border-color);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.ai-agent-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: white;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ai-agent-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.ai-agent-info h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.ai-agent-info p {
  margin: 6px 0 0 0;
  font-size: 0.9rem;
  opacity: 0.95;
  font-weight: 400;
}

.ai-agent-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

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

.ai-agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  background: var(--background-secondary);
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(to bottom, #f8f9fa, #ffffff);
}

body.dark-mode .ai-agent-messages {
  background: linear-gradient(to bottom, var(--dark-background-secondary), var(--dark-background-color));
}

.ai-message {
  display: flex;
  gap: 10px;
  animation: messageSlideIn 0.3s ease;
}

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

.ai-message.user-message {
  flex-direction: row-reverse;
}

.ai-message-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.ai-message-content {
  max-width: 75%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ai-message.user-message .ai-message-content {
  align-items: flex-end;
}

.ai-message-text {
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.ai-message.ai-message .ai-message-text {
  background: white;
  color: var(--text-color);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.ai-message.user-message .ai-message-text {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

.ai-message-time {
  font-size: 0.7rem;
  color: var(--text-color-light);
  padding: 0 4px;
}

body.dark-mode .ai-message-time {
  color: var(--dark-text-color-light);
}

.ai-message.typing .ai-message-text {
  display: flex;
  gap: 5px;
  align-items: center;
}

.ai-message.typing .ai-message-text::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-color-light);
  animation: typingDot 1.4s infinite;
}

.ai-message.typing .ai-message-text::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-color-light);
  animation: typingDot 1.4s infinite 0.2s;
}

@keyframes typingDot {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.ai-agent-input-container {
  padding: 18px 20px;
  background: white;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.03);
}

body.dark-mode .ai-agent-input-container {
  background: var(--dark-background-color);
  border-color: var(--dark-border-color);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

#ai-agent-input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--font-family-base);
  background: var(--background-secondary);
}

body.dark-mode #ai-agent-input {
  background: var(--dark-background-secondary);
  border-color: var(--dark-border-color);
  color: var(--dark-text-color);
}

#ai-agent-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
  background: white;
}

body.dark-mode #ai-agent-input:focus {
  background: var(--dark-background-color);
}

#ai-agent-send {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.25);
}

#ai-agent-send:hover {
  transform: scale(1.08) translateY(-1px);
  box-shadow: 0 4px 16px rgba(13, 110, 253, 0.35);
}

#ai-agent-send:active {
  transform: scale(0.96);
  box-shadow: 0 1px 4px rgba(13, 110, 253, 0.2);
}

.ai-agent-suggestions {
  padding: 14px 20px;
  background: var(--background-secondary);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(to bottom, #f8f9fa, #ffffff);
}

body.dark-mode .ai-agent-suggestions {
  background: linear-gradient(to bottom, var(--dark-background-secondary), var(--dark-background-color));
  border-color: var(--dark-border-color);
}

.suggestion-btn {
  padding: 8px 16px;
  background: white;
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-color);
  font-family: var(--font-family-base);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

body.dark-mode .suggestion-btn {
  background: var(--dark-background-color);
  border-color: var(--dark-border-color);
  color: var(--dark-text-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.suggestion-btn:hover {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  color: white;
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

/* Scrollbar styling for messages */
.ai-agent-messages::-webkit-scrollbar {
  width: 6px;
}

.ai-agent-messages::-webkit-scrollbar-track {
  background: transparent;
}

.ai-agent-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

.ai-agent-messages::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

body.dark-mode .ai-agent-messages::-webkit-scrollbar-thumb {
  background: var(--dark-border-color);
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ai-agent-widget {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    bottom: 80px;
    right: 10px;
  }

  .ai-agent-toggle {
    width: 55px;
    height: 55px;
    font-size: 1.3rem;
  }

  .ai-message-content {
    max-width: 85%;
  }
}

/* ====== ADVANCED AI AGENT SYSTEM STYLES ====== */
#ai-agent-system {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 10001;
  font-family: var(--font-family-base);
  max-width: 450px;
  width: 100%;
}

.agent-dashboard {
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: none;
  max-height: 80vh;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

body.dark-mode .agent-dashboard {
  background: var(--dark-background-color);
  border: 1px solid var(--dark-border-color);
}

.agent-dashboard.active {
  display: flex;
  transform: translateX(0);
}

.agent-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.agent-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-title i {
  font-size: 1.5rem;
}

.agent-title h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
}

.agent-status {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 10px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.agent-status.active {
  background: rgba(76, 175, 80, 0.35);
  color: #81C784;
  border-color: rgba(76, 175, 80, 0.4);
}

.agent-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.agent-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.agent-toggle-btn.active {
  background: rgba(76, 175, 80, 0.3);
  color: #4CAF50;
}

.agent-tabs {
  display: flex;
  background: var(--background-secondary);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
}

body.dark-mode .agent-tabs {
  background: var(--dark-background-secondary);
  border-color: var(--dark-border-color);
}

.agent-tab {
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-color-light);
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
  white-space: nowrap;
}

body.dark-mode .agent-tab {
  color: var(--dark-text-color-light);
}

.agent-tab:hover {
  color: var(--primary-color);
  background: rgba(102, 126, 234, 0.1);
}

.agent-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  font-weight: 600;
}

.agent-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--background-color);
}

body.dark-mode .agent-content {
  background: var(--dark-background-color);
}

.agent-tab-content {
  display: none;
}

.agent-tab-content.active {
  display: block;
}

.agent-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-bottom: 25px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .stat-card {
  background: var(--dark-background-secondary);
  border-color: var(--dark-border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-color-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.agent-observations h4 {
  margin: 0 0 15px 0;
  color: var(--text-color);
  font-size: 1rem;
}

body.dark-mode .agent-observations h4 {
  color: var(--dark-text-color);
}

.observations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.observation-item {
  padding: 12px;
  background: var(--background-secondary);
  border-radius: 8px;
  font-size: 0.9rem;
  border-left: 3px solid var(--primary-color);
}

body.dark-mode .observation-item {
  background: var(--dark-background-secondary);
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item {
  padding: 18px;
  background: white;
  border-radius: 12px;
  border-left: 4px solid var(--border-color);
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 12px;
}

.task-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .task-item {
  background: var(--dark-background-secondary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.task-item.success {
  border-left-color: #4CAF50;
  background: linear-gradient(to right, rgba(76, 175, 80, 0.05), white);
}

body.dark-mode .task-item.success {
  background: linear-gradient(to right, rgba(76, 175, 80, 0.1), var(--dark-background-secondary));
}

.task-item.failed {
  border-left-color: #f44336;
  background: linear-gradient(to right, rgba(244, 67, 54, 0.05), white);
}

body.dark-mode .task-item.failed {
  background: linear-gradient(to right, rgba(244, 67, 54, 0.1), var(--dark-background-secondary));
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.task-tool {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.task-time {
  font-size: 0.75rem;
  color: var(--text-color-light);
}

body.dark-mode .task-time {
  color: var(--dark-text-color-light);
}

.task-action {
  font-size: 0.85rem;
  color: var(--text-color);
  margin-bottom: 5px;
}

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

.task-result {
  font-size: 0.8rem;
  color: var(--text-color-light);
  font-style: italic;
}

body.dark-mode .task-result {
  color: var(--dark-text-color-light);
}

.memory-view h4 {
  margin: 20px 0 10px 0;
  color: var(--text-color);
  font-size: 0.95rem;
}

body.dark-mode .memory-view h4 {
  color: var(--dark-text-color);
}

.memory-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.memory-item {
  padding: 12px;
  background: var(--background-secondary);
  border-radius: 8px;
  font-size: 0.85rem;
}

body.dark-mode .memory-item {
  background: var(--dark-background-secondary);
}

.memory-key {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.memory-value {
  color: var(--text-color);
  margin-bottom: 5px;
  word-break: break-word;
}

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

.memory-time,
.memory-meta {
  font-size: 0.75rem;
  color: var(--text-color-light);
}

body.dark-mode .memory-time,
body.dark-mode .memory-meta {
  color: var(--dark-text-color-light);
}

.tools-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-item {
  padding: 18px;
  background: white;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  margin-bottom: 12px;
}

.tool-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

body.dark-mode .tool-item {
  background: var(--dark-background-secondary);
  border-color: var(--dark-border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.tool-header {
  margin-bottom: 8px;
}

.tool-header strong {
  color: var(--primary-color);
  font-size: 0.95rem;
}

.tool-description {
  font-size: 0.85rem;
  color: var(--text-color-light);
  line-height: 1.5;
}

body.dark-mode .tool-description {
  color: var(--dark-text-color-light);
}

.goals-section {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.btn-create-goal {
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-create-goal:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.goal-item {
  padding: 15px;
  background: var(--background-secondary);
  border-radius: 10px;
  border-left: 4px solid var(--primary-color);
}

body.dark-mode .goal-item {
  background: var(--dark-background-secondary);
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.goal-status {
  padding: 4px 10px;
  background: rgba(102, 126, 234, 0.2);
  border-radius: 12px;
  font-size: 0.75rem;
  color: var(--primary-color);
}

.goal-type {
  font-size: 0.85rem;
  color: var(--text-color-light);
}

body.dark-mode .goal-type {
  color: var(--dark-text-color-light);
}

/* Agent Toggle Button (Floating) */
.agent-dashboard-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
  border: none;
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.agent-dashboard-toggle:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 110, 253, 0.4);
}

/* Agent Notifications */
.agent-notification {
  position: fixed;
  top: 100px;
  right: 20px;
  background: white;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10002;
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 300px;
  max-width: 400px;
  border-left: 4px solid var(--primary-color);
}

.agent-notification.show {
  transform: translateX(0);
  opacity: 1;
}

.agent-notification-success {
  border-left-color: #4CAF50;
  background: linear-gradient(to right, rgba(76, 175, 80, 0.1), white);
}

.agent-notification-error {
  border-left-color: #f44336;
  background: linear-gradient(to right, rgba(244, 67, 54, 0.1), white);
}

.agent-notification-info {
  border-left-color: var(--primary-color);
  background: linear-gradient(to right, rgba(13, 110, 253, 0.1), white);
}

body.dark-mode .agent-notification {
  background: var(--dark-background-color);
  border-color: var(--dark-border-color);
}

body.dark-mode .agent-notification-success {
  background: linear-gradient(to right, rgba(76, 175, 80, 0.2), var(--dark-background-color));
}

body.dark-mode .agent-notification-error {
  background: linear-gradient(to right, rgba(244, 67, 54, 0.2), var(--dark-background-color));
}

body.dark-mode .agent-notification-info {
  background: linear-gradient(to right, rgba(13, 110, 253, 0.2), var(--dark-background-color));
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-color);
  font-size: 0.9rem;
}

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

.notification-content i {
  font-size: 1.2rem;
}

.agent-notification-success .notification-content i {
  color: #4CAF50;
}

.agent-notification-error .notification-content i {
  color: #f44336;
}

.agent-notification-info .notification-content i {
  color: var(--primary-color);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #ai-agent-system {
    max-width: calc(100vw - 40px);
    left: 20px;
    right: 20px;
  }

  .agent-dashboard {
    max-height: 90vh;
  }

  .agent-stats {
    grid-template-columns: 1fr;
  }

  .agent-tabs {
    font-size: 0.75rem;
  }

  .agent-tab {
    padding: 10px 12px;
  }

  .agent-notification {
    right: 10px;
    left: 10px;
    min-width: auto;
    max-width: calc(100vw - 20px);
  }
}

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

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

/* 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: #000000 !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;
  }
}

/* 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;
  }
}

.x-icon {
  display: inline-block;
  color: #000;
  transition:
      color 0.3s ease,
      transform 0.3s ease;
}

.x-icon:hover {
  color: #1DA1F2; /* X/Twitter brand color */
  transform: scale(1.2) rotate(5deg);
}

/* Responsive touch targets */
@media (pointer: coarse) {
  .x-icon {
      font-size: 1.5em;
      padding: 10px;
  }
}

/* Accessibility considerations */
.x-icon:focus {
  outline: 2px solid #1DA1F2;
  outline-offset: 2px;
}
/* Link visibility fix */
a {
    color: inherit;
}
a:not([style*="color"]) {
    color: #0066cc;
}
