/* Shared visual polish across pages */
:root {
  --page-bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #0f172a;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 16px 36px rgba(15, 23, 42, 0.1);
  --radius: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #f4f7fb 48%, #ffffff 100%);
  color: var(--ink);
}

/* Main container with proper max-width and centered padding */
.main-container {
  max-width: 1280px;
  width: min(100% - 40px, 1280px);
  margin: 0 auto;
  padding: 42px 0 72px;
}

/* Page header with proper spacing */
.page-header {
  margin-bottom: 28px;
  color: var(--ink);
  animation: fadeInDown 0.6s ease-out;
}

.page-header:not(:has(.page-header-content)) {
  text-align: left;
  padding: 34px 36px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 64, 105, 0.9)),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.26), transparent 42%);
  color: #ffffff;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-header h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 10px;
  font-weight: 750;
  letter-spacing: 0;
  color: inherit;
  animation: slideInDown 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.page-header .subtitle,
.subtitle {
  font-size: 16px;
  opacity: 1;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
  animation: fadeIn 0.8s ease-out 0.2s both;
}

/* Content sections with proper padding */
.filters-section {
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.card,
.section-card,
.dashboard-card,
.stat-card,
.profile-card,
.cabinet-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card {
  padding: 28px;
  margin-bottom: 22px;
  animation: slideInUp 0.7s ease-out 0.1s both;
}

.card:hover,
.section-card:hover,
.dashboard-card:hover,
.profile-card:hover,
.cabinet-card:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.card h2,
.card h3,
.section-card h2,
.cabinet-card h2 {
  color: var(--ink);
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

input,
select,
textarea {
  border-color: #cbd5e1;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.btn,
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning,
.btn-info {
  border-radius: 10px;
  letter-spacing: 0;
}

.btn-primary {
  background: var(--primary-dark);
  color: #ffffff;
  border-color: var(--primary-dark);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.btn-primary:hover {
  background: #1e293b;
  border-color: #1e293b;
}

.btn-secondary {
  background: #ffffff;
  color: var(--ink);
  border-color: #cbd5e1;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead {
  background: #f8fafc;
}

th {
  color: #334155;
  font-weight: 700;
}

tbody tr {
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: #f8fafc;
}

.empty-state,
.no-events,
.loading {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Responsive adjustments for tablets and mobile */
@media (max-width: 1024px) {
  .main-container {
    padding: 34px 0 60px;
  }

  .page-header:not(:has(.page-header-content)) {
    padding: 30px 28px;
  }
}

@media (max-width: 768px) {
  .main-container {
    width: min(100% - 28px, 1280px);
  }

  .main-container {
    padding: 28px 0 52px;
  }

  .page-header {
    margin-bottom: 22px;
  }

  .page-header:not(:has(.page-header-content)) {
    padding: 26px 22px;
    border-radius: 14px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .subtitle,
  .page-header .subtitle {
    font-size: 14px;
  }

  .filters-section {
    margin-bottom: 20px;
  }
}

@media (max-width: 480px) {
  .main-container {
    width: min(100% - 20px, 1280px);
  }

  .main-container {
    padding: 20px 0 42px;
  }

  .page-header:not(:has(.page-header-content)) {
    padding: 22px 18px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .card {
    padding: 18px;
  }
}
