/* ============================================================================
   Logging Entry Polish 2026
   Applied to outofclass.html and infringements.html after inline page styles.
   Focus: crisp data entry, reduced clipping, calmer motion, premium controls.
   ============================================================================ */

body[data-page="outofclass"],
body[data-page="infringements"] {
  --entry-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --entry-border: rgba(148, 163, 184, 0.24);
  --entry-border-strong: rgba(14, 165, 233, 0.36);
  --entry-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --entry-shadow-hover: 0 16px 34px rgba(15, 23, 42, 0.11);
  --entry-ring: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

body[data-page="outofclass"] .unified-logging-container,
body[data-page="infringements"] .unified-logging-container {
  position: relative;
  isolation: isolate;
}

body[data-page="outofclass"] .unified-form-section,
body[data-page="infringements"] .unified-form-section,
body[data-page="outofclass"] .selected-students-container,
body[data-page="infringements"] .selected-students-container,
body[data-page="outofclass"] .filters-section,
body[data-page="infringements"] .filters-section,
body[data-page="outofclass"] .selection-section,
body[data-page="infringements"] .selection-section,
body[data-page="outofclass"] .submit-section,
body[data-page="infringements"] .submit-section {
  overflow: visible !important;
}

body[data-page="outofclass"] .unified-form-section,
body[data-page="infringements"] .unified-form-section {
  position: relative;
  border-radius: 8px !important;
  border: 1px solid var(--entry-border) !important;
  box-shadow: var(--entry-shadow) !important;
  transform: translateY(0);
  transition:
    border-color 180ms var(--entry-ease),
    box-shadow 180ms var(--entry-ease),
    transform 180ms var(--entry-ease) !important;
}

body[data-page="outofclass"] .unified-form-section:hover,
body[data-page="infringements"] .unified-form-section:hover {
  transform: translateY(-1px) !important;
  border-color: var(--entry-border-strong) !important;
  box-shadow: var(--entry-shadow-hover) !important;
}

body[data-page="outofclass"] .unified-student-section,
body[data-page="infringements"] .unified-student-section {
  z-index: 40;
}

body[data-page="outofclass"] #categorySelectionSection,
body[data-page="infringements"] #categorySelectionSection,
body[data-page="outofclass"] #selectionSection,
body[data-page="infringements"] #selectionSection {
  z-index: 10;
}

body[data-page="outofclass"] .unified-form-section .section-header,
body[data-page="infringements"] .unified-form-section .section-header {
  border-radius: 8px 8px 0 0 !important;
  min-width: 0;
}

body[data-page="outofclass"] .unified-form-section .section-header h2,
body[data-page="infringements"] .unified-form-section .section-header h2 {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem) !important;
  letter-spacing: 0 !important;
}

body[data-page="outofclass"] #selectedStudentsContainer[style*="display: block"],
body[data-page="infringements"] #selectedStudentsContainer[style*="display: block"],
body[data-page="outofclass"] #categorySelectionSection[style*="display: block"],
body[data-page="infringements"] #categorySelectionSection[style*="display: block"],
body[data-page="outofclass"] #selectionSection[style*="display: block"],
body[data-page="infringements"] #selectionSection[style*="display: block"],
body[data-page="outofclass"] #submitSection[style*="display: block"],
body[data-page="infringements"] #submitSection[style*="display: block"] {
  animation: entryReveal 220ms var(--entry-ease);
}

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

body[data-page="outofclass"] .search-input-wrapper,
body[data-page="infringements"] .search-input-wrapper {
  z-index: 50;
}

body[data-page="outofclass"] .search-input,
body[data-page="infringements"] .search-input,
body[data-page="outofclass"] .form-input,
body[data-page="infringements"] .form-input,
body[data-page="outofclass"] .form-select,
body[data-page="infringements"] .form-select {
  min-height: 46px !important;
  border-radius: 8px !important;
  border: 1.5px solid rgba(203, 213, 225, 0.95) !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  transition:
    border-color 160ms var(--entry-ease),
    box-shadow 160ms var(--entry-ease),
    background-color 160ms var(--entry-ease) !important;
}

body[data-page="outofclass"] .search-input:hover,
body[data-page="infringements"] .search-input:hover,
body[data-page="outofclass"] .form-input:hover,
body[data-page="infringements"] .form-input:hover,
body[data-page="outofclass"] .form-select:hover,
body[data-page="infringements"] .form-select:hover {
  border-color: rgba(14, 165, 233, 0.42) !important;
}

body[data-page="outofclass"] .search-input:focus,
body[data-page="infringements"] .search-input:focus,
body[data-page="outofclass"] .form-input:focus,
body[data-page="infringements"] .form-input:focus,
body[data-page="outofclass"] .form-select:focus,
body[data-page="infringements"] .form-select:focus {
  border-color: #0ea5e9 !important;
  box-shadow: var(--entry-ring) !important;
  background: #ffffff !important;
}

body[data-page="outofclass"] .search-dropdown,
body[data-page="infringements"] .search-dropdown {
  max-height: min(420px, 52vh) !important;
  border-radius: 8px !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.18) !important;
  z-index: 10000 !important;
}

body[data-page="outofclass"] .dropdown-content,
body[data-page="infringements"] .dropdown-content {
  max-height: min(420px, 52vh) !important;
  overscroll-behavior: contain;
}

body[data-page="outofclass"] .dropdown-item,
body[data-page="infringements"] .dropdown-item {
  transition: background-color 120ms var(--entry-ease), border-color 120ms var(--entry-ease) !important;
}

body[data-page="outofclass"] .dropdown-item:hover,
body[data-page="outofclass"] .dropdown-item.highlighted,
body[data-page="infringements"] .dropdown-item:hover,
body[data-page="infringements"] .dropdown-item.highlighted {
  transform: none !important;
}

body[data-page="outofclass"] .selected-students-container,
body[data-page="infringements"] .selected-students-container {
  border-radius: 8px !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

body[data-page="outofclass"] .selected-students,
body[data-page="infringements"] .selected-students {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)) !important;
  align-items: stretch !important;
}

body[data-page="outofclass"] .student-card.enhanced-card,
body[data-page="infringements"] .student-card.enhanced-card {
  min-height: 96px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06) !important;
  transform: translateY(0) !important;
  transition:
    border-color 160ms var(--entry-ease),
    box-shadow 160ms var(--entry-ease),
    transform 160ms var(--entry-ease) !important;
}

body[data-page="outofclass"] .student-card.enhanced-card::before,
body[data-page="infringements"] .student-card.enhanced-card::before {
  display: none !important;
}

body[data-page="outofclass"] .student-card.enhanced-card:hover,
body[data-page="infringements"] .student-card.enhanced-card:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(14, 165, 233, 0.38) !important;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.09) !important;
}

body[data-page="outofclass"] .student-card.enhanced-card .student-photo,
body[data-page="infringements"] .student-card.enhanced-card .student-photo {
  border-width: 2px !important;
  transform: none !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12) !important;
}

body[data-page="outofclass"] .student-card.enhanced-card:hover .student-photo,
body[data-page="infringements"] .student-card.enhanced-card:hover .student-photo {
  transform: none !important;
}

body[data-page="outofclass"] .student-card.enhanced-card .student-name,
body[data-page="infringements"] .student-card.enhanced-card .student-name {
  color: #0f172a !important;
  font-size: 0.98rem !important;
  margin-top: 0 !important;
}

body[data-page="outofclass"] .student-card.enhanced-card .meta-badge,
body[data-page="infringements"] .student-card.enhanced-card .meta-badge {
  border-radius: 8px !important;
}

body[data-page="outofclass"] .student-card.enhanced-card .remove-student,
body[data-page="infringements"] .student-card.enhanced-card .remove-student {
  top: 10px !important;
  right: 10px !important;
  border-radius: 8px !important;
  transform: none !important;
}

body[data-page="outofclass"] .student-card.enhanced-card .remove-student:hover,
body[data-page="infringements"] .student-card.enhanced-card .remove-student:hover {
  transform: translateY(-1px) !important;
}

body[data-page="outofclass"] .category-cards-container,
body[data-page="infringements"] .category-cards-container {
  gap: 14px !important;
}

body[data-page="infringements"] .category-card {
  min-height: 210px !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14) !important;
  transition:
    box-shadow 180ms var(--entry-ease),
    transform 180ms var(--entry-ease),
    border-color 180ms var(--entry-ease) !important;
}

body[data-page="infringements"] .category-card:hover {
  transform: translateY(-2px) scale(1.005) !important;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18) !important;
}

body[data-page="infringements"] .category-card:active {
  transform: translateY(0) scale(0.998) !important;
}

body[data-page="infringements"] .category-card::before {
  display: none !important;
}

body[data-page="infringements"] .category-card.selected {
  outline: 3px solid rgba(255, 255, 255, 0.8) !important;
  outline-offset: -8px !important;
}

body[data-page="outofclass"] .datetime-section,
body[data-page="infringements"] .datetime-section {
  border-radius: 8px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
}

body[data-page="outofclass"] .datetime-options,
body[data-page="infringements"] .datetime-options {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)) !important;
}

body[data-page="outofclass"] .datetime-option,
body[data-page="infringements"] .datetime-option {
  border-radius: 8px !important;
  border: 1.5px solid rgba(203, 213, 225, 0.92) !important;
  background: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  transform: none !important;
  transition:
    border-color 160ms var(--entry-ease),
    box-shadow 160ms var(--entry-ease),
    background-color 160ms var(--entry-ease) !important;
}

body[data-page="outofclass"] .datetime-option::before,
body[data-page="infringements"] .datetime-option::before {
  display: none !important;
}

body[data-page="outofclass"] .datetime-option:hover,
body[data-page="infringements"] .datetime-option:hover {
  transform: none !important;
  border-color: rgba(14, 165, 233, 0.42) !important;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07) !important;
}

body[data-page="outofclass"] .datetime-option:has(input[type="radio"]:checked),
body[data-page="infringements"] .datetime-option:has(input[type="radio"]:checked) {
  border-color: #0ea5e9 !important;
  background: #f0f9ff !important;
  outline: 2px solid rgba(14, 165, 233, 0.18) !important;
  outline-offset: 1px !important;
}

body[data-page="outofclass"] .custom-datetime-inputs,
body[data-page="infringements"] .custom-datetime-inputs {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

body[data-page="outofclass"] .datetime-grid,
body[data-page="infringements"] .datetime-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)) !important;
}

body[data-page="outofclass"] .submit-btn,
body[data-page="infringements"] .submit-btn {
  min-height: 50px !important;
  border-radius: 8px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  transform: translateY(0) !important;
  transition:
    box-shadow 180ms var(--entry-ease),
    transform 180ms var(--entry-ease),
    filter 180ms var(--entry-ease) !important;
}

body[data-page="outofclass"] .submit-btn:hover:not(:disabled),
body[data-page="infringements"] .submit-btn:hover:not(:disabled) {
  transform: translateY(-1px) !important;
  letter-spacing: 0 !important;
  filter: saturate(1.04) brightness(1.02);
}

body[data-page="outofclass"] .submit-btn:hover:not(:disabled) .submit-btn-icon,
body[data-page="infringements"] .submit-btn:hover:not(:disabled) .submit-btn-icon,
body[data-page="outofclass"] .submit-btn:hover:not(:disabled) .submit-btn-arrow,
body[data-page="infringements"] .submit-btn:hover:not(:disabled) .submit-btn-arrow {
  transform: none !important;
}

body[data-page="outofclass"] .submit-btn:disabled,
body[data-page="infringements"] .submit-btn:disabled {
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%) !important;
  color: #64748b !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
  opacity: 1 !important;
}

body[data-page="outofclass"] .submit-btn-ready,
body[data-page="infringements"] .submit-btn-ready {
  animation: none !important;
}

body[data-page="outofclass"] #confirmationModalOverlay,
body[data-page="infringements"] #confirmationModalOverlay {
  padding: 16px !important;
  background: rgba(15, 23, 42, 0.52) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

body[data-page="outofclass"] #confirmationModalOverlay .modal-container,
body[data-page="infringements"] #confirmationModalOverlay .modal-container {
  width: min(92vw, 640px) !important;
  max-height: min(760px, calc(100vh - 32px)) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  box-shadow: 0 24px 72px rgba(15, 23, 42, 0.28) !important;
}

body[data-page="outofclass"] #confirmationModalOverlay .modal-body,
body[data-page="infringements"] #confirmationModalOverlay .modal-body {
  max-height: min(56vh, 430px) !important;
  overscroll-behavior: contain;
}

body[data-page="outofclass"] #confirmationModalOverlay .modal-footer,
body[data-page="infringements"] #confirmationModalOverlay .modal-footer {
  border-radius: 0 0 8px 8px !important;
}

body[data-page="outofclass"] #confirmationModalOverlay button,
body[data-page="infringements"] #confirmationModalOverlay button,
body[data-page="infringements"] #backToCategoryBtn {
  border-radius: 8px !important;
  transition:
    transform 160ms var(--entry-ease),
    box-shadow 160ms var(--entry-ease),
    border-color 160ms var(--entry-ease),
    background-color 160ms var(--entry-ease) !important;
}

body[data-page="outofclass"] #confirmationModalOverlay button:hover,
body[data-page="infringements"] #confirmationModalOverlay button:hover,
body[data-page="infringements"] #backToCategoryBtn:hover {
  transform: translateY(-1px);
}

/* --- Clipping and Clarity Hardening -------------------------------------- */

body[data-page="outofclass"] .unified-page-header,
body[data-page="infringements"] .unified-page-header,
body[data-page="outofclass"] .analytics-card,
body[data-page="infringements"] .analytics-card,
body[data-page="outofclass"] .category-card,
body[data-page="infringements"] .category-card {
  min-width: 0 !important;
}

body[data-page="outofclass"] .unified-page-header > div:first-child,
body[data-page="infringements"] .unified-page-header > div:first-child {
  min-width: 0 !important;
}

body[data-page="outofclass"] .unified-page-header > div:first-child > div:first-child,
body[data-page="infringements"] .unified-page-header > div:first-child > div:first-child {
  min-width: 0 !important;
  flex: 1 1 360px !important;
}

body[data-page="outofclass"] .unified-page-header > div:first-child > div:last-child,
body[data-page="infringements"] .unified-page-header > div:first-child > div:last-child {
  flex: 0 1 auto !important;
}

body[data-page="outofclass"] .unified-page-title,
body[data-page="infringements"] .unified-page-title,
body[data-page="outofclass"] .unified-page-subtitle,
body[data-page="infringements"] .unified-page-subtitle {
  overflow-wrap: anywhere !important;
}

body[data-page="outofclass"] .analytics-card,
body[data-page="infringements"] .analytics-card {
  align-items: flex-start !important;
  min-height: 98px !important;
}

body[data-page="outofclass"] .analytics-card-content,
body[data-page="infringements"] .analytics-card-content {
  min-width: 0 !important;
  width: 100% !important;
}

body[data-page="outofclass"] .analytics-card-value,
body[data-page="infringements"] .analytics-card-value,
body[data-page="outofclass"] .analytics-list-name,
body[data-page="infringements"] .analytics-list-name {
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}

body[data-page="outofclass"] .analytics-list,
body[data-page="infringements"] .analytics-list {
  min-width: 0 !important;
  padding-left: 0 !important;
}

body[data-page="outofclass"] .analytics-list-item,
body[data-page="infringements"] .analytics-list-item {
  min-width: 0 !important;
  align-items: flex-start !important;
}

body[data-page="outofclass"] .filters-accordion summary > span:last-child,
body[data-page="infringements"] .filters-accordion summary > span:last-child {
  margin-left: 0 !important;
  flex: 1 1 180px !important;
  text-align: right !important;
}

body[data-page="infringements"] .category-card {
  overflow: visible !important;
  padding: clamp(1.15rem, 2.4vw, 1.75rem) !important;
}

body[data-page="infringements"] .category-card > div,
body[data-page="infringements"] .category-card h3,
body[data-page="infringements"] .category-card p {
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

@media (max-width: 640px) {
  body[data-page="outofclass"] .unified-form-section,
  body[data-page="infringements"] .unified-form-section {
    border-radius: 8px !important;
  }

  body[data-page="outofclass"] .datetime-options,
  body[data-page="infringements"] .datetime-options,
  body[data-page="outofclass"] .datetime-grid,
  body[data-page="infringements"] .datetime-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="outofclass"] .submit-btn,
  body[data-page="infringements"] .submit-btn {
    width: 100% !important;
    min-width: 0 !important;
  }

  body[data-page="outofclass"] .unified-page-header > div:first-child > div:last-child,
  body[data-page="infringements"] .unified-page-header > div:first-child > div:last-child {
    justify-content: flex-start !important;
    width: 100% !important;
  }

  body[data-page="outofclass"] .unified-page-header > div:first-child > div:last-child button,
  body[data-page="infringements"] .unified-page-header > div:first-child > div:last-child button {
    flex: 1 1 140px !important;
    min-width: 0 !important;
    white-space: normal !important;
  }

  body[data-page="outofclass"] .filters-accordion summary > span:last-child,
  body[data-page="infringements"] .filters-accordion summary > span:last-child {
    flex-basis: 100% !important;
    text-align: left !important;
  }

  body[data-page="infringements"] .category-card {
    min-height: auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="outofclass"] *,
  body[data-page="outofclass"] *::before,
  body[data-page="outofclass"] *::after,
  body[data-page="infringements"] *,
  body[data-page="infringements"] *::before,
  body[data-page="infringements"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
