html {
  font-size: 14px;
  scroll-behavior: smooth;
  position: relative;
  min-height: 100%;
  scroll-padding-top: 80px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Accessibility: Skip to main content link */
.skip-to-main {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--kendo-color-primary, #ff6358);
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  z-index: 10000;
  border-radius: 0 0 0.5rem 0;
  font-weight: 600;
}

.skip-to-main:focus {
  top: 0;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Body layout */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
}

body.full-page {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
}

main {
  flex: 1 0 auto;
}

/* Footer section sizing */
.footer-section {
  flex: 1;
  min-width: 200px;
}

/* Custom container classes for consistency */
.k-container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

@media (min-width: 576px) {
  .k-container {
    max-width: 540px;
  }
}

@media (min-width: 768px) {
  .k-container {
    max-width: 720px;
  }
}

@media (min-width: 992px) {
  .k-container {
    max-width: 960px;
  }
}

@media (min-width: 1200px) {
  .k-container {
    max-width: 1140px;
  }
}

.k-container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, rgba(255, 99, 88, 0.05) 0%, rgba(240, 147, 251, 0.05) 100%);
  border-radius: 0.75rem;
  margin-bottom: 1rem;
padding: 1rem 0.5rem !important;
}

.hero-section .display-4 {
  font-size: 2rem;
  margin-bottom: 0.75rem !important;
}

.lead-hero {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

/* Search Form */
.search-form-wrapper {
  max-width: 600px;
margin: 0 auto;
  width: 100%;
}

.search-form-card {
  padding: 1.5rem;
  border-radius: 0.75rem;
}

.search-label {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  display: block;
}

.search-input {
  flex: 1;
  font-size: 1rem;
  padding: 0.75rem;
}

.search-hint {
  font-size: 0.9rem;
}

.search-section .k-container-fluid {
max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

.search-section .search-form-card {
  max-width: 100%;
}

/* Image Cards */
.image-card {
  height: 100%;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.image-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

.image-card-primary {
  border: 2px solid #ff6358;
}

.image-card-success {
  border: 2px solid #4caf50;
}

.image-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card-header-primary {
  background-color: transparent;
  border-bottom: 1px solid #ff6358;
  color: #ff6358;
  font-weight: 600;
  padding: 0.75rem;
}

.card-header-success {
  background-color: transparent;
  border-bottom: 1px solid #4caf50;
  color: #4caf50;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
}

.card-footer-primary {
  background-color: transparent;
  border-top: 1px solid #ff6358;
  padding: 0.75rem;
}

.card-footer-success {
  background-color: transparent;
  border-top: 1px solid #4caf50;
  padding: 0.5rem;
}

/* Hover effects for badges */
.hover-badge {
  transition: all 0.2s ease-in-out;
}

.hover-badge:hover {
  transform: scale(1.1);
  background-color: #ff6358 !important;
  color: white !important;
}

/* Category chips */
.category-chip {
  transition: all 0.2s ease-in-out;
}

.category-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 99, 88, 0.3);
}

/* Notifications */
.notification-info-custom {
  background-color: #e3f2fd;
  border-left: 4px solid #2196f3;
}

.notification-success-custom {
  background-color: #e8f5e9;
  border-left: 4px solid #4caf50;
  color: #2e7d32;
}

.notification-icon {
  font-size: 1.5rem;
  color: #1976d2;
}

.notification-icon-success {
  font-size: 1.5rem;
}

.tip-code {
  background: rgba(33, 150, 243, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
}

.tip-link {
  color: #1976d2;
  font-weight: 500;
}

/* Icons */
.category-icon {
  color: #4caf50;
}

.tag-icon {
  color: #ff6358;
}

/* Category divider */
.category-divider {
  margin: 2rem 0;
  border-top: 2px solid #e0e0e0;
}

/* Lazy loading visual */
.lazy-image {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.lazy-image[src*="base64"] {
  animation: none;
  background: none;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Category Page - Hero Section */
.category-hero {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: #333;
  padding: 3rem 0 2.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid #dee2e6;
}

.category-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: capitalize;
  color: #212529;
}

.category-subtitle {
  font-size: 1.25rem;
  margin: 0;
  color: #6c757d;
}

.k-breadcrumb-transparent {
  background: transparent;
  padding: 0;
  margin-bottom: 1rem;
}

.k-breadcrumb-item-light a {
  color: #495057;
  text-decoration: none;
  transition: color 0.2s;
}

.k-breadcrumb-item-light a:hover {
  color: #212529;
}

.k-breadcrumb-item-active {
  color: #6c757d;
}

/* Search Box on Category Page */
.search-box-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.search-box-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 0.5rem;
  background: white;
}

.search-box-icon {
  padding: 0 0.5rem;
  color: #757575;
}

.search-box-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  padding: 0.75rem;
}

.search-results-count {
  text-align: center;
  font-size: 0.95rem;
}

/* Tag Cards */
.tag-card {
  background: white;
  border-radius: 0.5rem;
  padding: 1rem 0.75rem;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

.tag-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6c757d 0%, #495057 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tag-card-link:hover .tag-card::before {
  transform: scaleX(1);
}

.tag-card-link:hover .tag-card {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  border-color: #6c757d;
}

.tag-icon-wrapper {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  transition: transform 0.3s ease;
}

.tag-card-link:hover .tag-icon-wrapper {
  transform: scale(1.1) rotate(5deg);
}

.tag-icon-wrapper i {
  font-size: 1.1rem;
  color: white;
}

.tag-name {
  color: #424242;
  font-weight: 600;
  font-size: 0.875rem;
  margin: 0;
  text-transform: capitalize;
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
}

.tag-count {
  display: block;
  color: #757575;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

.tag-card-link:hover .tag-count {
  color: #495057;
}

/* No results */
.no-results {
  background: #f5f5f5;
  border-radius: 0.5rem;
  padding: 2rem;
}

.no-results-icon {
  font-size: 3rem;
  color: #757575;
  margin-bottom: 1rem;
  display: block;
}

.no-results-info-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

/* Animations */
.tag-item {
  animation: fadeInUp 0.5s ease backwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for grid items */
.tag-item:nth-child(1) { animation-delay: 0.05s; }
.tag-item:nth-child(2) { animation-delay: 0.1s; }
.tag-item:nth-child(3) { animation-delay: 0.15s; }
.tag-item:nth-child(4) { animation-delay: 0.2s; }
.tag-item:nth-child(5) { animation-delay: 0.25s; }
.tag-item:nth-child(6) { animation-delay: 0.3s; }
.tag-item:nth-child(7) { animation-delay: 0.35s; }
.tag-item:nth-child(8) { animation-delay: 0.4s; }
.tag-item:nth-child(9) { animation-delay: 0.45s; }
.tag-item:nth-child(10) { animation-delay: 0.5s; }
.tag-item:nth-child(11) { animation-delay: 0.55s; }
.tag-item:nth-child(12) { animation-delay: 0.6s; }
.tag-item:nth-child(n+13) { animation-delay: 0.65s; }

/* CategoryTag Page */
.category-tag-actions {
  display: flex;
  gap: 0.5rem;
}

.category-tag-card-body {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Kendo utility classes that may not be included */
.k-mt-auto { margin-top: auto !important; }
.k-my-8 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
.k-py-8 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.k-px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.k-py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.k-mr-1 { margin-right: 0.25rem !important; }
.k-mr-2 { margin-right: 0.5rem !important; }
.k-mr-4 { margin-right: 1rem !important; }
.k-mr-6 { margin-right: 1.5rem !important; }
.k-ml-2 { margin-left: 0.5rem !important; }
.k-ml-4 { margin-left: 1rem !important; }
.k-mt-2 { margin-top: 0.5rem !important; }
.k-mt-3 { margin-top: 1rem !important; }
.k-mb-4 { margin-bottom: 1.5rem !important; }
.k-gap-2 { gap: 0.5rem !important; }
.k-gap-4 { gap: 1rem !important; }
.k-fs-4 { font-size: 1.5rem !important; }
.k-bg-light { background-color: #f5f5f5 !important; }
.k-border-t { border-top: 1px solid #e0e0e0 !important; }
.k-text-center { text-align: center !important; }
.k-text-muted { color: #666 !important; }
.k-font-weight-bold { font-weight: 700 !important; }
.fw-medium { font-weight: 500 !important; }

/* Kendo flex utilities if missing */
.k-d-flex { display: flex !important; }
.k-flex-wrap { flex-wrap: wrap !important; }
.k-align-items-center { align-items: center !important; }
.k-align-items-start { align-items: flex-start !important; }
.k-justify-content-center { justify-content: center !important; }
.k-justify-content-between { justify-content: space-between !important; }

/* Kendo elevation class if missing */
.k-elevation-2 {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

.k-elevation-3 {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* AppBar enhancements */
.k-appbar {
  padding: 0.25rem 1rem !important;
}

.k-appbar-brand {
  text-decoration: none;
  transition: transform 0.2s ease;
  color: #ff6358;
}

.k-appbar-brand:hover {
  transform: scale(1.02);
  color: #ff6358;
}

.k-appbar-brand i {
  color: #ff6358;
}

.k-appbar-brand span {
  color: #333;
}

.k-appbar-brand:hover i {
  color: #e55449;
}

.k-appbar-brand:hover span {
  color: #ff6358;
}

/* Link hover effects */
.k-link {
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0.25rem;
}

.k-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Card hover effects for learning content */
.k-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border-radius: 0.5rem;
  overflow: hidden;
}

.k-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.k-card img {
  transition: transform 0.3s ease;
}

.k-card:hover img {
  transform: scale(1.05);
}

/* Badge styling enhancements */
.k-badge,
.k-chip {
  transition: all 0.2s ease;
  cursor: pointer;
}

.k-badge:hover,
.k-chip:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Button enhancements */
.k-button {
  transition: all 0.2s ease;
}

.k-button-primary:hover {
  transform: translateY(-2px);
}

/* Improved footer links */
.k-footer .k-link {
  transition: color 0.2s ease;
}

.k-footer .k-link:hover {
  color: var(--kendo-color-primary, #ff6358) !important;
}

/* Privacy page card styling */
.privacy-card {
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Responsive utilities */
@media (max-width: 768px) {
  .category-title {
    font-size: 2rem;
  }

  .category-subtitle {
    font-size: 1rem;
  }

  .tag-card {
    min-height: 90px;
    padding: 0.75rem 0.5rem;
  }

  .tag-icon-wrapper {
    width: 35px;
    height: 35px;
  }

  .tag-icon-wrapper i {
    font-size: 1rem;
  }

  .tag-name {
    font-size: 0.8rem;
  }

  .tag-count {
    font-size: 0.7rem;
  }
}

@media (min-width: 1400px) {
  .tag-item {
    max-width: 16.666%;
    flex: 0 0 16.666%;
  }
}

@media (max-width: 576px) {
  .k-appbar-brand {
    font-size: 1.1rem;
  }

  .display-4 {
    font-size: 2rem;
  }

  .lead {
    font-size: 1rem;
  }

  .k-button {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
}

/* Enhanced focus states for accessibility */
.k-button:focus-visible,
.k-textbox:focus-visible,
.k-input:focus-visible,
a:focus-visible {
  outline: 3px solid var(--kendo-color-primary, #ff6358);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Print styles */
@media print {
  .k-appbar,
  .k-footer,
  .search-section,
  .categories-section {
    display: none;
  }

  body {
    background: white;
  }

  .k-card {
    break-inside: avoid;
  }
}

/* Grid system */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}

.col,
.col-auto {
  flex-basis: 0;
  flex-grow: 1;
  max-width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

.col-auto {
  flex: 0 0 auto;
  width: auto;
}

.g-2 {
  margin-right: -0.5rem;
  margin-left: -0.5rem;
}

.g-2 > * {
  padding-right: 0.5rem;
  padding-left: 0.5rem;
  margin-bottom: 0.5rem;
}

.g-3 {
  margin-right: -1rem;
  margin-left: -1rem;
}

.g-3 > * {
  padding-right: 1rem;
  padding-left: 1rem;
  margin-bottom: 1rem;
}

.g-4 {
  margin-right: -1.5rem;
  margin-left: -1.5rem;
}

.g-4 > * {
  padding-right: 1.5rem;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Responsive columns */
.row-cols-1 > * { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 576px) {
  .row-cols-sm-2 > * { flex: 0 0 50%; max-width: 50%; }
}

@media (min-width: 768px) {
  .row-cols-md-3 > * { flex: 0 0 33.333333%; max-width: 33.333333%; }
  .row-cols-md-4 > * { flex: 0 0 25%; max-width: 25%; }
}

@media (min-width: 992px) {
  .row-cols-lg-4 > * { flex: 0 0 25%; max-width: 25%; }
  .row-cols-lg-5 > * { flex: 0 0 20%; max-width: 20%; }
}

@media (min-width: 1200px) {
  .row-cols-xl-5 > * { flex: 0 0 20%; max-width: 20%; }
}

/* Additional utility classes */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }

.d-flex { display: flex !important; }
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }

.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

.border-top { border-top: 1px solid #e0e0e0 !important; }
.pt-3 { padding-top: 1rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fs-6 { font-size: 1rem !important; }
.small { font-size: 0.875rem !important; }
.lead { font-size: 1.25rem !important; color: #666; line-height: 1.6; }

.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }

.text-decoration-none { text-decoration: none !important; }
.text-center { text-align: center !important; }
.text-muted { color: #757575 !important; }

.display-4 {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Visually hidden utility */
.visually-hidden,
.k-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Performance optimization: reduce motion for users who prefer it */
@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;
  }
}

/* Image Card Component Styles */
.image-card-component {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
       box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.image-card-component:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.image-card-component .k-card-header {
  padding: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.image-card-component .k-avatar {
  width: 48px;
  height: 48px;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, #ff6358 0%, #f093fb 100%);
  margin-right: 0.75rem;
}

.image-card-component .k-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: #333;
  text-transform: capitalize;
}

.image-card-component .k-card-media {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.image-card-component:hover .k-card-media {
  transform: scale(1.05);
}

.image-card-component .k-card-separator {
  height: 1px;
  background: rgba(0, 0, 0, 0.08);
  margin: 0;
}

.image-card-component .k-card-actions {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.image-card-component .k-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  transition: all 0.2s ease;
}

.image-card-component .k-chip:hover {
  background-color: #ff6358;
  color: white;
  transform: scale(1.05);
}

/* Responsive adjustments for image card */
@media (max-width: 768px) {
  .image-card-component .k-card-media {
    height: 180px;
  }

  .image-card-component .k-avatar {
    width: 40px;
    height: 40px;
  font-size: 0.875rem;
  }

  .image-card-component .k-card-title {
    font-size: 1rem;
  }
}

@media (max-width: 576px) {
  .image-card-component .k-card-media {
    height: 160px;
  }
}