/* ============================================
   COMPONENTS - Champion Sports Theme
   Dark Navy + Bright Yellow + Bold Typography
   ============================================ */

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 2px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  color: var(--primary-text);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-dark {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn-dark:hover:not(:disabled) {
  background: var(--navy-light);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline-primary:hover:not(:disabled) {
  background: var(--primary);
  color: var(--primary-text);
}

.btn-danger {
  background: var(--error);
  color: var(--white);
  border-color: var(--error);
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 0.5rem 0.875rem;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
}

.btn-sm {
  padding: 0.4rem 0.875rem;
  font-size: 0.78rem;
}

.btn-lg {
  padding: 0.95rem 2rem;
  font-size: 1rem;
}

.btn-block { width: 100%; }

.btn-icon {
  padding: 0.5rem;
  border-radius: var(--radius);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  transition: all var(--transition);
}

.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--primary);
}

.card-dark {
  background: var(--navy-card);
  border-color: var(--navy-border);
  color: var(--white);
}

.card-dark h3, .card-dark h4 { color: var(--white); }
.card-dark p { color: rgba(255, 255, 255, 0.7); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-body { margin-bottom: 1rem; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: var(--error-bg);
  border-radius: var(--radius);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-heading);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-primary { background: var(--primary); color: var(--primary-text); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }

[data-theme="dark"] .badge-success { color: #4ade80; }
[data-theme="dark"] .badge-error { color: #f87171; }
[data-theme="dark"] .badge-warning { color: #fbbf24; }
[data-theme="dark"] .badge-info { color: #60a5fa; }

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-hover);
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

/* ===== TOP BAR ===== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  background: var(--navy);
  color: var(--white);
  z-index: 110;
  font-size: 0.8rem;
  font-family: var(--font-ui);
}

.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar a {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.topbar a:hover { color: var(--primary); }

.topbar .live-badge {
  background: var(--error);
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== NAVIGATION ===== */
.nav {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background var(--transition);
}

[data-theme="dark"] .nav {
  background: var(--navy-light);
  border-bottom-color: var(--navy-border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text) !important;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nav-brand-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.nav-brand-text .brand-name {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text);
}

.nav-brand-text .brand-sub {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--primary-glow);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-cart {
  position: relative;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}

.nav-cart:hover {
  background: var(--primary-glow);
  color: var(--primary);
}

.nav-cart-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 0.65rem;
  font-weight: 800;
  font-family: var(--font-heading);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
  font-weight: 600;
  font-size: 0.875rem;
}

.nav-user:hover { background: var(--bg-hover); }

.nav-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  font-family: var(--font-heading);
}

.nav-menu-toggle {
  display: none;
  padding: 0.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text);
}

@media (max-width: 768px) {
  .topbar { display: none; }

  .nav {
    top: 0;
  }

  .main-content {
    margin-top: var(--nav-height);
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
  }

  [data-theme="dark"] .nav-links {
    background: var(--navy-light);
  }

  .nav-links.open { display: flex; }
  .nav-link { width: 100%; text-align: center; }
  .nav-menu-toggle { display: flex; }
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-glow);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

/* ===== DROPDOWN ===== */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 150;
  display: none;
  animation: fadeIn 0.15s ease;
  overflow: hidden;
}

[data-theme="dark"] .dropdown-menu {
  background: var(--navy-card);
  border-color: var(--navy-border);
}

.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

.dropdown-divider {
  border-top: 1px solid var(--border);
  margin: 0.25rem 0;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.25s ease;
}

[data-theme="dark"] .modal {
  background: var(--navy-card);
  border-color: var(--navy-border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.modal-body { padding: 1.5rem; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--topbar-height) + 1rem);
  right: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .toast-container {
    top: calc(var(--nav-height) + 1rem);
  }
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-heading);
  box-shadow: var(--shadow-xl);
  animation: slideIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 380px;
  transition: opacity 0.3s, transform 0.3s;
}

.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--error); color: white; }
.toast-info { background: var(--navy); color: var(--primary); border: 1px solid var(--primary); }
.toast-warning { background: var(--warning); color: var(--primary-text); }

/* ===== LOADER / SPINNER ===== */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state h2, .empty-state h3 {
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ===== PRICE ===== */
.price {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--primary);
}

.price-lg { font-size: 1.5rem; }

/* ===== CHECKBOX ===== */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ===== DIVIDER ===== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

.fade-in-up-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-up-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-up-delay-3 { animation-delay: 0.3s; opacity: 0; }
