/*
 * Core CMS — Shared Base Styles & Utilities
 */

/* Default typography: IBM Plex Sans */
:root {
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  --font-display: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  --default-font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

html, body, button, input, select, textarea, .font-sans, .font-display {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100% !important;
}

/* Alpine.js cloak */
[x-cloak] {
  display: none !important;
}

/* Text Selection */
::selection {
  background-color: rgba(99, 102, 241, 0.45);
  color: #ffffff;
}
::-moz-selection {
  background-color: rgba(99, 102, 241, 0.45);
  color: #ffffff;
}

/* Transparent checkerboard backgrounds for media previews */
.smart-bg-transparent-grid-dark {
  background-image: linear-gradient(45deg, #1e293b 25%, transparent 25%), 
                    linear-gradient(-45deg, #1e293b 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #1e293b 75%), 
                    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
  background-color: #0f172a !important;
}

.smart-bg-transparent-grid-light {
  background-image: linear-gradient(45deg, #cbd5e1 25%, transparent 25%), 
                    linear-gradient(-45deg, #cbd5e1 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #cbd5e1 75%), 
                    linear-gradient(-45deg, transparent 75%, #cbd5e1 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0px;
  background-color: #f8fafc !important;
}

/* Preserve original colors of media and images inside dark-mode inverted containers */
.invert img,
.invert video,
.invert iframe,
.invert canvas,
.invert [data-no-invert] {
  filter: invert(100%) hue-rotate(180deg);
}

.invert:not(.hue-rotate-180) img,
.invert:not(.hue-rotate-180) video,
.invert:not(.hue-rotate-180) iframe,
.invert:not(.hue-rotate-180) canvas,
.invert:not(.hue-rotate-180) [data-no-invert] {
  filter: invert(100%);
}

/* Glass navigation utility */
.glass-nav {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

/* Page fade-in sunrise animation */
@keyframes pageSunrise {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.page-sunrise {
  animation: pageSunrise 1000ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  will-change: opacity;
}


/* Sticky hlavička tabulek (administrace) */
.core-sticky-table {
  border-collapse: separate;
  border-spacing: 0;
}

.core-sticky-table thead {
  position: sticky;
  top: 0;
  z-index: 20;
  background-color: #f8fafc;
  box-shadow: 0 2px 4px rgb(15 23 42 / 0.06);
}

.core-sticky-table thead tr,
.core-sticky-table th {
  background-color: #f8fafc;
}

.core-sticky-table th {
  border-top: 1px solid #e2e8f0;
  border-bottom: 2px solid #cbd5e1;
}

.core-sticky-table-wrapper {
  max-height: min(70vh, 44rem);
  overflow: auto;
  position: relative;
  isolation: isolate;
  background-color: #ffffff;
}