/* ==========================================================================
   CSS Custom Properties System - Homepage Modernization
   Requirements: 7.1, 6.2, 6.3
   ========================================================================== */

:root {
  /* Color System - Primary */
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: #818cf8;
  --color-secondary: #64748b;
  --color-secondary-hover: #475569;
  --color-accent: #06b6d4;
  --color-accent-hover: #0891b2;
  
  /* Color System - Semantic */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;
  
  /* Surfaces - Light Mode */
  --surface-base: #ffffff;
  --surface-elevated: #f8fafc;
  --surface-card: #ffffff;
  --surface-overlay: rgba(0, 0, 0, 0.5);
  
  /* Text Colors - Light Mode (WCAG AA compliant) */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  /* Border Colors */
  --border-light: #e2e8f0;
  --border-default: #cbd5e1;
  --border-dark: #94a3b8;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-card-hover: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* Transitions - 200-300ms range per Requirements 6.1 */
  --transition-fast: 200ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 300ms ease;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-section: 4rem;
  
  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-tooltip: 1060;
}

/* ==========================================================================
   Dark Theme Overrides - Requirements 6.3
   ========================================================================== */

.theme-dark {
  /* Surfaces - Dark Mode */
  --surface-base: #0f172a;
  --surface-elevated: #1e293b;
  --surface-card: #1e293b;
  --surface-overlay: rgba(0, 0, 0, 0.7);
  
  /* Text Colors - Dark Mode (WCAG AA compliant) */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Border Colors - Dark Mode */
  --border-light: #334155;
  --border-default: #475569;
  --border-dark: #64748b;
  
  /* Shadows - Dark Mode (more subtle) */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  --shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.2);
  --shadow-card-hover: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.3);
  
  /* Primary colors adjusted for dark mode - darker for WCAG AA contrast with white text */
  --color-primary: #5b5bd6;
  --color-primary-hover: #7c7ce0;
  --color-primary-light: #a5b4fc;
}

/* ==========================================================================
   Existing Dark Theme Styles (preserved)
   ========================================================================== */

.theme-dark .navbar {
    --tblr-navbar-border-color: transparent;
    --tblr-navbar-bg: transparent;
    --tblr-navbar-active-bg: rgba(255, 255, 255, 0.06);
    background-color: transparent !important;
    border-bottom: none;
}

.theme-dark {
    background-color: #202124;
}

.theme-dark .card,.theme-dark .alert:not(.alert-important), .theme-dark .card, .theme-dark .card-footer, .theme-dark .card-stacked::after, .theme-dark .dropdown-menu, .theme-dark .footer:not(.footer-transparent), .theme-dark .modal-content, .theme-dark .modal-header, .theme-dark .toast, .theme-dark .toast-header {
    border-color: rgb(48,49,52,.16);
    background-color: #303134;
}

.theme-dark .form-check-input:not(:checked), .theme-dark .form-control, .theme-dark .form-file-text, .theme-dark .form-select, .theme-dark .form-selectgroup-check
{
    border:1px solid #5f6368;
    background-color:transparent;
}


.text-dark {
    --tblr-text-opacity: 1;
    color: rgb(255 255 255) !important;
}

/*
 ==========================================================================
   Hero Section Modernization - Requirements 1.1, 1.2, 1.3, 1.4
   ========================================================================== */

/* Animated Gradient Background - Requirement 1.1 */
#parallax {
  position: relative;
  overflow: hidden;
}

#parallax .position-relative {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    var(--color-accent) 50%,
    var(--color-primary-light) 100%
  );
  background-size: 200% 200%;
  animation: hero-gradient-shift 8s ease infinite;
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes hero-gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Hero Section Mask Enhancement */
#parallax .mask {
  transition: opacity var(--transition-slow);
}

/* Hero Content Container */
#parallax .container {
  padding-top: var(--space-xl);
  padding-bottom: var(--space-xl);
}

/* Modern Typography - Requirement 1.2 */
#parallax h1.display-6 {
  font-size: clamp(1.75rem, 5vw, var(--font-size-4xl));
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text-inverse);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Animation - Requirement 1.3 */
  opacity: 0;
  animation: hero-fade-in-up 0.6s ease forwards;
  animation-delay: 0.1s;
}

#parallax h2 {
  font-size: clamp(1rem, 3vw, var(--font-size-xl));
  font-weight: 400;
  color: var(--text-inverse);
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  /* Animation with delay - Requirement 1.3 */
  opacity: 0;
  animation: hero-fade-in-up 0.6s ease forwards;
  animation-delay: 0.25s;
}

/* Fade-in-up Animation Keyframes - Requirement 1.3 */
@keyframes hero-fade-in-up {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Subtitle specific opacity after animation */
#parallax h2 {
  --final-opacity: 0.9;
}

@keyframes hero-fade-in-up-subtitle {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 0.9;
    transform: translateY(0);
  }
}

#parallax h2 {
  animation-name: hero-fade-in-up-subtitle;
}

/* Responsive Typography Scaling - Requirement 1.4 */
@media (max-width: 768px) {
  #parallax .position-relative {
    min-height: 220px;
  }
  
  #parallax .container {
    padding-top: var(--space-lg);
    padding-bottom: var(--space-lg);
  }
  
  #parallax h1.display-6 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: var(--space-sm);
  }
  
  #parallax h2 {
    font-size: clamp(0.875rem, 4vw, 1.125rem);
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
  
  #parallax .col {
    padding-left: var(--space-sm);
    padding-right: var(--space-sm);
  }
}

@media (max-width: 480px) {
  #parallax .position-relative {
    min-height: 180px;
  }
  
  #parallax h1.display-6 {
    font-size: 1.375rem;
  }
  
  #parallax h2 {
    font-size: 0.875rem;
  }
}

/* Large screens enhancement */
@media (min-width: 1200px) {
  #parallax .position-relative {
    min-height: 320px;
  }
  
  #parallax h1.display-6 {
    font-size: 2.5rem;
  }
  
  #parallax h2 {
    font-size: 1.25rem;
  }
}

/* Non-parallax Hero Section (when parallax is disabled) */
.page-wrapper > .page-content > .container.text-center.py-5 {
  padding-top: var(--space-2xl) !important;
  padding-bottom: var(--space-2xl) !important;
}

.page-wrapper > .page-content > .container.text-center.py-5 h1.display-6 {
  font-size: clamp(1.75rem, 5vw, var(--font-size-4xl));
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
  opacity: 0;
  animation: hero-fade-in-up 0.6s ease forwards;
  animation-delay: 0.1s;
}

.page-wrapper > .page-content > .container.text-center.py-5 h2 {
  font-size: clamp(1rem, 3vw, var(--font-size-xl));
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0;
  animation: hero-fade-in-up-subtitle 0.6s ease forwards;
  animation-delay: 0.25s;
}

/* Dark Theme Hero Adjustments */
.theme-dark #parallax .position-relative {
  background: linear-gradient(
    135deg,
    var(--color-primary) 0%,
    #0e7490 50%,
    var(--color-primary-light) 100%
  );
}

.theme-dark .page-wrapper > .page-content > .container.text-center.py-5 h1.display-6 {
  color: var(--text-primary);
}

.theme-dark .page-wrapper > .page-content > .container.text-center.py-5 h2 {
  color: var(--text-secondary);
}

/* Reduced Motion Support - Accessibility */
@media (prefers-reduced-motion: reduce) {
  #parallax .position-relative {
    animation: none;
    background-position: 50% 50%;
  }
  
  #parallax h1.display-6,
  #parallax h2,
  .page-wrapper > .page-content > .container.text-center.py-5 h1.display-6,
  .page-wrapper > .page-content > .container.text-center.py-5 h2 {
    animation: none;
    opacity: 1;
    transform: none;
  }
}


/* ==========================================================================
   Tool Card Modernization - Requirements 2.1, 2.2, 2.3, 2.4
   ========================================================================== */

/* Tool Card Base Styling - Requirement 2.1 */
.item-box {
  display: block;
  background-color: var(--surface-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  transition: 
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-base);
  overflow: hidden;
}

/* Tool Card Hover Effects - Requirement 2.2 */
.item-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-primary);
}

.item-box:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Tool Card Body */
.item-box .card-body {
  padding: var(--space-md);
  background-color: transparent;
}

/* Tool Card Icon */
.item-box .avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  object-fit: contain;
  flex-shrink: 0;
}

/* Tool Card Title */
.item-box .fw-medium {
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: 500;
  line-height: 1.4;
  transition: color var(--transition-base);
}

.item-box:hover .fw-medium {
  color: var(--color-primary);
}

/* Modern "New" Badge - Pill-shaped Design - Requirement 2.4 */
.ribbon-wrapper {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
}

.ribbon-wrapper::after {
  content: attr(data-ribbon);
  display: inline-block;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
  color: var(--text-inverse);
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base);
}

.item-box:hover .ribbon-wrapper::after {
  transform: scale(1.05);
}

/* ==========================================================================
   CSS Grid Layout for Tool Cards - Requirement 2.3
   ========================================================================== */

/* Tools Section Container */
#tools-box .row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  margin: 0;
  padding: 0;
}

/* Override Bootstrap column classes within grid */
#tools-box .row > [class*="col-"] {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* Category Card Body Grid */
#tools-box .card-body .row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

/* Responsive Grid Adjustments */
@media (min-width: 768px) {
  #tools-box .row,
  #tools-box .card-body .row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  #tools-box .row,
  #tools-box .card-body .row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  #tools-box .row,
  #tools-box .card-body .row {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Small screens - single column */
@media (max-width: 575px) {
  #tools-box .row,
  #tools-box .card-body .row {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
}

/* ==========================================================================
   Dark Theme Tool Card Overrides
   ========================================================================== */

.theme-dark .item-box {
  border-color: var(--border-light);
  box-shadow: var(--shadow-card);
}

.theme-dark .item-box:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-card-hover);
}

.theme-dark .item-box .fw-medium {
  color: var(--text-primary);
}

.theme-dark .item-box:hover .fw-medium {
  color: var(--color-primary-light);
}

/* Dark theme badge adjustment */
.theme-dark .ribbon-wrapper::after {
  background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-primary) 100%);
}

/* ==========================================================================
   Reduced Motion Support for Tool Cards
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .item-box {
    transition: none;
  }
  
  .item-box:hover {
    transform: none;
  }
  
  .ribbon-wrapper::after {
    transition: none;
  }
  
  .item-box:hover .ribbon-wrapper::after {
    transform: none;
  }
}

/* ==========================================================================
   Category Section Modernization - Requirements 3.1, 3.2, 3.3
   ========================================================================== */

/* Category Card Container */
#tools-box > .card {
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: var(--space-xl);
  background-color: var(--surface-card);
  transition: box-shadow var(--transition-base);
}

#tools-box > .card:hover {
  box-shadow: var(--shadow-lg);
}
.card-header {
  border:0;
}
/* Category Header Styling - Requirement 3.1 */
#tools-box .card-header.category-box {
  padding: var(--space-lg) var(--space-xl);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* Category Title - Modern Typography */
#tools-box .card-header.category-box .card-title {
  font-size: var(--font-size-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

#tools-box .card-header.category-box .card-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Category Title Link */
#tools-box .card-header.category-box .card-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

#tools-box .card-header.category-box .card-title a:hover {
  color: var(--color-primary);
}

/* Category Description */
#tools-box .card-header.category-box > span {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
  padding-left: calc(4px + var(--space-sm));
}

/* Category Header Background Variants */
#tools-box .card-header.category-box.bg-transparent {
  background-color: var(--surface-elevated);
}

#tools-box .card-header.category-box:not(.bg-transparent) .card-title::before {
  background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 100%);
}

#tools-box .card-header.category-box:not(.bg-transparent) .card-title a {
  color: inherit;
}

#tools-box .card-header.category-box:not(.bg-transparent) > span {
  color: rgba(255, 255, 255, 0.85);
}

/* Visual Separation Between Categories - Requirement 3.2 */
#tools-box > .card + .card {
  margin-top: var(--space-xl);
}

#tools-box > .card::after {
  content: '';
  display: block;
  position: absolute;
  bottom: 0;
  left: var(--space-xl);
  right: var(--space-xl);
  height: 0;
}

/* Category Card Body */
#tools-box > .card > .card-body {
  padding: var(--space-lg);
  background-color: var(--surface-card);
}

/* ==========================================================================
   Smooth Scroll-to Behavior with Header Offset - Requirement 3.3
   ========================================================================== */

/* Scroll margin for anchor targets to account for sticky header */
#tools-box .card-title[id] {
  scroll-margin-top: calc(70px + var(--space-lg));
}

/* Smooth scrolling for the entire page */
html {
  scroll-behavior: smooth;
}

/* Anchor link indicator on hover */
#tools-box .card-header.category-box .card-title a::after {
  content: ' #';
  opacity: 0;
  color: var(--color-primary);
  font-weight: 400;
  transition: opacity var(--transition-base);
}

#tools-box .card-header.category-box .card-title a:hover::after {
  opacity: 0.5;
}

/* ==========================================================================
   Dark Theme Category Section Overrides
   ========================================================================== */

.theme-dark #tools-box > .card {
  background-color: var(--surface-card);
  box-shadow: var(--shadow-md);
}

.theme-dark #tools-box > .card:hover {
  box-shadow: var(--shadow-lg);
}

.theme-dark #tools-box .card-header.category-box {
  border-bottom-color: transparent
}

.theme-dark #tools-box .card-header.category-box.bg-transparent {
  background-color: var(--surface-elevated);
}

.theme-dark #tools-box .card-header.category-box .card-title a {
  color: var(--text-primary);
}

.theme-dark #tools-box .card-header.category-box .card-title a:hover {
  color: var(--color-primary-light);
}

.theme-dark #tools-box .card-header.category-box > span {
  color: var(--text-secondary);
}

.theme-dark #tools-box > .card > .card-body {
  background-color: #303134;
}

/* ==========================================================================
   Responsive Category Section Adjustments
   ========================================================================== */

@media (max-width: 768px) {
  #tools-box .card-header.category-box {
    padding: var(--space-md) var(--space-lg);
  }
  
  #tools-box .card-header.category-box .card-title {
    font-size: var(--font-size-lg);
  }
  
  #tools-box .card-header.category-box > span {
    font-size: var(--font-size-xs);
  }
  
  #tools-box > .card > .card-body {
    padding: var(--space-md);
  }
  
  #tools-box > .card + .card {
    margin-top: var(--space-lg);
  }
}

@media (max-width: 480px) {
  #tools-box .card-header.category-box {
    padding: var(--space-sm) var(--space-md);
  }
  
  #tools-box .card-header.category-box .card-title {
    font-size: var(--font-size-base);
  }
  
  #tools-box > .card > .card-body {
    padding: var(--space-sm);
  }
}

/* ==========================================================================
   Reduced Motion Support for Category Sections
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  #tools-box > .card {
    transition: none;
  }
  
  #tools-box .card-header.category-box .card-title a,
  #tools-box .card-header.category-box .card-title a::after {
    transition: none;
  }
}


/* ==========================================================================
   Navbar Modernization - Requirements 4.1, 4.2, 4.3, 4.4
   ========================================================================== */

/* Base Navbar Styling - Requirement 4.1 */
.navbar {
  padding: var(--space-sm) 0;
  transition: 
    background-color var(--transition-base),
    box-shadow var(--transition-base),
    backdrop-filter var(--transition-base);
  background-color: transparent;
  border-bottom: none;
}

/* Navbar Container Spacing */
.navbar .container-xl {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

/* Navbar Brand Styling */
.navbar .navbar-brand {
  padding: var(--space-xs) 0;
  margin-right: var(--space-lg);
  transition: opacity var(--transition-base);
}

.navbar .navbar-brand:hover {
  opacity: 0.8;
}

.navbar .navbar-brand-image {
  height: 32px;
  width: auto;
  transition: transform var(--transition-base);
}

.navbar .navbar-brand:hover .navbar-brand-image {
  transform: scale(1.05);
}

/* Navbar Nav Items Spacing - Requirement 4.1 */
.navbar .navbar-nav {
  gap: var(--space-xs);
}

.navbar .nav-item {
  margin: 0;
}

.navbar .nav-link {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: var(--font-size-sm);
  transition: 
    color var(--transition-base),
    background-color var(--transition-base);
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--text-primary);
  background-color: var(--surface-elevated);
}

.navbar .nav-link.active {
  color: var(--color-primary);
  background-color: rgba(79, 70, 229, 0.1);
}

/* Navbar Right Section Alignment */
.navbar .navbar-nav.flex-row.order-lg-last {
  gap: var(--space-sm);
  align-items: center;
}

/* ==========================================================================
   Sticky Navbar with Backdrop Blur - Requirement 4.2
   ========================================================================== */

.navbar.sticky-top {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

/* Backdrop blur effect when scrolled */
.navbar.sticky-top.navbar-scrolled,
.navbar.sticky-top:not(.navbar-at-top) {
  background-color: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
  box-shadow: var(--shadow-sm);
  border-bottom-color: transparent;
}

/* Dark theme backdrop blur */
.theme-dark .navbar.sticky-top.navbar-scrolled,
.theme-dark .navbar.sticky-top:not(.navbar-at-top) {
  background-color: rgba(15, 23, 42, 0.85);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  backdrop-filter: blur(12px) saturate(180%);
}

/* Fallback for browsers without backdrop-filter support */
@supports not (backdrop-filter: blur(12px)) {
  .navbar.sticky-top.navbar-scrolled,
  .navbar.sticky-top:not(.navbar-at-top) {
    background-color: var(--surface-base);
  }
  
  .theme-dark .navbar.sticky-top.navbar-scrolled,
  .theme-dark .navbar.sticky-top:not(.navbar-at-top) {
    background-color: var(--surface-base);
  }
}

/* ==========================================================================
   Hamburger Menu Animation - Requirement 4.3
   ========================================================================== */

/* Hamburger Button Base */
.navbar-toggler {
  position: relative;
  width: 40px;
  height: 40px;
  padding: var(--space-sm);
  border: none;
  border-radius: var(--radius-md);
  background-color: transparent;
  cursor: pointer;
  transition: background-color var(--transition-base);
}

.navbar-toggler:hover {
  background-color: var(--surface-elevated);
}

.navbar-toggler:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  box-shadow: none;
}

/* Hamburger Icon Lines */
.navbar-toggler-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: var(--radius-full);
  transition: 
    transform var(--transition-base),
    opacity var(--transition-base),
    background-color var(--transition-base);
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: var(--radius-full);
  transition: 
    transform var(--transition-base),
    opacity var(--transition-base);
}

.navbar-toggler-icon::before {
  top: -7px;
}

.navbar-toggler-icon::after {
  bottom: -7px;
}

/* Hamburger Animation - Open State */
.navbar-toggler:not(.collapsed) .navbar-toggler-icon {
  background-color: transparent;
}

.navbar-toggler:not(.collapsed) .navbar-toggler-icon::before {
  transform: translateY(7px) rotate(45deg);
}

.navbar-toggler:not(.collapsed) .navbar-toggler-icon::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu Collapse Animation */
.navbar-collapse {
  transition: 
    height var(--transition-slow),
    opacity var(--transition-base);
}

.navbar-collapse.collapsing {
  opacity: 0.5;
}

.navbar-collapse.show {
  opacity: 1;
}

/* Mobile Menu Styling */
@media (max-width: 991.98px) {
  .navbar-collapse {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--surface-base);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    padding: var(--space-md);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  
  .navbar-collapse .navbar-nav {
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  .navbar-collapse .nav-link {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
  }
  
  /* Dark theme mobile menu */
  .theme-dark .navbar-collapse {
    background-color: var(--surface-elevated);
    border-bottom-color: var(--border-light);
  }
}

/* ==========================================================================
   Theme Toggle Button - Requirement 4.4
   ========================================================================== */

.btn-toggle-mode {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background-color: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  overflow: hidden;
  transition: 
    background-color var(--transition-base),
    color var(--transition-base),
    transform var(--transition-base);
}

.btn-toggle-mode:hover {
  background-color: var(--surface-elevated);
  color: var(--text-primary);
}

.btn-toggle-mode:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-toggle-mode:active {
  transform: scale(0.95);
}

/* Theme Toggle Icon Animation */
.btn-toggle-mode .icon {
  width: 20px;
  height: 20px;
  transition: 
    transform var(--transition-slow),
    opacity var(--transition-base);
}

.btn-toggle-mode:hover .icon {
  transform: rotate(15deg);
}

/* Sun/Moon icon smooth transition effect */
.btn-toggle-mode svg {
  transition: 
    transform var(--transition-slow),
    opacity var(--transition-base);
}

/* Dark theme toggle button */
.theme-dark .btn-toggle-mode {
  color: var(--text-secondary);
}

.theme-dark .btn-toggle-mode:hover {
  background-color: var(--surface-elevated);
  color: var(--color-accent);
}

/* ==========================================================================
   Navbar Dropdown Menus
   ========================================================================== */

.navbar .dropdown-menu {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-sm);
  background-color: var(--surface-card);
  animation: navbar-dropdown-fade-in 0.2s ease;
}

@keyframes navbar-dropdown-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.navbar .dropdown-item {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  transition: 
    background-color var(--transition-base),
    color var(--transition-base);
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background-color: var(--surface-elevated);
  color: var(--text-primary);
}

/* Language Menu Styling */
.navbar .lang-menu .dropdown-menu {
  min-width: 160px;
}

.navbar .lang-menu .lang-image {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Navbar Button Styling
   ========================================================================== */

.navbar .btn {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: 
    background-color var(--transition-base),
    color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.navbar .btn:hover {
  transform: translateY(-1px);
}

.navbar .btn:active {
  transform: translateY(0);
}

.navbar .btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Dark Theme Navbar Overrides
   ========================================================================== */

.theme-dark .navbar {
  background-color: var(--surface-base);
  border-bottom-color: var(--border-light);
}

.theme-dark .navbar .nav-link {
  color: var(--text-secondary);
}

.theme-dark .navbar .nav-link:hover,
.theme-dark .navbar .nav-link:focus {
  color: var(--text-primary);
  background-color: var(--surface-elevated);
}

.theme-dark .navbar .nav-link.active {
  color: var(--color-primary-light);
  background-color: rgba(99, 102, 241, 0.15);
}

.theme-dark .navbar .dropdown-menu {
  background-color: var(--surface-card);
  border-color: var(--border-light);
}

.theme-dark .navbar .dropdown-item {
  color: var(--text-secondary);
}

.theme-dark .navbar .dropdown-item:hover,
.theme-dark .navbar .dropdown-item:focus {
  background-color: var(--surface-elevated);
  color: var(--text-primary);
}

.theme-dark .navbar-toggler-icon,
.theme-dark .navbar-toggler-icon::before,
.theme-dark .navbar-toggler-icon::after {
  background-color: var(--text-primary);
}

.theme-dark .navbar-toggler:not(.collapsed) .navbar-toggler-icon {
  background-color: transparent;
}

/* ==========================================================================
   Responsive Navbar Adjustments
   ========================================================================== */

@media (max-width: 991.98px) {
  .navbar {
    padding: var(--space-xs) 0;
  }
  
  .navbar .container-xl {
    gap: var(--space-sm);
  }
  
  .navbar .navbar-brand {
    margin-right: auto;
  }
  
  .navbar .navbar-nav.flex-row.order-lg-last {
    gap: var(--space-xs);
  }
}

@media (max-width: 575.98px) {
  .navbar .btn-toggle-mode {
    width: 36px;
    height: 36px;
  }
  
  .navbar-toggler {
    width: 36px;
    height: 36px;
    padding: var(--space-xs);
  }
}

/* ==========================================================================
   Reduced Motion Support for Navbar
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .navbar,
  .navbar .nav-link,
  .navbar .btn,
  .navbar .dropdown-menu,
  .navbar .dropdown-item,
  .btn-toggle-mode,
  .btn-toggle-mode .icon,
  .navbar-toggler,
  .navbar-toggler-icon,
  .navbar-toggler-icon::before,
  .navbar-toggler-icon::after,
  .navbar-collapse {
    transition: none;
  }
  
  .navbar .dropdown-menu {
    animation: none;
  }
  
  .navbar .btn:hover,
  .navbar .btn:active {
    transform: none;
  }
  
  .btn-toggle-mode:hover .icon {
    transform: none;
  }
  
  .btn-toggle-mode:active {
    transform: none;
  }
}


/* ==========================================================================
   Footer Modernization - Requirements 5.1, 5.2, 5.3
   ========================================================================== */

/* Base Footer Styling - Requirement 5.1 */
.footer {
  background-color: var(--surface-elevated);
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-lg);
  margin-top: var(--space-section);
  position: relative;
}

/* Footer Container */
.footer .container {
  max-width: 1200px;
}

/* Footer Row - Modern Grid Layout */
.footer .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
  align-items: start;
}

/* Override Bootstrap column classes within footer grid */
.footer .row > [class*="col-"] {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* Footer Widget Containers - Visual Hierarchy */
.footer .row > div > div {
  padding: var(--space-sm);
}

/* Footer Widget Titles */
.footer h5,
.footer h6,
.footer .h5,
.footer .h6 {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  letter-spacing: -0.01em;
  position: relative;
  padding-bottom: var(--space-sm);
}

.footer h5::after,
.footer h6::after,
.footer .h5::after,
.footer .h6::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
  border-radius: var(--radius-full);
}

/* Footer Links */
.footer a:not(.btn) {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  transition: 
    color var(--transition-base),
    transform var(--transition-base);
  display: inline-block;
}

.footer a:not(.btn):hover {
  color: var(--color-primary);
  transform: translateX(4px);
}

/* Footer Link Lists */
.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer ul li {
  margin-bottom: var(--space-sm);
}

.footer ul li:last-child {
  margin-bottom: 0;
}

/* Footer Paragraphs */
.footer p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.6;
  margin-bottom: var(--space-sm);
}

/* Footer Horizontal Rule */
.footer hr,
.footer hr.horizontal {
  border: none;
  height: 1px;
  background-color: var(--border-light);
  margin: var(--space-xl) 0;
  opacity: 1;
}

/* ==========================================================================
   Social Icons Section - Requirement 5.2
   ========================================================================== */

/* Social Share Container */
.footer .social-share,
.social-share {
  margin-bottom: var(--space-xl);
}

.footer .social-share h3,
.social-share h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

/* Social Icons Container */
.footer .share-icons,
.share-icons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
}

/* Social Icon Buttons - Modern Styling with Hover Animations */
.footer .share-icons .btn,
.share-icons .btn.social-shadow {
  width: 48px;
  height: 48px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background-color: var(--surface-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
  transition: 
    transform var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base);
  position: relative;
  overflow: hidden;
}

/* Social Icon Hover Animation - Requirement 5.2 */
.footer .share-icons .btn:hover,
.share-icons .btn.social-shadow:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

/* Social Icon Active/Focus State */
.footer .share-icons .btn:active,
.share-icons .btn.social-shadow:active {
  transform: translateY(-2px) scale(1.02);
}

.footer .share-icons .btn:focus,
.share-icons .btn.social-shadow:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Social Icon Font Awesome Icons */
.footer .share-icons .btn i,
.share-icons .btn.social-shadow i {
  font-size: 1.25rem;
  transition: transform var(--transition-base);
}

.footer .share-icons .btn:hover i,
.share-icons .btn.social-shadow:hover i {
  transform: scale(1.1);
}

/* Social Platform Specific Colors on Hover */
.footer .share-icons .btn-facebook:hover,
.share-icons .btn-facebook:hover {
  background-color: #1877f2;
  color: var(--text-inverse);
}

.footer .share-icons .btn-twitter:hover,
.share-icons .btn-twitter:hover {
  background-color: #1da1f2;
  color: var(--text-inverse);
}

.footer .share-icons .btn-instagram:hover,
.share-icons .btn-instagram:hover {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: var(--text-inverse);
}

.footer .share-icons .btn-linkedin:hover,
.share-icons .btn-linkedin:hover {
  background-color: #0a66c2;
  color: var(--text-inverse);
}

.footer .share-icons .btn-youtube:hover,
.share-icons .btn-youtube:hover {
  background-color: #ff0000;
  color: var(--text-inverse);
}

.footer .share-icons .btn-github:hover,
.share-icons .btn-github:hover {
  background-color: #333;
  color: var(--text-inverse);
}

.footer .share-icons .btn-pinterest:hover,
.share-icons .btn-pinterest:hover {
  background-color: #bd081c;
  color: var(--text-inverse);
}

.footer .share-icons .btn-tiktok:hover,
.share-icons .btn-tiktok:hover {
  background-color: #000;
  color: var(--text-inverse);
}

.footer .share-icons .btn-telegram:hover,
.share-icons .btn-telegram:hover {
  background-color: #0088cc;
  color: var(--text-inverse);
}

.footer .share-icons .btn-whatsapp:hover,
.share-icons .btn-whatsapp:hover {
  background-color: #25d366;
  color: var(--text-inverse);
}

/* ==========================================================================
   Footer Bottom Section
   ========================================================================== */

.footer .text-center p.my-4,
.footer .text-center p.text-sm {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

/* Footer Copyright Links */
.footer .text-center a {
  color: var(--text-secondary);
  transition: color var(--transition-base);
}

.footer .text-center a:hover {
  color: var(--color-primary);
  transform: none;
}

/* ==========================================================================
   Dark Theme Footer Overrides
   ========================================================================== */

.theme-dark .footer {
  background-color: var(--surface-elevated);
  border-top-color: var(--border-light);
}

.theme-dark .footer h5,
.theme-dark .footer h6,
.theme-dark .footer .h5,
.theme-dark .footer .h6 {
  color: var(--text-primary);
}

.theme-dark .footer a:not(.btn) {
  color: var(--text-secondary);
}

.theme-dark .footer a:not(.btn):hover {
  color: var(--color-primary-light);
}

.theme-dark .footer p {
  color: var(--text-secondary);
}

.theme-dark .footer hr,
.theme-dark .footer hr.horizontal {
  background-color: var(--border-light);
}

/* Dark Theme Social Icons */
.theme-dark .footer .share-icons .btn,
.theme-dark .share-icons .btn.social-shadow {
  background-color: var(--surface-card);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.theme-dark .footer .share-icons .btn:hover,
.theme-dark .share-icons .btn.social-shadow:hover {
  border-color: transparent;
}

.theme-dark .footer .text-center p.my-4,
.theme-dark .footer .text-center p.text-sm {
  color: var(--text-muted);
  border-top-color: var(--border-light);
}

/* ==========================================================================
   Responsive Footer - Requirement 5.3
   ========================================================================== */

/* Tablet and below */
@media (max-width: 991.98px) {
  .footer {
    padding-top: var(--space-xl);
  }
  
  .footer .row {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}

/* Mobile - Single Column Stack */
@media (max-width: 575.98px) {
  .footer {
    padding-top: var(--space-lg);
    margin-top: var(--space-2xl);
  }
  
  .footer .row {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }
  
  /* Center footer widget titles on mobile */
  .footer h5::after,
  .footer h6::after,
  .footer .h5::after,
  .footer .h6::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  /* Center footer links on mobile */
  .footer a:not(.btn):hover {
    transform: none;
  }
  
  /* Social icons responsive */
  .footer .share-icons .btn,
  .share-icons .btn.social-shadow {
    width: 44px;
    height: 44px;
  }
  
  .footer .share-icons .btn i,
  .share-icons .btn.social-shadow i {
    font-size: 1.125rem;
  }
}

/* Large screens */
@media (min-width: 1200px) {
  .footer .row,
  .footer .footer-widgets {
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-2xl);
  }
}

/* ==========================================================================
   Footer Widget Classes - Enhanced Structure
   ========================================================================== */

/* Footer Widgets Container */
.footer .footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
  align-items: start;
}

/* Footer Widget Base */
.footer .footer-widget {
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* Footer Widget Content */
.footer .footer-widget-content {
  padding: var(--space-sm);
}

/* Full-width widget (layout 1) */
.footer .footer-widget-full {
  grid-column: 1 / -1;
}

/* Large widget (layouts 3, 5) */
.footer .footer-widget-large {
  grid-column: span 2;
}

/* Footer Bottom Section */
.footer .footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.footer .footer-copyright {
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  margin: 0;
}

.footer .footer-copyright a {
  color: var(--text-secondary);
  transition: color var(--transition-base);
}

.footer .footer-copyright a:hover {
  color: var(--color-primary);
  transform: none;
}

/* Responsive Footer Widgets */
@media (max-width: 991.98px) {
  .footer .footer-widgets {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
  
  .footer .footer-widget-large {
    grid-column: span 2;
  }
}

@media (max-width: 575.98px) {
  .footer .footer-widgets {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
    text-align: center;
  }
  
  .footer .footer-widget-large,
  .footer .footer-widget-full {
    grid-column: span 1;
  }
  
  .footer .footer-bottom {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
  }
}

@media (min-width: 1200px) {
  .footer .footer-widgets {
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--space-2xl);
  }
  
  .footer .footer-widget-large {
    grid-column: span 1;
  }
}

/* Dark Theme Footer Widget Overrides */
.theme-dark .footer .footer-bottom {
  border-top-color: var(--border-light);
}

.theme-dark .footer .footer-copyright {
  color: var(--text-muted);
}

.theme-dark .footer .footer-copyright a {
  color: var(--text-secondary);
}

.theme-dark .footer .footer-copyright a:hover {
  color: var(--color-primary-light);
}

/* ==========================================================================
   Reduced Motion Support for Footer
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .footer a:not(.btn),
  .footer .share-icons .btn,
  .share-icons .btn.social-shadow,
  .footer .share-icons .btn i,
  .share-icons .btn.social-shadow i {
    transition: none;
  }
  
  .footer a:not(.btn):hover {
    transform: none;
  }
  
  .footer .share-icons .btn:hover,
  .share-icons .btn.social-shadow:hover {
    transform: none;
  }
  
  .footer .share-icons .btn:hover i,
  .share-icons .btn.social-shadow:hover i {
    transform: none;
  }
}


/* ==========================================================================
   Global UI Enhancements - Requirements 6.1, 6.4, 7.2
   ========================================================================== */

/* ==========================================================================
   Global Transition Effects for Interactive Elements - Requirement 6.1
   All transitions use 200-300ms duration range for consistency
   ========================================================================== */

/* Base interactive element transitions */
a,
button,
input,
select,
textarea,
.btn,
.card,
.form-control,
.form-select,
.nav-link,
.dropdown-item,
[role="button"],
[tabindex]:not([tabindex="-1"]) {
  transition: 
    color var(--transition-base),
    background-color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    opacity var(--transition-base);
}

/* GPU-accelerated transform transitions - Requirement 7.2 */
.item-box,
.card,
.btn,
.share-icons .btn,
.navbar-brand-image,
.avatar,
[data-animate] {
  transition: 
    transform var(--transition-base),
    opacity var(--transition-base),
    box-shadow var(--transition-base);
  will-change: transform, opacity;
}

/* ==========================================================================
   Fade-in Animations for Content Sections - Requirement 6.4
   ========================================================================== */

/* Base fade-in animation keyframes using GPU-accelerated properties */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animation utility classes */
.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.5s ease forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.5s ease forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.5s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease forwards;
}

/* Animation delay utilities */
.animate-delay-100 {
  animation-delay: 100ms;
}

.animate-delay-200 {
  animation-delay: 200ms;
}

.animate-delay-300 {
  animation-delay: 300ms;
}

.animate-delay-400 {
  animation-delay: 400ms;
}

.animate-delay-500 {
  animation-delay: 500ms;
}

/* Content section fade-in on page load - Requirement 6.4 */
.page-content {
  animation: fadeIn 0.4s ease forwards;
}

/* Tools section fade-in */
#tools-box {
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

/* Category cards staggered fade-in */
#tools-box > .card {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

#tools-box > .card:nth-child(1) {
  animation-delay: 0.1s;
}

#tools-box > .card:nth-child(2) {
  animation-delay: 0.2s;
}

#tools-box > .card:nth-child(3) {
  animation-delay: 0.3s;
}

#tools-box > .card:nth-child(4) {
  animation-delay: 0.4s;
}

#tools-box > .card:nth-child(5) {
  animation-delay: 0.5s;
}

#tools-box > .card:nth-child(n+6) {
  animation-delay: 0.6s;
}

/* Tool cards fade-in within categories */
.item-box {
  opacity: 0;
  animation: scaleIn 0.4s ease forwards;
}

/* Staggered animation for tool cards */
#tools-box .card-body .row > div:nth-child(1) .item-box {
  animation-delay: 0.15s;
}

#tools-box .card-body .row > div:nth-child(2) .item-box {
  animation-delay: 0.2s;
}

#tools-box .card-body .row > div:nth-child(3) .item-box {
  animation-delay: 0.25s;
}

#tools-box .card-body .row > div:nth-child(4) .item-box {
  animation-delay: 0.3s;
}

#tools-box .card-body .row > div:nth-child(n+5) .item-box {
  animation-delay: 0.35s;
}

/* Footer fade-in */
.footer {
  animation: fadeIn 0.5s ease forwards;
  animation-delay: 0.3s;
}

/* ==========================================================================
   Interactive Element Hover Effects - Requirement 6.1
   Using GPU-accelerated properties (transform, opacity) - Requirement 7.2
   ========================================================================== */

/* Generic hover lift effect */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Subtle hover scale effect */
.hover-scale {
  transition: transform var(--transition-base);
}

.hover-scale:hover {
  transform: scale(1.02);
}

/* Hover glow effect */
.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.3);
}

/* ==========================================================================
   Focus States for Accessibility
   ========================================================================== */

/* Consistent focus ring for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  transition: outline-offset var(--transition-fast);
}

/* ==========================================================================
   Prefers Reduced Motion Support - Accessibility
   Requirement 6.1, 6.4, 7.2
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  /* Disable all animations */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  /* Reset animated elements to visible state */
  .page-content,
  #tools-box,
  #tools-box > .card,
  .item-box,
  .footer,
  .animate-fade-in,
  .animate-fade-in-up,
  .animate-fade-in-down,
  .animate-fade-in-left,
  .animate-fade-in-right,
  .animate-scale-in {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  
  /* Disable hover transforms */
  .hover-lift:hover,
  .hover-scale:hover,
  .item-box:hover,
  .card:hover,
  .btn:hover,
  .share-icons .btn:hover {
    transform: none !important;
  }
  
  /* Keep color transitions for visual feedback but make them instant */
  a:hover,
  button:hover,
  .btn:hover,
  .nav-link:hover {
    transition: none !important;
  }
}

/* ==========================================================================
   Print Styles - Disable animations for print
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  
  .page-content,
  #tools-box,
  #tools-box > .card,
  .item-box,
  .footer {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ==========================================================================
   Loading State Animations
   ========================================================================== */

/* Skeleton loading animation */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-elevated) 25%,
    var(--surface-card) 50%,
    var(--surface-elevated) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* Pulse animation for loading states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spin animation for loading indicators */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Reduced motion: disable loading animations */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: var(--surface-elevated);
  }
  
  .animate-pulse {
    animation: none;
    opacity: 1;
  }
  
  .animate-spin {
    animation: none;
  }
}


/* ==========================================================================
   Hero Search Box - Always Visible Modern Design
   ========================================================================== */

/* Hero Search Wrapper */
.hero-search-wrapper {
  position: relative;
  width: 100%;
}

.hero-search-wrapper .nav-item {
  display: block;
  margin: 0;
}

/* Hide the search icon button in hero context */
.hero-search-wrapper #search-icon {
  display: none;
}

/* Make search box always visible in hero */
.hero-search-wrapper #search-box {
  display: block !important;
  position: relative;
}

/* Modern Search Input Styling */
.hero-search-wrapper .input-icon {
  position: relative;
}

.hero-search-wrapper .input-icon-addon {
  position: absolute;
  right: 18px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-primary);
  z-index: 2;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-search-wrapper .input-icon-addon .icon,
.hero-search-wrapper .input-icon-addon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.5;
}

.hero-search-wrapper .form-control {
  width: 100%;
  height: 56px;
  padding: 0 54px 0 var(--space-xl);
  font-size: var(--font-size-lg);
  border: 2px solid var(--border-default);
  border-radius: 50px !important;
  background-color: var(--surface-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  transition: 
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.hero-search-wrapper .form-control::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.hero-search-wrapper .form-control:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-lg);
}

.hero-search-wrapper .form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 
    var(--shadow-lg),
    0 0 0 4px rgba(79, 70, 229, 0.15);
  background-color: var(--surface-base);
}

/* Search Results Dropdown */
.hero-search-wrapper .card.mb-3 {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--space-sm);
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-dropdown);
  background-color: var(--surface-card);
  animation: search-results-fade-in 0.2s ease;
}

@keyframes search-results-fade-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-search-wrapper .card.mb-3 .card-body {
  padding: var(--space-md);
}

/* Search Result Items */
.hero-search-wrapper .card.mb-3 .item-box {
  border-radius: var(--radius-md);
  transition: 
    background-color var(--transition-fast),
    transform var(--transition-fast);
}

.hero-search-wrapper .card.mb-3 .item-box:hover {
  transform: translateY(-2px);
}

.hero-search-wrapper .card.mb-3 .item-box .card-body {
  padding: var(--space-sm) var(--space-md);
}

/* Dark Theme Hero Search */
.theme-dark .hero-search-wrapper .form-control {
  background-color: #202124;
  border-color: var(--border-default);
  color: var(--text-primary);
}

.theme-dark .hero-search-wrapper .form-control::placeholder {
  color: var(--text-muted);
}

.theme-dark .hero-search-wrapper .form-control:hover {
  border-color: var(--color-primary-light);
}

.theme-dark .hero-search-wrapper .form-control:focus {
  border-color: var(--color-primary);
  background-color: #202124;
  box-shadow: 
    var(--shadow-lg),
    0 0 0 4px rgba(91, 91, 214, 0.2);
}

.theme-dark .hero-search-wrapper .card.mb-3 {
  background-color: var(--surface-card);
  border-color: var(--border-light);
}

.theme-dark .hero-search-wrapper .input-icon-addon {
  color: var(--text-muted);
}

/* Responsive Hero Search */
@media (max-width: 768px) {
  .hero-search-wrapper .form-control {
    height: 50px;
    font-size: var(--font-size-base);
    padding: 0 48px 0 var(--space-lg);
    border-radius: 50px !important;
  }
  
  .hero-search-wrapper .input-icon-addon {
    right: 16px;
  }
  
  .hero-search-wrapper .input-icon-addon .icon,
  .hero-search-wrapper .input-icon-addon svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .hero-search-wrapper .form-control {
    height: 46px;
    font-size: var(--font-size-sm);
    padding: 0 44px 0 var(--space-md);
    border-radius: 50px !important;
  }
  
  .hero-search-wrapper .input-icon-addon {
    right: 14px;
  }
  
  .hero-search-wrapper .input-icon-addon .icon,
  .hero-search-wrapper .input-icon-addon svg {
    width: 18px;
    height: 18px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .hero-search-wrapper .form-control,
  .hero-search-wrapper .card.mb-3,
  .hero-search-wrapper .card.mb-3 .item-box {
    transition: none;
  }
  
  @keyframes search-results-fade-in {
    from, to {
      opacity: 1;
      transform: none;
    }
  }
}


/* ==========================================================================
   Dark Theme Cookies Wrapper
   ========================================================================== */

.theme-dark .cookies-wrapper > div {
  background-color: #303134 !important;
}

.theme-dark .cookies-wrapper .card-body,
.theme-dark .cookies-wrapper span,
.theme-dark .cookies-wrapper .text-dark {
  color: var(--text-primary) !important;
}
