@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --bg-dark: #0b0f19;
  --bg-card: #182234;
  --bg-card-hover: #1e2d46;
  --bg-container: #0f172a;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --danger-color: #ef4444;
  --success-color: #10b981;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .brand-font {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

/* Navbar */
.navbar-custom {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.85rem 1.5rem;
}

.navbar-brand {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary) !important;
}

/* Cards & Glassmorphism */
.glass-card {
  background: rgba(24, 34, 52, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
  border-color: rgba(99, 102, 241, 0.3);
}

/* Buttons */
.btn-accent {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.5rem 1.25rem;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.btn-accent:hover {
  opacity: 0.92;
  color: #fff;
  transform: translateY(-1px);
}

.btn-outline-custom {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  font-weight: 500;
}

.btn-outline-custom:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

/* Tier Board Styling */
.tier-board-container {
  background: #090d16;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tier-row {
  display: flex;
  align-items: stretch;
  min-height: 90px;
  border-bottom: 1px solid #1e293b;
  background: #0f172a;
}

.tier-row:last-child {
  border-bottom: none;
}

.tier-label-container {
  width: 140px;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.25rem;
  font-weight: 800;
  color: #000;
  text-shadow: 0 1px 2px rgba(255,255,255,0.4);
  position: relative;
  user-select: none;
  overflow: hidden;
}

.tier-label-text {
  font-size: 1.5rem;
  line-height: 1.1;
  text-align: center;
  word-break: break-word;
  max-width: 100%;
}

.tier-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin-top: 6px;
  opacity: 0.85;
  transition: opacity 0.2s;
  max-width: 100%;
}

.tier-color-picker {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  vertical-align: middle;
}

.tier-row:hover .tier-actions {
  opacity: 1;
}

.tier-actions .btn-sm {
  padding: 2px 5px;
  font-size: 0.7rem;
  border-radius: 4px;
  line-height: 1;
}

.tier-dropzone {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: center;
  gap: 8px;
  padding: 8px;
  min-height: 90px;
  background: #0b1120;
  transition: background-color 0.2s;
}

.tier-dropzone.sortable-ghost-target {
  background: rgba(99, 102, 241, 0.15) !important;
}

/* Unranked Pool */
.unranked-container {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1.5rem;
}

.unranked-dropzone {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 110px;
  padding: 12px;
  background: #090d16;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

/* Tier Item Card */
.tier-item-card {
  width: 80px;
  height: 80px;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  box-shadow: 0 3px 8px rgba(0,0,0,0.4);
  background: #1e293b;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1px solid rgba(255,255,255,0.1);
}

.tier-item-card:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0,0,0,0.6);
  z-index: 10;
}

.tier-item-card.sortable-ghost {
  opacity: 0.4;
  transform: scale(0.95);
}

.tier-item-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tier-item-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-delete-item {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tier-item-card:hover .btn-delete-item {
  opacity: 1;
}

/* Modals */
.modal-content-dark {
  background: #151d2a;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.modal-header-dark {
  border-bottom: 1px solid var(--border-color);
}

.modal-footer-dark {
  border-top: 1px solid var(--border-color);
}

/* Forms */
.form-control-dark {
  background: #0b1120;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
}

.form-control-dark:focus {
  background: #0f172a;
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* Footer */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 1.5rem 0;
  color: var(--text-secondary);
}
