/* ============================================================
   Galop Srbija – Public page styles
   ============================================================ */

/* ---- NAV ---- */
.pub-nav {
  background: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 100%);
  box-shadow: 0 2px 12px rgba(15,23,42,0.18);
  position: sticky;
  top: 0;
  z-index: 200;
}

.pub-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
}

.nav-brand {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  margin-right: 28px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2px;
  flex: 1;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  padding: 8px 13px;
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,0.15);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-user a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: 0.15s;
}

.nav-user a:hover { color: #fff; background: rgba(255,255,255,0.15); }

.nav-admin-link, .nav-profile-link {
  background: rgba(255,255,255,0.18) !important;
  color: #fff !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  margin-left: 12px;
  padding: 6px 8px;
  border-radius: 8px;
}

.nav-mobile-links {
  display: none;
  flex-direction: column;
  background: #1e3a8a;
  padding: 8px 16px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.nav-mobile-links.open { display: flex; }

.nav-mobile-links a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 15px;
}

@media (max-width: 900px) {
  .nav-links, .nav-user { display: none; }
  .nav-toggle { display: block; }
}

/* ---- PAGE WRAPPER ---- */
.pub-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px;
}

/* ---- PAGE HERO ---- */
.pub-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  border-radius: 20px;
  padding: 32px 36px;
  margin-bottom: 28px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.12);
}

.pub-hero h1 {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
}

.pub-hero p {
  margin: 0;
  color: rgba(255,255,255,0.85);
  font-size: 15px;
}

/* ---- CARDS ---- */
.pub-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(15,23,42,0.06);
  overflow: hidden;
  margin-bottom: 24px;
}

.pub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg,#fff 0%,#f8fbff 100%);
}

.pub-card-header h2, .pub-card-header h3 {
  margin: 0;
  font-size: 18px;
}

/* ---- TABLE ---- */
.pub-table {
  width: 100%;
  border-collapse: collapse;
}

.pub-table th {
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.pub-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  vertical-align: middle;
}

.pub-table tbody tr:hover td { background: #f8fbff; }
.pub-table tbody tr:last-child td { border-bottom: none; }

/* ---- BADGES ---- */
.pub-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #166534; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-amber  { background: #fef3c7; color: #92400e; }

/* ---- STAT GRID ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 16px;
  padding: 20px;
}

.stat-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  text-align: center;
}

.stat-box .num {
  font-size: 26px;
  font-weight: 700;
  color: #1e3a8a;
  line-height: 1;
}

.stat-box .lbl {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- PROFILE HEADER ---- */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding: 28px 32px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  border-radius: 20px;
  margin-bottom: 24px;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.profile-info { flex: 1; }

.profile-info h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
}

.profile-info .meta {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.profile-stat {
  text-align: center;
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px 18px;
}

.profile-stat .n { font-size: 22px; font-weight: 700; }
.profile-stat .l { font-size: 11px; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* ---- RACE DAY CARD ---- */
.day-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(15,23,42,0.06);
  padding: 20px 24px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 20px;
  text-decoration: none;
  color: inherit;
  transition: 0.15s;
}

.day-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15,23,42,0.1);
  border-color: #93c5fd;
}

.day-card .date-block {
  min-width: 64px;
  text-align: center;
  background: #eff6ff;
  border-radius: 12px;
  padding: 10px 14px;
  flex-shrink: 0;
}

.day-card .date-block .day { font-size: 24px; font-weight: 700; color: #1e3a8a; line-height: 1; }
.day-card .date-block .mon { font-size: 12px; color: #2563eb; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

.day-card .day-info { flex: 1; }
.day-card .day-info h3 { margin: 0 0 4px; font-size: 16px; }
.day-card .day-info .meta { font-size: 13px; color: #64748b; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- NEXT DAY HIGHLIGHT ---- */
.next-day-card {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  border-radius: 20px;
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: 0 6px 24px rgba(30,58,138,0.25);
}

.next-day-card h2 { margin: 0 0 4px; font-size: 20px; }
.next-day-card .sub { color: rgba(255,255,255,0.8); font-size: 14px; }
.next-day-card .trke-count {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  margin-top: 12px;
}

/* ---- RACE RESULT ROW ---- */
.plasman-1 td:first-child { border-left: 3px solid #f59e0b; }
.plasman-2 td:first-child { border-left: 3px solid #94a3b8; }
.plasman-3 td:first-child { border-left: 3px solid #b45309; }

/* ---- FILTER BAR ---- */
.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
}

.filter-bar select,
.filter-bar input {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #1e293b;
}

.filter-bar select:focus,
.filter-bar input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ---- SEARCH ---- */
.pub-search {
  flex: 1 1 260px;
  padding: 9px 14px 9px 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") 12px center no-repeat;
}

.pub-search:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ---- EMPTY STATE ---- */
.pub-empty {
  text-align: center;
  padding: 48px 24px;
  color: #94a3b8;
}

.pub-empty .icon { font-size: 40px; margin-bottom: 12px; }
.pub-empty p { font-size: 15px; margin: 0; }

/* ---- TABS ---- */
.pub-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.pub-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: 0.15s;
  text-decoration: none;
}

.pub-tab:hover { color: #1e3a8a; }
.pub-tab.active {
  color: #1e3a8a;
  border-bottom-color: #2563eb;
}

/* ---- PEDIGREE TREE ---- */
.pedigree {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px;
}

.ped-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
}

.ped-label { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.ped-name { font-size: 15px; font-weight: 600; color: #1e293b; }

/* ---- FOOTER ---- */
.pub-footer {
  background: #1e3a8a;
  color: rgba(255,255,255,0.7);
  margin-top: 60px;
  padding: 24px;
}

.pub-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 14px;
}

.pub-footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
}

.pub-footer a:hover { color: #fff; }
.footer-sep { color: rgba(255,255,255,0.3); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .pub-page { padding: 16px; }
  .pub-hero { padding: 22px 20px; }
  .pub-hero h1 { font-size: 22px; }
  .profile-header { padding: 20px; flex-direction: column; }
  .pedigree { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
