/* ==========================================================================
   Pvp Karne — Sunucu Tier List Maker (Metin2 & Knight Online)
   ========================================================================== */

.tier-tool-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: #E2E8F0;
}

/* Page Header & Intro */
.tier-header-block {
  text-align: center;
  margin-bottom: 2rem;
}

.tier-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.tier-page-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.tier-page-subtitle {
  font-size: 0.92rem;
  color: #94A3B8;
  max-width: 650px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

/* Game Switcher Tabs */
.tier-game-switcher {
  display: inline-flex;
  background: #090D16;
  border: 1px solid #1E293B;
  border-radius: 14px;
  padding: 0.35rem;
  gap: 0.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.tier-game-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.25rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #94A3B8;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tier-game-btn img {
  height: 22px;
  width: auto;
  object-fit: contain;
  filter: grayscale(80%) opacity(0.7);
  transition: all 0.2s ease;
}

.tier-game-btn:hover {
  color: #FFFFFF;
  background: #121827;
}

.tier-game-btn:hover img {
  filter: grayscale(0%) opacity(1);
}

.tier-game-btn.is-active {
  color: #FFFFFF;
  background: linear-gradient(135deg, #182136 0%, #111726 100%);
  border-color: #F59E0B;
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.tier-game-btn.is-active img {
  filter: grayscale(0%) opacity(1);
}

/* Action Toolbar */
.tier-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #121827;
  border: 1px solid #1E293B;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
}

.tier-actions-left,
.tier-actions-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.btn-tier-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-tier-primary {
  background: #6366F1;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-tier-primary:hover {
  background: #4F46E5;
  transform: translateY(-1px);
}

.btn-tier-discord {
  background: #5865F2;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.btn-tier-discord:hover {
  background: #4752C4;
  transform: translateY(-1px);
}

.btn-tier-secondary {
  background: #1E293B;
  color: #E2E8F0;
  border-color: #334155;
}

.btn-tier-secondary:hover {
  background: #334155;
  color: #FFFFFF;
}

.btn-tier-danger {
  background: rgba(244, 63, 94, 0.1);
  color: #F43F5E;
  border-color: rgba(244, 63, 94, 0.25);
}

.btn-tier-danger:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #FDA4AF;
}

/* ==========================================================================
   Main Tier Maker Layout
   ========================================================================== */

.tier-workspace-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 1024px) {
  .tier-workspace-grid {
    grid-template-columns: 1fr 340px;
  }
}

/* Left: Tier Board */
.tier-board-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tier-board {
  background: #090D16;
  border: 2px solid #1E293B;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  position: relative;
}

/* Individual Tier Row */
.tier-row {
  display: flex;
  min-height: 90px;
  border-bottom: 2px solid #1E293B;
  background: #0E1320;
  transition: background-color 0.15s ease;
}

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

.tier-row.drag-over {
  background: rgba(99, 102, 241, 0.15);
}

/* Tier Label Cell (S, A, B, C, D, F) */
.tier-label {
  width: 58px;
  min-width: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #111827;
  text-align: center;
  user-select: none;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.25);
  position: relative;
}

.tier-label-s { background: #FF7F7F; color: #4A0E0E; }
.tier-label-a { background: #FFBF7F; color: #4A280E; }
.tier-label-b { background: #FFDF7F; color: #4A3A0E; }
.tier-label-c { background: #FFFF7F; color: #4A4A0E; }
.tier-label-d { background: #BFFF7F; color: #234A0E; }
.tier-label-f { background: #7FFF7F; color: #0E4A1E; }

/* Tier Drop Content Zone */
.tier-items-zone {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  padding: 0.6rem;
  min-height: 90px;
}

/* Watermark in Tier Board */
.tier-watermark-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: #070A11;
  border-top: 1px solid #1E293B;
  font-size: 0.7rem;
  color: #64748B;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.tier-watermark-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #94A3B8;
  font-weight: 600;
}

/* Bottom Controls: Çöp Kutusu & Sunucu Sandığı */
.tier-bench-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tier-bench-slot {
  background: #121827;
  border: 2px dashed #334155;
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
  user-select: none;
}

.tier-bench-slot.slot-trash {
  border-color: rgba(244, 63, 94, 0.3);
}

.tier-bench-slot.slot-trash:hover,
.tier-bench-slot.slot-trash.drag-over {
  border-color: #F43F5E;
  background: rgba(244, 63, 94, 0.08);
  box-shadow: 0 0 15px rgba(244, 63, 94, 0.2);
}

.tier-bench-slot.slot-chest {
  border-color: rgba(245, 158, 11, 0.35);
  cursor: pointer;
}

.tier-bench-slot.slot-chest:hover {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.08);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.25);
  transform: translateY(-2px);
}

.tier-bench-icon-wrap {
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tier-bench-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tier-bench-slot:hover .tier-bench-icon-wrap img {
  transform: scale(1.1);
}

.tier-bench-info {
  flex: 1;
  min-width: 0;
}

.tier-bench-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tier-bench-desc {
  font-size: 0.74rem;
  color: #94A3B8;
  margin: 0;
  line-height: 1.3;
}

.tier-bench-count {
  font-size: 0.7rem;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background: #1E293B;
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   Server Inventory Box (Metin2 & Knight Online Styles)
   ========================================================================== */

.tier-inventory-window {
  background: #16120E;
  border: 3px solid #6B4E26;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

/* Metin2 Inventory Theme (Default) */
.tier-inventory-window.theme-metin2 {
  background: #18130E;
  border-color: #8C6534;
}

/* Knight Online Inventory Theme */
.tier-inventory-window.theme-ko {
  background: #0B111E;
  border-color: #38BDF8;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), inset 0 0 12px rgba(56, 189, 248, 0.2);
}

/* Inventory Header Plate */
.inventory-header {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.6rem;
  background: linear-gradient(180deg, #621414 0%, #3B0B0B 100%);
  border-bottom: 2px solid #8C6534;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.theme-ko .inventory-header {
  background: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);
  border-bottom: 2px solid #38BDF8;
}

.inventory-title {
  font-family: "Plus Jakarta Sans", serif;
  font-size: 0.82rem;
  font-weight: 800;
  color: #F8E7B9;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.theme-ko .inventory-title {
  color: #BAE6FD;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.inventory-header-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.inventory-btn-mini {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #F8E7B9;
  background: #4A1212;
  border: 1px solid #8C6534;
  cursor: pointer;
  transition: all 0.1s ease;
}

.inventory-btn-mini:hover {
  background: #6B1C1C;
  color: #FFFFFF;
}

/* Inventory Search Filter Bar */
.inventory-search-bar {
  padding: 0.45rem 0.6rem;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(140, 101, 52, 0.3);
  display: flex;
  gap: 0.4rem;
}

.inventory-search-input {
  width: 100%;
  padding: 0.3rem 0.5rem;
  background: #0A0806;
  border: 1px solid #4A351C;
  border-radius: 4px;
  font-size: 0.74rem;
  color: #F1F5F9;
  outline: none;
}

.theme-ko .inventory-search-input {
  background: #05080E;
  border-color: #1E293B;
}

.inventory-search-input:focus {
  border-color: #F59E0B;
}

.theme-ko .inventory-search-input:focus {
  border-color: #38BDF8;
}

/* Inventory Slots Grid: 4 columns x 7 rows */
.inventory-grid-wrap {
  padding: 0.65rem 0.5rem;
  display: grid;
  grid-template-columns: repeat(4, 72px);
  grid-auto-rows: 72px;
  gap: 6px;
  justify-content: center;
  background: #0E0B08;
  min-height: 540px;
}

.theme-ko .inventory-grid-wrap {
  background: #080D16;
}

/* Single Slot */
.inventory-slot {
  width: 72px;
  height: 72px;
  background: #140E0A;
  border: 2px solid #2B1D12;
  border-radius: 6px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.15s ease;
}

.theme-ko .inventory-slot {
  background: #08101E;
  border-color: #14223A;
}

.inventory-slot.drag-over {
  border-color: #F59E0B;
  background: rgba(245, 158, 11, 0.15);
}

.theme-ko .inventory-slot.drag-over {
  border-color: #38BDF8;
  background: rgba(56, 189, 248, 0.15);
}

/* ==========================================================================
   Draggable Server Card / Badge (Standardized 66x66)
   ========================================================================== */

.server-item-badge {
  width: 66px;
  height: 66px;
  border-radius: 6px;
  background: #1A1E2B;
  border: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  position: relative;
  overflow: visible;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.server-item-badge:hover {
  transform: scale(1.12);
  border-color: #F59E0B;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.55);
  z-index: 100;
}

.server-item-badge:active {
  cursor: grabbing;
}

.server-item-badge img {
  width: 66px;
  height: 66px;
  max-width: 66px;
  max-height: 66px;
  border-radius: 5px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.server-item-initials {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #FFFFFF;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.server-badge-m2 {
  background: linear-gradient(135deg, #4C1D95 0%, #1E1B4B 100%);
  border-color: #8B5CF6;
}

.server-badge-ko {
  background: linear-gradient(135deg, #78350F 0%, #451A03 100%);
  border-color: #F59E0B;
}

.server-vip-indicator {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #F59E0B;
  box-shadow: 0 0 4px #F59E0B;
}

/* Golden Tooltip on Hover */
.server-item-badge[data-title]:hover::after {
  content: attr(data-title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0E1320;
  color: #F8E7B9; /* Golden text */
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 8px rgba(245, 158, 11, 0.6);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.32rem 0.65rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid #D97706;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 12px rgba(245, 158, 11, 0.4);
  z-index: 9999;
}

.server-item-badge[data-title]:hover::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 5px 0 5px;
  border-style: solid;
  border-color: #D97706 transparent transparent transparent;
  z-index: 9999;
  pointer-events: none;
}

/* ==========================================================================
   Placed Tier Item Card (Logo + Golden Name Below)
   ========================================================================== */

.tier-placed-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 68px;
  cursor: grab;
  position: relative;
  user-select: none;
  transition: transform 0.12s ease;
}

.tier-placed-card:hover {
  transform: translateY(-2px);
  z-index: 50;
}

.tier-placed-card:active {
  cursor: grabbing;
}

.tier-placed-card .server-item-badge {
  width: 60px;
  height: 60px;
  margin: 0 auto;
}

.tier-placed-card .server-item-badge img {
  width: 60px;
  height: 60px;
  max-width: 60px;
  max-height: 60px;
}

.tier-placed-name {
  margin-top: 4px;
  width: 100%;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: #F8E7B9; /* Golden text */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95), 0 0 4px rgba(245, 158, 11, 0.35);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  pointer-events: none;
  padding: 0 2px;
}

/* Inventory Pagination Tabs (I, II, III) */
.inventory-tabs {
  display: flex;
  background: #110C08;
  border-top: 2px solid #4A351C;
  padding: 0.35rem 0.5rem;
  gap: 0.35rem;
}

.theme-ko .inventory-tabs {
  background: #070B12;
  border-top-color: #1E293B;
}

.inventory-tab-btn {
  flex: 1;
  min-width: 0;
  height: 28px;
  background: #2B1D12;
  border: 1px solid #4A351C;
  border-radius: 4px;
  color: #B99C75;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-ko .inventory-tab-btn {
  background: #0E1726;
  border-color: #1E293B;
  color: #94A3B8;
}

.inventory-tab-btn:hover {
  background: #422D1D;
  color: #FFFFFF;
}

.inventory-tab-btn.is-active {
  background: #735028;
  border-color: #F8E7B9;
  color: #FFFFFF;
  box-shadow: 0 0 8px rgba(248, 231, 185, 0.3);
}

.theme-ko .inventory-tab-btn.is-active {
  background: #0284C7;
  border-color: #38BDF8;
  color: #FFFFFF;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* Inventory Footer Controls */
.inventory-footer {
  padding: 0.5rem 0.6rem;
  background: #16120E;
  border-top: 1px solid rgba(140, 101, 52, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: #94A3B8;
}

.theme-ko .inventory-footer {
  background: #0B111E;
  border-top-color: rgba(56, 189, 248, 0.2);
}

.btn-inventory-quick {
  background: transparent;
  border: none;
  color: #F59E0B;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-inventory-quick:hover {
  background: rgba(245, 158, 11, 0.1);
  text-decoration: underline;
}

/* Floating Toast Notification */
.tier-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #121827;
  color: #FFFFFF;
  border: 1px solid #334155;
  padding: 0.6rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  pointer-events: none;
}

.tier-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.tier-toast-success {
  border-color: #10B981;
}

.tier-toast-success .toast-dot {
  background: #10B981;
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
