/* style.css - Slate Pro Design System */
/* Bold, desktop-focused admin aesthetic */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
  /* Palette - Slate Pro */
  --primary: #4f46e5;
  /* Indigo 600 */
  --primary-hover: #4338ca;
  /* Indigo 700 */
  --primary-light: #eef2ff;
  /* Indigo 50 */
  --accent: #f59e0b;
  /* Amber 500 */

  --bg-body: #f8fafc;
  /* Slate 50 */
  --bg-surface: #ffffff;
  --bg-sidebar: #0f172a;
  /* Slate 900 */
  --bg-hover: #f1f5f9;
  /* Slate 100 */

  --text-main: #0f172a;
  /* Slate 900 */
  --text-secondary: #475569;
  /* Slate 600 */
  --text-muted: #94a3b8;
  /* Slate 400 */

  --border: #e2e8f0;
  /* Slate 200 */
  --border-strong: #cbd5e1;
  /* Slate 300 */

  /* Shapes */
  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;

  /* Shadows - Refined */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-focus: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Base Typography */
body {
  background: var(--bg-body);
  color: var(--text-main);
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

/* Monospace for data */
.mono,
code,
.time-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

/* Glass Card - Refined */
.glass-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.glass-card-transparent {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
}

/* === NAVBAR === */
.navbar {
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: var(--shadow-xs) !important;
  padding: 0.75rem 0;
}

.navbar-brand {
  font-weight: 700;
  color: var(--text-main) !important;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand span {
  font-size: 1.5rem;
}

.nav-link {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary) !important;
  padding: 0.5rem 0.875rem !important;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
}

.nav-link:hover {
  color: var(--primary) !important;
  background: var(--primary-light);
}

.nav-pills .nav-link.active,
.nav-pills .show>.nav-link {
  color: #ffffff !important;
  background: var(--primary) !important;
  box-shadow: var(--shadow-sm);
}

/* === BUTTONS === */
.btn {
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  transition: all 0.15s ease;
  border: none;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.25);
}

.btn-outline-secondary {
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  background: transparent;
}

.btn-outline-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.btn-success {
  background: #10b981;
}

.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.btn-warning:hover {
  background: #d97706;
  color: #fff;
}

.btn-danger {
  background: #ef4444;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-info {
  background: #0ea5e9;
}

.btn-info:hover {
  background: #0284c7;
}

/* === ACTION BUTTONS (Competitions Table) === */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.btn-group-custom {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  padding: 2px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.action-btn:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-xs);
}

.action-btn svg {
  flex-shrink: 0;
}

/* Specific action colors */
.action-edit:hover {
  color: #d97706;
}

.action-delete:hover {
  color: #dc2626;
}

.action-config:hover {
  color: #0ea5e9;
}

.action-teams:hover {
  color: #8b5cf6;
}

.action-schedule:hover {
  color: var(--primary);
}

.action-results {
  background: #10b981;
  color: #fff;
  padding: 0.375rem 0.75rem;
}

.action-results:hover {
  background: #059669;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.action-public {
  background: transparent;
  color: var(--primary);
}

.action-public:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Competition Type Badges */
.comp-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.type-olimpiada {
  background: #f3f4f6;
  color: #374151;
}

.type-halowe {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Tooltips for action buttons */
.action-btn[title] {
  position: relative;
}

.action-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  right: 0;
  left: auto;
  transform: none;
  background: var(--text-main);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 4px;
  opacity: 0;
  animation: tooltipFadeIn 0.15s ease forwards;
  pointer-events: none;
}

.action-btn[title]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% - 4px);
  right: 6px;
  left: auto;
  transform: none;
  border: 4px solid transparent;
  border-top-color: var(--text-main);
  z-index: 1000;
  opacity: 0;
  animation: tooltipFadeIn 0.15s ease forwards;
}

@keyframes tooltipFadeIn {
  to {
    opacity: 1;
  }
}

/* === FORMS === */
.form-control,
.form-select {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--bg-surface);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.form-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* === TABLES === */
.table {
  --bs-table-bg: transparent;
  font-size: 0.9rem;
}

.table thead th {
  background: var(--bg-hover);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1rem;
}

.table td {
  vertical-align: middle;
  color: var(--text-main);
  border-bottom: 1px solid var(--border);
  padding: 0.875rem 1rem;
}

.table tbody tr:hover {
  background: var(--bg-hover);
}

/* Glass Table Container */
.glass-table-container {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.glass-table-container .table {
  margin: 0;
}

.glass-table-container .table-responsive {
  margin: 0;
}

/* === PAGE LAYOUT === */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* === DESIGN SYSTEM: FRIENDLY SPORT (DFII 12) === */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

/* Warm, Friendly Background */
body.friendly-sport {
  background: #f8f7f4;
  font-family: 'Nunito', sans-serif;
  color: #374151;
}

/* Container */
.fs-wrapper {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  padding-bottom: 100px;
  /* Space for sticky controls */
}

/* Page Header */
.fs-header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: white;
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

.fs-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #1f2937;
  margin: 0 0 0.25rem 0;
}

.fs-subtitle {
  font-size: 0.85rem;
  color: #9ca3af;
  font-weight: 600;
}

/* === THE RESULT CARD === */
.fs-card {
  background: white;
  border-radius: 20px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

/* Medal Cards */
.fs-card.rank-1 {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.2);
  border: 2px solid #fcd34d;
}

.fs-card.rank-2 {
  background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
  box-shadow: 0 4px 20px rgba(156, 163, 175, 0.2);
  border: 2px solid #d1d5db;
}

.fs-card.rank-3 {
  background: linear-gradient(135deg, #fffbeb 0%, #fed7aa 100%);
  box-shadow: 0 4px 20px rgba(251, 146, 60, 0.15);
  border: 2px solid #fdba74;
}

/* Card Header: Rank | Name | Time */
.fs-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Rank Badge */
.fs-rank {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  background: #f3f4f6;
  color: #6b7280;
  flex-shrink: 0;
}

.rank-1 .fs-rank {
  background: linear-gradient(145deg, #fcd34d, #f59e0b);
  color: #78350f;
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

.rank-2 .fs-rank {
  background: linear-gradient(145deg, #e5e7eb, #9ca3af);
  color: #374151;
  box-shadow: 0 2px 8px rgba(156, 163, 175, 0.4);
}

.rank-3 .fs-rank {
  background: linear-gradient(145deg, #fdba74, #ea580c);
  color: #fff;
  box-shadow: 0 2px 8px rgba(251, 146, 60, 0.4);
}

/* Team Info */
.fs-info {
  flex-grow: 1;
  min-width: 0;
}

.fs-team-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Total Time */
.fs-total {
  text-align: right;
  flex-shrink: 0;
}

.fs-total-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #9ca3af;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.fs-total-time {
  font-size: 1.4rem;
  font-weight: 800;
  color: #6366f1;
  /* Indigo accent */
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Event Scores Grid */
.fs-events {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px dashed #e5e7eb;
}

.fs-event {
  display: flex;
  flex-direction: column;
}

.fs-event-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fs-event-value {
  font-size: 1rem;
  font-weight: 700;
  color: #374151;
}

.fs-penalty {
  font-size: 0.8em;
  color: #ef4444;
  font-weight: 700;
  margin-left: 2px;
}

/* === STICKY CONTROLS === */
.fs-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.fs-controls-inner {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.fs-search {
  flex-grow: 1;
  border: none;
  background: #f3f4f6;
  border-radius: 50px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #374151;
  font-family: 'Nunito', sans-serif;
}

.fs-search::placeholder {
  color: #9ca3af;
}

.fs-search:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  background: white;
}

.fs-btn {
  background: #6366f1;
  color: white;
  border: none;
  border-radius: 50px;
  padding: 0.85rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}

.fs-btn:hover {
  background: #4f46e5;
}

.fs-btn:active {
  transform: scale(0.97);
}

.fs-btn.active {
  background: #10b981;
  /* Green when active */
}

.fs-btn-secondary {
  background: #e5e7eb;
  color: #374151;
}

.fs-btn-secondary:hover {
  background: #d1d5db;
}

/* Footer */
.fs-footer {
  text-align: center;
  padding: 1rem;
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 600;
}