/* 
  ChoiceBase - Unified Design System (Rebirth)
  Optimized for sync across Home and Resource pages.
*/

:root {
  /* Design Tokens */
  --p: #4f46e5;
  /* Indigo 600 */
  --p-h: #4338ca;
  /* Indigo 700 */
  --p-soft: rgba(79, 70, 229, 0.1);
  --p-rgb: 79, 70, 229;

  --r: 0.75rem;
  /* Default Radius */
  --f-m: 'Inter', system-ui, -apple-system, sans-serif;
  --f-h: 'Outfit', 'Inter', sans-serif;
  --trans: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Theme-specific (Dark as default) */
  --bg: #0f111a;
  /* Softened Navy-Charcoal (not pure black) */
  --s: #1a1d29;
  /* Slightly lighter shelf */
  --s-2: #24283b;
  /* Hover shelf */
  --br: rgba(255, 255, 255, 0.08);
  --tx: #e2e8f0;
  /* Soft white text */
  --tx-m: #94a3b8;
  /* Muted slate text */
  --sh: 0 10px 40px -10px rgba(0, 0, 0, 0.4);
  --glass: rgba(15, 17, 26, 0.88);
  --grad-1: rgba(79, 70, 229, 0.12);
  --grad-2: rgba(167, 139, 250, 0.08);
}

[data-theme="light"] {
  --bg: #f5f7fa;
  /* Softened Off-White/Grey (not pure white) */
  --s: #ffffff;
  /* Pure white for containers to pop */
  --s-2: #edf2f7;
  /* Hover shelf */
  --br: rgba(0, 0, 0, 0.06);
  --tx: #1a202c;
  /* Deep slate text */
  --tx-m: #4a5568;
  /* Muted grey-slate */
  --p-soft: rgba(79, 70, 229, 0.06);
  --sh: 0 15px 40px -20px rgba(79, 70, 229, 0.12);
  --glass: rgba(245, 247, 250, 0.92);
  --grad-1: rgba(79, 70, 229, 0.04);
  --grad-2: rgba(167, 139, 250, 0.03);
}

/* Global Reset */
html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(at 0% 0%, var(--grad-1) 0px, transparent 50%),
    radial-gradient(at 100% 0%, var(--grad-2) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--tx);
  font-family: var(--f-m);
  line-height: 1.6;
  transition: background-color var(--trans), color var(--trans);
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1,
h2,
h3,
h4,
.navbar-brand {
  font-family: var(--f-h);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tx);
}

p {
  color: var(--tx);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

span,
li,
small {
  color: var(--tx-m);
}

b,
strong {
  color: var(--tx);
}

/* Header */
.header-premium {
  position: sticky;
  top: 0;
  background: var(--glass) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--br);
  padding: 0.6rem 0;
  z-index: 1100;
}

.brand-accent {
  color: var(--p);
  font-weight: 800;
}

.nav-link {
  color: var(--tx-m) !important;
  font-weight: 500;
  padding: 0.5rem 1.25rem !important;
  border-radius: var(--r);
  transition: var(--trans);
}

.nav-link:hover,
.nav-link.active {
  color: var(--tx) !important;
  background: var(--p-soft);
}

/* Page Headers (Hero & Small) */
.hero {
  padding: 8rem 0 6rem;
  text-align: center;
  position: relative;
}

.page-header {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--br);
  margin-bottom: 3rem;
}

/* Cards & Dives */
.resource-item,
.feature-card,
.section-details {
  background: var(--s);
  border: 1px solid var(--br);
  border-radius: var(--r);
  transition: var(--trans);
  box-shadow: var(--sh);
}

.feature-card {
  padding: 2.5rem 2rem;
  text-align: center;
  height: 100%;
}

.feature-card:hover {
  border-color: var(--p);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -20px rgba(var(--p-rgb), 0.3);
}

.feature-icon {
  font-size: 3rem;
  color: var(--p);
  margin-bottom: 1.5rem;
  display: block;
}

.resource-item {
  padding: 1.5rem;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.resource-item:hover {
  border-color: var(--p);
  transform: translateX(5px);
}

.resource-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--tx);
}

.resource-title a {
  color: inherit;
}

/* Sections (Accordions) */
.section-details {
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.section-summary {
  padding: 1.25rem 1.5rem;
  background: var(--s-2);
  color: var(--tx);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  list-style: none;
}

.section-summary::-webkit-details-marker {
  display: none;
}

.section-summary:hover {
  background: var(--br);
}

.section-summary span {
  color: var(--p);
  margin-right: 0.75rem;
}

/* Search Controls */
.search-glass {
  background: var(--s-2) !important;
  border: 1px solid var(--p) !important;
  border-radius: 12px !important;
}

.search-glass .form-control {
  background: transparent !important;
  color: var(--tx) !important;
  border: none !important;
}

.search-glass .input-group-text {
  background: transparent !important;
  color: var(--p) !important;
  border: none !important;
}

/* Floating Tools */
.jump-controls {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 1000;
}

.jump-controls button {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--s);
  border: 2px solid var(--p);
  color: var(--p);
  box-shadow: var(--sh);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: var(--trans);
}

.jump-controls button:hover {
  background: var(--p);
  color: white;
}

/* Footer */
.footer-premium {
  padding: 5rem 0 3rem;
  border-top: 1px solid var(--br);
  background: var(--s);
  text-align: center;
}

/* Theme Toggle Button */
.theme-toggle {
  background: var(--s-2);
  border: 1px solid var(--br);
  color: var(--p);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  /* Prevents shrinking in flex containers */
  transition: var(--trans);
}

.theme-toggle:hover {
  background: var(--br);
  border-color: var(--p);
}

.theme-toggle i {
  font-size: 1.25rem;
}

/* Floating Tools Fix */
.jump-controls {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 2000;
}

.jump-controls button {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--s);
  border: 2px solid var(--p);
  color: var(--p) !important;
  box-shadow: var(--sh);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--trans);
}

.jump-controls button i {
  font-size: 1.8rem;
  font-weight: 900 !important;
  display: block;
}

.jump-controls button:hover {
  background: var(--p);
  color: white !important;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--s-2);
  border-radius: 10px;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .home-search-form .btn-primary {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    font-size: 0 !important;
  }

  .home-search-form .btn-primary i {
    font-size: 1.25rem;
    margin: 0 !important;
  }

  .jump-controls {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}