/* ===== Design system – tokeny, typografie, komponenty ===== */

/* Font loaded via <link> in layout.php for better performance */

:root {
  /* Barevná paleta (HSL bez hsl() pro Tailwind) */
  --primary: 199 89% 48%;
  --primary-foreground: 0 0% 100%;
  --accent: 45 100% 51%;
  --accent-foreground: 210 25% 15%;
  --background: 0 0% 100%;
  --foreground: 210 25% 15%;
  --muted: 210 20% 96%;
  --muted-foreground: 210 15% 45%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;
  --border: 210 20% 90%;
  --input: 210 20% 90%;
  --ring: 199 89% 48%;
  /* Sidebar */
  --sidebar-background: 210 25% 12%;
  --sidebar-foreground: 210 20% 98%;
  --sidebar-primary: 199 89% 55%;
  --sidebar-muted: 210 20% 25%;
  --sidebar-border: 210 20% 18%;
  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  /* Stíny */
  --shadow-soft: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
  --shadow-card: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-glow: 0 0 20px -2px hsl(199 89% 48% / 0.25);
}

.dark {
  --background: 210 25% 8%;
  --foreground: 210 20% 98%;
  --muted: 210 20% 18%;
  --muted-foreground: 210 15% 65%;
  --border: 210 20% 18%;
  --input: 210 20% 18%;
  --ring: 199 89% 55%;
  --sidebar-background: 210 25% 6%;
  --sidebar-foreground: 210 20% 98%;
  --sidebar-muted: 210 20% 22%;
  --sidebar-border: 210 20% 14%;
  --shadow-soft: 0 1px 3px 0 rgb(0 0 0 / 0.3);
  --shadow-card: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.2);
  --shadow-glow: 0 0 24px -2px hsl(199 89% 55% / 0.35);
}

/* Typografie */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* Gradienty */
.gradient-primary {
  background: linear-gradient(135deg, hsl(199 89% 48%), hsl(199 85% 40%));
}
.gradient-hero {
  background: linear-gradient(135deg, hsl(199 89% 48%), hsl(210 80% 35%));
}
.gradient-card {
  background: linear-gradient(180deg, hsl(0 0% 100%), hsl(199 60% 97%));
}
.dark .gradient-card {
  background: linear-gradient(180deg, hsl(210 25% 12%), hsl(210 25% 10%));
}
.gradient-accent {
  background: linear-gradient(135deg, hsl(45 100% 51%), hsl(40 100% 45%));
}

/* Stíny */
.shadow-soft {
  box-shadow: var(--shadow-soft);
}
.shadow-card {
  box-shadow: var(--shadow-card);
}
.shadow-glow {
  box-shadow: var(--shadow-glow);
}

/* Animace */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulse-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 20px -2px hsl(199 89% 48% / 0.25); }
  50% { opacity: 0.9; box-shadow: 0 0 28px -2px hsl(199 89% 48% / 0.4); }
}
.animate-float {
  animation: float 6s ease-in-out infinite;
}
.animate-pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

/* Accordion */
.accordion-content {
  overflow: hidden;
  transition: height 0.2s ease-out, opacity 0.2s ease-out;
}

/* Komponenty – tlačítka (shadcn-style varianty) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: var(--radius-lg);
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring));
}
.btn-default {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.btn-default:hover {
  background: hsl(199 89% 42%);
}
.btn-destructive {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}
.btn-destructive:hover {
  background: hsl(0 84% 52%);
}
.btn-outline {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}
.btn-outline:hover {
  background: hsl(var(--muted));
}
.btn-secondary {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.btn-secondary:hover {
  background: hsl(210 20% 92%);
}
.dark .btn-secondary:hover {
  background: hsl(210 20% 22%);
}
.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
}
.btn-ghost:hover {
  background: hsl(var(--muted));
}
.btn-link {
  background: transparent;
  color: hsl(var(--primary));
  text-underline-offset: 4px;
}
.btn-link:hover {
  text-decoration: underline;
}

/* Karty */
.card {
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.dark .card {
  background: hsl(210 25% 11%);
}

/* Inputy */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
select,
textarea {
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--input));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Sidebar – tokeny */
.sidebar-bg {
  background: hsl(var(--sidebar-background));
}
.sidebar-text {
  color: hsl(var(--sidebar-foreground));
}
.sidebar-border {
  border-color: hsl(var(--sidebar-border));
}
.sidebar-item:hover,
.sidebar-item-active {
  background: hsl(var(--sidebar-muted));
}
.sidebar-item-active {
  color: hsl(var(--sidebar-primary));
}

/* Sidebar FeedManager – světlý vzhled (light mode) */
html:not(.dark) .sidebar-feedmanager {
  background: #f0f7ff;
  color: #1e3a5f;
}
html:not(.dark) .sidebar-feedmanager .sidebar-border {
  border-color: #d4e4f7;
}
html:not(.dark) .sidebar-feedmanager .sidebar-item {
  color: #4a6a8f;
}
html:not(.dark) .sidebar-feedmanager .sidebar-item:hover {
  background: #e0edfb;
  color: #1e3a5f;
}
html:not(.dark) .sidebar-feedmanager .sidebar-item-active {
  background: #ddeeff;
  color: #0c4a6e;
}
html:not(.dark) .sidebar-feedmanager .sidebar-section-label {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem 0.25rem;
}
html:not(.dark) .sidebar-feedmanager .logo-text {
  color: #0c4a6e;
}
/* Ohraničení levého panelu – světle šedá jako u karet */
html:not(.dark) #sidebar {
  border-right-color: hsl(var(--border));
}
/* Sekce Vzhled ve sidebaru – linka a text viditelný ve světlém režimu */
html:not(.dark) .sidebar-feedmanager .sidebar-footer {
  border-top-color: hsl(var(--border));
}
html:not(.dark) .sidebar-feedmanager .sidebar-header-row {
  border-bottom-color: hsl(var(--border));
}
html:not(.dark) .sidebar-feedmanager .sidebar-footer-label {
  color: #4a6a8f;
}
/* Tlačítka ve footeru – viditelnost ve světlém i tmavém režimu */
html:not(.dark) .sidebar-feedmanager .sidebar-footer-btn {
  color: #0c4a6e;
}
html:not(.dark) .sidebar-feedmanager .sidebar-footer-btn:hover {
  background: #ddeeff;
  color: #0c4a6e;
}
html:not(.dark) .sidebar-feedmanager .sidebar-collapse-btn {
  border-color: #94b8d4;
}

/* Tables */
table {
  border-collapse: collapse;
}

/* Loading */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin {
  animation: spin 0.7s linear infinite;
}

/* Flash message animation */
@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-flash-in {
  animation: flash-in 0.3s ease-out;
}
.flash-message {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Empty state illustrations */
.empty-state-icon {
  width: 4rem;
  height: 4rem;
  color: hsl(var(--muted-foreground));
  opacity: 0.5;
}

/* Sticky first column in scrollable tables */
.table-sticky-col th:first-child,
.table-sticky-col td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: hsl(var(--background));
}
.dark .table-sticky-col td:first-child {
  background: hsl(210 25% 11%);
}
.table-sticky-col thead th:first-child {
  z-index: 2;
  background: hsl(var(--muted));
}

/* Improved focus indicators */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

/* Touch target minimum sizing for mobile */
@media (max-width: 767px) {
  .btn, button {
    min-height: 44px;
  }
}
