/* --- FONTY --- */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Next:ital,wght@0,400;0,500;0,700;1,400;1,700&display=swap');

/* --- ZÁKLAD A RESET --- */
html, body {
  font-size: 15px;
  font-family: 'Atkinson Hyperlegible Next', sans-serif;
  line-height: 1.5;
  padding: 0;
  margin: 0;
  min-height: 100vh; 
  display: flex;
  flex-direction: column; 
  background-color: #cbd5e1; 
  color: #334155;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
*:before, *:after { box-sizing: border-box; }
audio, canvas, img, video { vertical-align: middle; }
fieldset { border: 0; margin: 0; padding: 0; }
textarea { resize: vertical; }

::-moz-selection { background: #bae6fd; text-shadow: none; color: #0369a1; }
::selection { background: #bae6fd; text-shadow: none; color: #0369a1; }

hr {
  display: block; height: 1px; border: 0;
  border-top: 1px solid #cbd5e1; margin: 1.5em 0; padding: 0;
}

/* --- HLAVNÍ ROZLOŽENÍ --- */
.wrapper {
  margin: 75px auto 40px auto; 
  flex: 1 0 auto; 
  width: 100%;
  max-width: 1000px;
  background-color: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* --- PŘIHLAŠOVACÍ OBRAZOVKA (VYLEPŠENÁ) --- */
body.logged-out {
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

body.logged-out .site-footer {
  display: none !important; 
}

.uprostred {
  margin: auto;
  padding: 45px 40px;
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 15px rgba(0,0,0,0.05);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.login-title {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(to right, #0284c7, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 5px 0;
  text-align: center;
  letter-spacing: -1px;
}

.login-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
  margin: 0 0 25px 0;
  line-height: 1.4;
}

.login-status {
  text-align: center;
  color: #059669;
  background: #d1fae5;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  margin: 0 auto 30px auto;
}

.login-status.info {
  color: #0284c7; background: #e0f2fe;
}

.form-control.login-input {
  padding: 12px 16px;
  font-size: 15px;
  border-radius: 10px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
}

.form-control.login-input:focus {
  background-color: #ffffff;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border-radius: 10px;
  background: linear-gradient(to right, #0ea5e9, #0284c7) !important;
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3) !important;
  float: none !important;
}

.login-btn:hover {
  background: linear-gradient(to right, #0284c7, #0369a1) !important;
  box-shadow: 0 6px 15px rgba(2, 132, 199, 0.4) !important;
}

.login-link {
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  display: block;
}

.login-link:hover {
  color: #0ea5e9;
}

/* --- PATIČKA --- */
.site-footer {
  text-align: center;
  padding: 20px 15px;
  color: #64748b;
  font-size: 0.9rem;
  margin-top: 20px;
  flex-shrink: 0; 
}
.site-footer a {
  color: #0ea5e9;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}
.site-footer a:hover {
  color: #0284c7;
  text-decoration: underline;
}

/* --- NAVIGACE --- */
.topnav {
  background-color: #1e293b; 
  border-bottom: 2px solid #0f172a;
  position: fixed;
  top: 0; width: 100%;
  z-index: 2000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.topnav a {
  float: left;
  display: block;
  color: #cbd5e1;
  text-align: center;
  padding: 14px 20px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.topnav a:hover { color: #ffffff; background: #334155; }
.topnav a.active {
  color: #ffffff;
  background-color: #0ea5e9; 
}
.topnav .logout { float: right; color: #f87171; }
.topnav .logout:hover { background: #7f1d1d; color: #fca5a5; }

.topnav .icon {
  display: none;
  padding: 14px 20px;
  color: #cbd5e1;
  transition: color 0.2s ease;
}
.topnav .icon:hover {
  color: #ffffff;
  background: transparent; 
}
.topnav .icon svg {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}

/* --- FORMULÁŘE, OVLÁDACÍ PRVKY A FILTRY --- */
.topbar { margin-bottom: 15px; }

.topbar form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.form-control, .date-picker {
  width: 100%;
  display: block;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: #334155;
  background-color: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  transition: all 0.2s ease;
  height: auto;
}

.form-control:focus, .date-picker:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
  outline: none;
}
.form-control:disabled { background-color: #e2e8f0; cursor: not-allowed; }

.white-space-nowrap {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.white-space-nowrap label {
  display: inline-flex;
  align-items: center;
  margin: 0 !important; 
  cursor: pointer;
  color: #475569;
  font-weight: 500;
}

input[type="radio"], input[type="checkbox"] {
  margin: 0 6px 0 0; 
  width: 16px;
  height: 16px;
  accent-color: #0ea5e9; 
  cursor: pointer;
}

.formular .group { padding: 8px 0; }
.formular .group label { display: block; font-weight: 600; margin-bottom: 4px; color: #475569; }

/* --- TLAČÍTKA --- */
input[type=submit], input[type=button], button, .submit-filter {
  background: #3b82f6; 
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

input[type=submit]:hover:not([disabled]), button:hover:not([disabled]) {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

.edit {
  height: 32px; width: 32px;
  padding: 5px;
  border-radius: 6px;
  background: #e2e8f0;
  margin-left: 6px;
  float: right;
  opacity: 0;
  transition: all 0.2s ease;
  cursor: pointer;
}
.edit img { width: 100%; height: 100%; }
.zpravy:hover .edit { opacity: 1; }
.edit:hover { background: #cbd5e1; transform: scale(1.1); }

/* --- TABULKY --- */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 15px; 
}
.table-header td, th {
  background: #e2e8f0; 
  color: #334155;
  font-weight: 600;
  padding: 10px 12px; 
  border-bottom: 2px solid #cbd5e1;
}
td { 
    padding: 8px 12px; 
    border-bottom: 1px solid #e2e8f0; 
    vertical-align: middle;
}
tr:hover td { background: #e2e8f0; } 
tr:nth-child(even) td { background-color: #f8fafc; } 

.zaplaceno, .vysledky {
    margin: auto;
    margin-top: 20px;
    width: 100%;
}

/* --- ZPRÁVY A UDÁLOSTI --- */
.zpravy {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.zpravy:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.08);
  border-color: #94a3b8;
}
.zpravy.archiv { background: #f8fafc; border-color: #e2e8f0; opacity: 0.8; }
.zpravy-udaje { font-size: 0.85em; color: #64748b; margin-bottom: 6px; }
.zpravy-hlavicka b { font-size: 1.15em; color: #0f172a; }
.zpravy-telo { margin-top: 8px; color: #334155; }
.zpravy-telo img { border-radius: 6px; max-width: 100%; margin-top: 8px; }

/* Oddělení uživatelů - Detail události */
.user-row {
  padding: 14px 0;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.user-row:last-child { border-bottom: none; padding-bottom: 0; }
.user-row:first-child { padding-top: 0; }
.user-name { font-weight: 600; color: #334155; font-size: 1.05rem; }

/* Status Účasti - VYLEPŠENO */
.ucast { 
  border-radius: 8px; 
  font-weight: 600; 
  padding: 10px 40px 10px 16px; 
  color: white; 
  cursor: pointer; 
  height: auto; 
  border: 1px solid transparent; 
  text-align: left;
  font-size: 15px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  width: 100%;
  max-width: 250px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.ucast:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.4);
}
.ucast:disabled {
  opacity: 0.85;
  cursor: not-allowed;
}
.ucast1 { background-color: #94a3b8; }
.ucast2 { background-color: #0d9488; }
.ucast3 { background-color: #e11d48; }

.ucast1:hover:enabled { background-color: #64748b; }
.ucast2:hover:enabled { background-color: #0f766e; }
.ucast3:hover:enabled { background-color: #be123c; }


/* --- GALERIE --- */
figure {
  display: inline-block;
  width: calc(25% - 10px);
  margin: 5px;
  position: relative;
}
.show_pic {
  border-radius: 8px;
  width: 100%; height: auto;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
figure:hover .show_pic {
  transform: scale(1.05);
  box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

/* --- UTILITY TŘÍDY --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-gray { color: #64748b; }
.text-grey { color: #94a3b8; }
.text-black { color: #0f172a; }

.color-primary { color: #059669; font-weight: 600; }
.color-danger { color: #e11d48; font-weight: 600; }
.color-muted { color: #94a3b8; }
.bg-primary-light { background: #ccfbf1; color: #115e59; font-weight: bold; border-radius: 6px; }

.w-100 { width: 100%; }
.w-120px { width: 120px !important; display: inline-block;}
.w-70px { width: 70px; }
.w-50px { width: 50px; }
.w-40px { width: 40px; }
.w-25px { width: 25px; }
.max-w-450 { max-width: 450px; }
.max-w-300 { max-width: 300px; }

.d-none { display: none; }
.d-block { display: block; }
.d-inline-block { display: inline-block; }

.fs-15 { font-size: 15px; }
.fs-20 { font-size: 1.15rem; }
.fs-30 { font-size: 1.5rem; font-weight: 700; color: #0f172a; }
.fs-50 { font-size: 2.5rem; font-weight: 700; color: #0ea5e9; }

.mb-10 { margin-bottom: 10px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }
.mt-10 { margin-top: 10px; }
.mt-40 { margin-top: 40px; }
.mt-50 { margin-top: 25px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.white-space-nowrap { white-space: nowrap; }
.cursor-pointer { cursor: pointer; }
.position-absolute { position: absolute; }
.left-offscreen { left: -9999px; }
.form-control-inline { width: 80px !important; display: inline-block; text-align: center; font-weight: bold;}

.hlaska_true { background: #dcfce7; color: #0f766e; padding: 12px; border-radius: 6px; text-align: center; font-weight: 500; margin-bottom:12px; }
.hlaska_false { background: #ffe4e6; color: #be123c; padding: 12px; border-radius: 6px; text-align: center; font-weight: 500; margin-bottom:12px; }

/* --- MOBILNÍ VERZE --- */
@media screen and (max-width: 768px) {
  .wrapper { margin: 65px 15px 0 15px; width: auto; padding: 20px; border-radius: 10px; }
  .topnav a { display: none; }
  .topnav a.icon { float: right; display: flex; align-items: center; height: 52px; }
  .topnav.responsive { position: fixed; height: auto; background: #1e293b; }
  .topnav.responsive a { display: block; float: none; text-align: left; }
  .edit { opacity: 1; }
  figure { width: calc(50% - 10px); }
  .white-space-nowrap { flex-direction: column; align-items: flex-start; gap: 8px;}
}

/* --- PHOTOSWIPE --- */
.pswp { display: none; position: absolute; width: 100%; height: 100%; left: 0; top: 0; overflow: hidden; -ms-touch-action: none; touch-action: none; z-index: 2500; -webkit-text-size-adjust: 100%; -webkit-backface-visibility: hidden; outline: none; }
.pswp * { box-sizing: border-box; }
.pswp img { max-width: none; }
.pswp--animate_opacity { opacity: 0.001; will-change: opacity; transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp--open { display: block; }
.pswp--zoom-allowed .pswp__img { cursor: zoom-in; }
.pswp--zoomed-in .pswp__img { cursor: grab; }
.pswp--dragging .pswp__img { cursor: grabbing; }
.pswp__bg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #0f172a; opacity: 0; transform: translateZ(0); -webkit-backface-visibility: hidden; will-change: opacity; transition: opacity 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp__scroll-wrap { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; }
.pswp__container, .pswp__zoom-wrap { -ms-touch-action: none; touch-action: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; }
.pswp__container, .pswp__img { user-select: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.pswp__zoom-wrap { position: absolute; width: 100%; transform-origin: left top; transition: transform 333ms cubic-bezier(0.4, 0, 0.22, 1); }
.pswp--animated-in .pswp__bg, .pswp--animated-in .pswp__zoom-wrap { transition: none; }
.pswp__container, .pswp__zoom-wrap { -webkit-backface-visibility: hidden; }
.pswp__item { position: absolute; left: 0; right: 0; top: 0; bottom: 0; overflow: hidden; }
.pswp__img { position: absolute; width: auto; height: auto; top: 0; left: 0; }
.pswp__img--placeholder { -webkit-backface-visibility: hidden; }
.pswp__img--placeholder--blank { background: #222; }
.pswp--ie .pswp__img { width: 100% !important; height: auto !important; left: 0; top: 0; }
.pswp__error-msg { position: absolute; left: 0; top: 50%; width: 100%; text-align: center; font-size: 14px; line-height: 16px; margin-top: -8px; color: #CCC; }
.pswp__error-msg a { color: #CCC; text-decoration: underline; }
