/* ============================================================
   components.css — Reusable UI components
   ============================================================ */

/* Badge */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(108, 99, 255, 0.15);
  border: 1px solid rgba(108, 99, 255, 0.4);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #a09cff;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Divider */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--clr-primary), transparent);
  margin: 3rem auto;
}

/* Tooltip (via data-tooltip) */
[data-tooltip] { position: relative; cursor: pointer; }

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

[data-tooltip]:hover::after { opacity: 1; }

/* Loader */
.loader {
  width: 40px; height: 40px;
  border: 3px solid var(--clr-border);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Category Navigation Sidebar */
.category-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-nav .category-pill {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  background: transparent;
  color: var(--clr-muted);
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.category-nav .category-pill:hover {
  background: rgba(99, 102, 241, 0.03);
  color: var(--clr-primary);
  transform: translateX(5px);
}

.category-nav .category-pill.active {
  background: rgba(99, 102, 241, 0.05);
  border-color: rgba(99, 102, 241, 0.2);
  color: var(--clr-primary);
  font-weight: 700;
}

/* Premium Search Hub */
.search-hub {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.6rem;
  border-radius: 100px;
  max-width: 800px;
  margin: 0 auto 6rem !important;
  display: flex;
  align-items: center;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 20px 40px -10px rgba(79, 70, 229, 0.1);
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-hub:focus-within {
  transform: translateY(-4px) scale(1.01);
  background: #fff;
  border-color: var(--clr-primary);
  box-shadow: 
    0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 30px 60px -10px rgba(79, 70, 229, 0.2);
}

.search-icon-wrapper {
  padding-left: 1.5rem;
  display: flex;
  align-items: center;
  color: var(--clr-muted);
  transition: color 0.3s;
}

.search-hub:focus-within .search-icon-wrapper {
  color: var(--clr-primary);
}

.search-input {
  border: none;
  background: transparent;
  padding: 1rem 1.5rem;
  flex-grow: 1;
  font-size: 1.15rem;
  color: var(--clr-text);
  font-family: inherit;
  font-weight: 500;
}

.search-input:focus {
  outline: none;
}

.search-input::placeholder {
  color: #94a3b8;
  transition: opacity 0.3s;
}

.search-hub:focus-within .search-input::placeholder {
  opacity: 0.6;
}

.search-btn {
  background: var(--clr-primary);
  color: #fff;
  border: none;
  padding: 1rem 2.8rem;
  border-radius: 100px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.search-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-gradient, linear-gradient(135deg, #6366f1, #0ea5e9));
  opacity: 0;
  transition: opacity 0.3s;
}

.search-btn span {
  position: relative;
  z-index: 1;
}

.search-btn:hover {
  background: var(--clr-primary);
  transform: scale(1.02);
}

.search-btn:hover::before {
  opacity: 1;
}

/* Custom Alert / Notification Modal */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.custom-modal {
  background: #fff;
  width: 100%;
  max-width: 440px;
  border-radius: 32px;
  padding: 2.5rem;
  box-shadow: 0 40px 100px rgba(0,0,0,0.2);
  transform: scale(0.9) translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

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

.modal-status-icon {
  width: 80px;
  height: 80px;
  background: #f0fdf4;
  color: #16a34a;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-size: 32px;
}

.custom-modal h3 {
  font-size: 1.5rem;
  font-weight: 1000;
  color: #0f172a;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.custom-modal p {
  font-size: 1rem;
  line-height: 1.6;
  color: #64748b;
  margin-bottom: 2.5rem;
  font-weight: 500;
}

.custom-modal-btn {
  width: 100%;
  padding: 1.25rem;
  background: #0f172a;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-modal-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(15, 23, 42, 0.2);
  background: #1e1b4b;
}
