/* ============================================================
   7DS ORIGIN - TEAM BUILDER BUILD SYSTEM STYLES
   Save Modal, Toast Notifications, Confirm Dialog, Saved Builds
   ============================================================ */

/* ── Toast Container ── */
.tb-toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.tb-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(240, 192, 64, 0.2);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #e2e8f0;
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 360px;
}

.tb-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.tb-toast.hide {
  transform: translateX(120%);
  opacity: 0;
}

.tb-toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.tb-toast-success { border-color: rgba(34, 197, 94, 0.4); }
.tb-toast-success .tb-toast-icon { color: #22c55e; }

.tb-toast-error { border-color: rgba(239, 68, 68, 0.4); }
.tb-toast-error .tb-toast-icon { color: #ef4444; }

.tb-toast-info { border-color: rgba(96, 165, 250, 0.4); }
.tb-toast-info .tb-toast-icon { color: #60a5fa; }

.tb-toast-warning { border-color: rgba(240, 192, 64, 0.4); }
.tb-toast-warning .tb-toast-icon { color: #f0c040; }

/* ── Save Build Modal ── */
.tb-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tb-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.tb-modal {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(240, 192, 64, 0.3);
  border-radius: 16px;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(240, 192, 64, 0.1);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-modal-overlay.active .tb-modal {
  transform: scale(1) translateY(0);
}

.tb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(240, 192, 64, 0.15);
  background: rgba(240, 192, 64, 0.05);
}

.tb-modal-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold, #f0c040);
  letter-spacing: 1px;
}

.tb-modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.tb-modal-close:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.tb-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.tb-modal-section {
  margin-bottom: 16px;
}

.tb-modal-label {
  display: block;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold, #f0c040);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.tb-modal-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  color: #e2e8f0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.tb-modal-input:focus {
  border-color: var(--gold, #f0c040);
  box-shadow: 0 0 12px rgba(240, 192, 64, 0.15);
}

.tb-modal-input::placeholder {
  color: #475569;
}

.tb-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid rgba(240, 192, 64, 0.3);
  border-radius: 8px;
  background: rgba(240, 192, 64, 0.1);
  color: var(--gold, #f0c040);
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tb-modal-btn.btn-primary {
  background: linear-gradient(135deg, rgba(240, 192, 64, 0.2), rgba(240, 192, 64, 0.1));
  border-color: rgba(240, 192, 64, 0.5);
}

.tb-modal-btn.btn-primary:hover {
  background: linear-gradient(135deg, rgba(240, 192, 64, 0.35), rgba(240, 192, 64, 0.2));
  box-shadow: 0 0 20px rgba(240, 192, 64, 0.2);
}

.tb-modal-preview {
  padding: 16px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 10px;
  margin-bottom: 16px;
}

.tb-save-preview-chars {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
}

.tb-save-preview-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tb-save-preview-char img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid rgba(240, 192, 64, 0.4);
  object-fit: contain;
  object-position: center;
  background: rgba(2, 6, 23, 0.8);
}

.tb-save-preview-char span {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  max-width: 70px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-save-preview-info {
  text-align: center;
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  color: #64748b;
}

.tb-modal-divider {
  height: 1px;
  background: rgba(240, 192, 64, 0.1);
  margin: 16px 0;
}

.tb-modal-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ── Saved Builds List ── */
.tb-saved-builds-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.tb-saved-builds-list::-webkit-scrollbar {
  width: 4px;
}

.tb-saved-builds-list::-webkit-scrollbar-track {
  background: transparent;
}

.tb-saved-builds-list::-webkit-scrollbar-thumb {
  background: rgba(240, 192, 64, 0.2);
  border-radius: 4px;
}

.tb-saved-empty {
  text-align: center;
  color: #475569;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  padding: 20px;
}

.tb-saved-build-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 10px;
  transition: all 0.2s;
}

.tb-saved-build-item:hover {
  border-color: rgba(240, 192, 64, 0.3);
  background: rgba(240, 192, 64, 0.05);
}

.tb-saved-build-info {
  flex: 1;
  min-width: 0;
}

.tb-saved-build-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-saved-build-meta {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  color: #64748b;
}

.tb-saved-build-chars {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tb-saved-build-actions {
  display: flex;
  gap: 6px;
  margin-left: 10px;
  flex-shrink: 0;
}

.tb-saved-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.15);
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tb-saved-btn.tb-saved-load:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.tb-saved-btn.tb-saved-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

/* ── Confirm Dialog ── */
.tb-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.tb-confirm-overlay.active {
  opacity: 1;
  visibility: visible;
}

.tb-confirm-dialog {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tb-confirm-overlay.active .tb-confirm-dialog {
  transform: scale(1);
}

.tb-confirm-icon {
  font-size: 48px;
  margin-bottom: 12px;
  color: #f0c040;
}

.tb-confirm-title {
  font-family: 'Cinzel', serif;
  font-size: 20px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.tb-confirm-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 24px;
}

.tb-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.tb-confirm-btn {
  padding: 10px 28px;
  border-radius: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tb-confirm-cancel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(96, 165, 250, 0.2);
  color: #94a3b8;
}

.tb-confirm-cancel:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.4);
  color: #e2e8f0;
}

.tb-confirm-ok {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.tb-confirm-ok:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.35), rgba(239, 68, 68, 0.2));
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .tb-toast-container {
    top: auto;
    bottom: 20px;
    right: 10px;
    left: 10px;
  }

  .tb-toast {
    max-width: 100%;
  }

  .tb-modal {
    width: 95%;
    max-height: 90vh;
  }

  .tb-confirm-dialog {
    width: 95%;
    padding: 24px;
  }
}

/* ── Upload Build Button ── */
.tb-upload-build-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(240, 192, 64, 0.3);
  background: rgba(240, 192, 64, 0.08);
  color: #f0c040;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tb-upload-build-btn:hover {
  background: rgba(240, 192, 64, 0.18);
  border-color: rgba(240, 192, 64, 0.5);
  box-shadow: 0 0 12px rgba(240, 192, 64, 0.15);
}

/* ── Community Build Card (dynamic) ── */
.tb-build-card-dynamic {
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 12px;
  padding: 14px;
  transition: all 0.2s;
  cursor: default;
}

.tb-build-card-dynamic:hover {
  border-color: rgba(240, 192, 64, 0.3);
  background: rgba(240, 192, 64, 0.03);
}

.tb-build-card-dynamic .tb-build-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.tb-build-card-dynamic .tb-build-card-author {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

.tb-build-card-dynamic .tb-build-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.tb-build-card-dynamic .tb-build-card-actions button {
  flex: 1;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(96, 165, 250, 0.15);
  background: rgba(15, 23, 42, 0.8);
  color: #94a3b8;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.tb-build-card-dynamic .tb-build-card-actions .btn-load:hover {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.tb-build-card-dynamic .tb-build-card-actions .btn-edit:hover {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.4);
  color: #60a5fa;
}

/* ── Voting System (Reddit/Steam Workshop style) ── */
.tb-build-card-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tb-vote-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 32px;
}

.tb-vote-btn {
  width: 28px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(96, 165, 250, 0.1);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.6);
  color: #475569;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
}

.tb-vote-btn:hover {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.3);
  color: #94a3b8;
}

.tb-vote-btn.tb-vote-up:hover,
.tb-vote-btn.tb-vote-up.vote-active {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

.tb-vote-btn.tb-vote-down:hover,
.tb-vote-btn.tb-vote-down.vote-active {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.tb-vote-score {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  min-width: 24px;
  line-height: 1.2;
}

.tb-vote-score.vote-positive {
  color: #22c55e;
}

.tb-vote-score.vote-negative {
  color: #ef4444;
}

.tb-vote-score.vote-neutral {
  color: #64748b;
}

.tb-build-info-column {
  flex: 1;
  min-width: 0;
}

/* ── DPS tag ── */
.tb-build-tag.tag-dps {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

/* ── GENERAL tag ── */
.tb-build-tag.tag-general {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

/* ══════════════════════════════════════════════
   USER STATUS BAR (Left Panel)
══════════════════════════════════════════════ */
.tb-user-bar {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(240, 192, 64, 0.1);
  background: rgba(15, 23, 42, 0.5);
}

.tb-user-bar-guest {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tb-user-login-btn {
  background: linear-gradient(135deg, #f0c040, #e6a817);
  color: #0f172a;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  transition: all 0.2s;
}
.tb-user-login-btn:hover {
  background: linear-gradient(135deg, #fcd34d, #f0c040);
  transform: translateY(-1px);
}

.tb-user-bar-logged {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tb-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tb-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #f0c040;
  object-fit: cover;
  flex-shrink: 0;
}

.tb-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.tb-user-logout-btn {
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.tb-user-logout-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
}

/* ══════════════════════════════════════════════
   OAUTH BUTTONS
══════════════════════════════════════════════ */
.tb-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Rajdhani', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
}

.tb-oauth-google {
  background: #fff;
  color: #333;
}
.tb-oauth-google:hover {
  background: #f1f1f1;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tb-oauth-discord {
  background: #5865F2;
  color: #fff;
}
.tb-oauth-discord:hover {
  background: #4752C4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88,101,242,0.3);
}

.tb-oauth-github {
  background: #24292e;
  color: #fff;
}
.tb-oauth-github:hover {
  background: #2f363d;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* ══════════════════════════════════════════════
   VOTE BUTTON STATES (login-aware)
══════════════════════════════════════════════ */
.cb-vote-btn.needs-login {
  opacity: 0.5;
  cursor: pointer;
}
.cb-vote-btn.needs-login:hover {
  opacity: 0.8;
}
