/* ==========================================================================
   THE CEO VAULT - Component Library & Reusable Elements
   ========================================================================== */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  user-select: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #0b0d14;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
  color: #0b0d14;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-light);
  transform: translateY(-2px);
  color: var(--text-primary);
}

.btn-cyan {
  background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
  color: #07080d;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-cyan:hover {
  background: linear-gradient(135deg, #38bdf8 0%, #06b6d4 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
  color: #07080d;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-medium);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #ef4444;
  color: #fff;
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  min-height: 36px;
}

.btn-lg {
  padding: 0.95rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  min-height: 52px;
}

.btn-full {
  width: 100%;
}

/* --- Cards --- */
.vault-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.vault-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.vault-card.highlight-gold {
  border-color: var(--border-active);
  box-shadow: var(--shadow-gold);
}

.vault-card-glow-gold::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.vault-card-glow-cyan::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--cyan-primary), transparent);
}

.vault-card-glow-purple::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--purple-primary), transparent);
}

/* --- Badges & Tags --- */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--border-radius-full);
}

.badge-tag-gold {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-tag-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-tag-purple {
  background: rgba(139, 92, 246, 0.15);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-tag-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* NBA 2K Badge Tier Pills */
.tier-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  border-radius: var(--border-radius-sm);
  text-transform: uppercase;
}

.tier-bronze { background: var(--tier-bronze-bg); color: var(--tier-bronze); border: 1px solid rgba(205, 127, 50, 0.35); }
.tier-silver { background: var(--tier-silver-bg); color: var(--tier-silver); border: 1px solid rgba(203, 213, 225, 0.35); }
.tier-gold { background: var(--tier-gold-bg); color: var(--tier-gold); border: 1px solid rgba(245, 158, 11, 0.35); }
.tier-hof { background: var(--tier-hof-bg); color: var(--tier-hof); border: 1px solid rgba(168, 85, 247, 0.4); }
.tier-legend { background: var(--tier-legend-bg); color: var(--tier-legend); border: 1px solid rgba(236, 72, 153, 0.4); }

/* --- Navigation Bar --- */
.vault-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(11, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: all var(--transition-normal);
}

.vault-navbar .nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  min-width: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 1px;
  flex-shrink: 0;
  min-width: 0;
  white-space: nowrap;
}

.brand-logo svg {
  width: 32px;
  height: 32px;
}

.brand-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  border-radius: 4px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
  cursor: pointer;
  position: relative;
  padding: 0.5rem 0;
}

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

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold-primary);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.nav-user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-tertiary);
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  max-width: 100%;
  min-width: 0;
}

.nav-user-profile span:not(.brand-badge) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}

.nav-hamburger {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  min-height: 44px;
  min-width: 44px;
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; align-items: center; justify-content: center; }
}

/* --- Mobile Drawer Navigation --- */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 340px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-medium);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

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

.drawer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-link {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

@media (max-width: 1024px) {
  .nav-links {
    gap: 1rem;
  }

  .nav-link {
    font-size: 0.88rem;
  }
}

@media (max-width: 860px) {
  .vault-navbar {
    height: 64px;
  }

  .vault-navbar .nav-container {
    gap: 0.75rem;
  }

  .brand-logo {
    gap: 0.55rem;
    font-size: 1.2rem;
  }

  .brand-logo svg {
    width: 28px;
    height: 28px;
  }

  .nav-actions {
    gap: 0.5rem;
    margin-left: auto;
  }

  #nav-user-container {
    min-width: 0;
  }

  .nav-user-profile {
    gap: 0.45rem;
    padding: 0.3rem 0.5rem 0.3rem 0.35rem;
    max-width: 190px;
  }

  .nav-user-profile .brand-badge {
    font-size: 0.58rem !important;
    padding: 0.12rem 0.35rem;
    white-space: nowrap;
  }

  .nav-actions > .btn[title="Log out"] {
    display: none;
  }

  .mobile-drawer {
    width: min(88vw, 340px);
    padding: 1.5rem 1.25rem;
  }
}

@media (max-width: 560px) {
  .vault-navbar {
    height: 58px;
  }

  .brand-logo {
    font-size: 1rem;
    letter-spacing: 0.4px;
  }

  .brand-logo svg {
    width: 26px;
    height: 26px;
  }

  .brand-logo > .brand-badge {
    display: none;
  }

  #nav-user-container {
    display: none;
  }

  .nav-hamburger {
    padding: 0.35rem;
  }

  .mobile-drawer {
    width: min(92vw, 330px);
  }

  .drawer-header .brand-logo {
    font-size: 1.05rem !important;
    white-space: nowrap;
  }
}

@media (max-width: 375px) {
  .brand-logo {
    font-size: 0.92rem;
    gap: 0.45rem;
  }

  .brand-logo svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 340px) {
  .vault-navbar .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .brand-logo {
    font-size: 0.86rem;
  }
}

/* --- Form Inputs --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input, .form-select {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--border-radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

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

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input-icon-wrapper .form-input {
  padding-left: 2.75rem;
}

/* --- Modals --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  position: relative;
  transform: scale(0.95);
  transition: transform var(--transition-smooth);
}

@media (max-width: 560px) {
  .modal-backdrop {
    padding: 0.75rem;
  }

  .modal-content {
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }
}

.modal-backdrop.active .modal-content {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--bg-card-hover);
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--border-radius-md);
  padding: 0.9rem 1.4rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideInUp 0.3s ease forwards;
  min-width: 300px;
  max-width: 420px;
}

.toast-success { border-left: 4px solid var(--green-primary); }
.toast-warning { border-left: 4px solid var(--gold-primary); }
.toast-error { border-left: 4px solid var(--red-primary); }
.toast-info { border-left: 4px solid var(--cyan-primary); }

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

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

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darkest);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-medium);
}
