/* Performance optimizations */
* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-display: swap;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Custom styles for Tozae applications */
:root {
  --tozae-primary: #258cfb;
  --tozae-primary-hover: #1e7ae6;
  --tozae-secondary: #6c757d;
  --tozae-success: #28a745;
  --tozae-light: #f8f9fa;
  --tozae-dark: #343a40;
}

.btn-primary {
  background-color: var(--tozae-primary);
  border-color: var(--tozae-primary);
}

.btn-primary:hover {
  background-color: var(--tozae-primary-hover);
  border-color: var(--tozae-primary-hover);
}

.btn-outline-primary {
  color: var(--tozae-primary);
  border-color: var(--tozae-primary);
}

.btn-outline-primary:hover {
  background-color: var(--tozae-primary);
  border-color: var(--tozae-primary);
}

.text-primary {
  color: var(--tozae-primary) !important;
}

.bg-primary {
  background-color: var(--tozae-primary) !important;
}

/* Improved typography */
.display-4 {
  font-weight: 700;
  letter-spacing: -0.025em;
}

.lead {
  font-size: 1.25rem;
  font-weight: 300;
}

/* Custom navbar styling */
.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--tozae-primary) !important;
}

/* Improved form styling */
.form-control:focus {
  border-color: var(--tozae-primary);
  box-shadow: 0 0 0 0.2rem rgba(37, 140, 251, 0.25);
  will-change: box-shadow;
}

.form-select:focus {
  border-color: var(--tozae-primary);
  box-shadow: 0 0 0 0.2rem rgba(37, 140, 251, 0.25);
}

/* Enhanced card shadows */
.shadow-lg {
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

/* Performance improvements for animations */
.nav-link, .btn {
  transition: all 0.15s ease-in-out;
}

.features-section .card {
  transition: transform 0.2s ease-in-out;
}

.features-section .card:hover {
  transform: translateY(-5px);
}

/* Optimize images for performance */
img {
  max-width: 100%;
  height: auto;
  loading: lazy;
}

/* Optimize table rendering */
table {
  table-layout: fixed;
}

/* Cache-friendly loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Optimize card layouts for better painting */
.card {
  contain: layout;
}

/* Accessibility improvements */
.btn:focus-visible {
  outline: 2px solid var(--tozae-primary);
  outline-offset: 2px;
}

a:focus-visible {
  outline: 2px solid var(--tozae-primary);
  outline-offset: 2px;
  text-decoration: none;
}

/* Performance-optimized utility classes */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
  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;
}
