@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg-primary: #060b18;
  --bg-secondary: #0c1528;
  --bg-card: #0f1b33;
  --text-primary: #e8edf5;
  --text-secondary: #8899bb;
  --text-muted-dark: #5a6a8a;
  --accent-cyan: #00f0ff;
  --accent-purple: #7c3aed;
  --accent-amber: #f59e0b;
  --accent-green: #10b981;
  --border-subtle: rgba(0, 240, 255, 0.08);
  --border-card: rgba(0, 240, 255, 0.06);
  --glow-cyan: rgba(0, 240, 255, 0.15);
  --sidebar-width: 14rem;
}

/* Base */
html, body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-primary) !important;
  color: var(--text-primary);
}

#page-top, #wrapper, #content-wrapper {
  background-color: var(--bg-primary) !important;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary) !important;
  font-weight: 600;
  letter-spacing: -0.02em;
  border: none !important;
}

a {
  color: var(--accent-cyan);
  transition: color 0.2s ease;
}
a:hover {
  color: #33f3ff;
}

/* ===== SIDEBAR ===== */
.bg-gradient-primary {
  background: linear-gradient(180deg, #0a1628 0%, #060b18 100%) !important;
}

.sidebar {
  border-right: 1px solid var(--border-subtle) !important;
  background: #0a1628 !important;
}

.sidebar-brand-text {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
  color: var(--accent-cyan) !important;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
}

.sidebar .nav-item .nav-link {
  color: rgba(232, 237, 245, 0.6) !important;
  transition: all 0.3s ease;
  border-radius: 0.35rem;
  margin: 0 0.5rem 0.2rem 0.5rem;
  font-size: 0.9rem;
}
.sidebar .nav-item .nav-link:hover {
  color: var(--text-primary) !important;
  background: rgba(0, 240, 255, 0.06);
  transform: translateX(3px);
}
.sidebar .nav-item .nav-link i {
  color: rgba(0, 240, 255, 0.5);
}
.sidebar .nav-item .nav-link:hover i {
  color: var(--accent-cyan);
}
.sidebar .nav-item .nav-link[aria-expanded="true"] {
  color: var(--accent-cyan) !important;
  background: rgba(0, 240, 255, 0.05);
}

.sidebar .collapse-inner {
  background: rgba(6, 11, 24, 0.8) !important;
  border: 1px solid var(--border-subtle);
  border-radius: 10px !important;
  padding: 6px 0;
  margin: 2px 8px;
}
.sidebar .collapse-inner .collapse-item {
  color: rgba(232, 237, 245, 0.5) !important;
  padding: 8px 12px 8px 28px !important;
  font-size: 0.82rem;
  border-left: 2px solid transparent;
  transition: all 0.2s ease;
  border-radius: 0;
}
.sidebar .collapse-inner .collapse-item:hover {
  color: var(--text-primary) !important;
  background: rgba(0, 240, 255, 0.04);
  border-left-color: var(--accent-cyan);
}
.sidebar .collapse-inner .collapse-item i {
  color: rgba(0, 240, 255, 0.4);
  width: 18px;
  text-align: center;
}
.sidebar .collapse-inner .collapse-item:hover i {
  color: var(--accent-cyan);
}

.sidebar-divider {
  border-color: var(--border-subtle) !important;
  opacity: 0.5;
}

.sidebar .sidebar-heading {
  color: rgba(232, 237, 245, 0.3) !important;
  font-size: 0.65rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#sidebarToggle {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-secondary) !important;
}
#sidebarToggle:hover {
  background: rgba(0, 240, 255, 0.1) !important;
  color: var(--accent-cyan) !important;
}

/* ===== TOPBAR ===== */
.navbar-light.bg-white {
  background: var(--bg-secondary) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  box-shadow: none !important;
}

.topbar {
  background: var(--bg-secondary) !important;
}

.topbar .navbar-search .form-control {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}
.topbar .navbar-search .form-control::placeholder {
  color: var(--text-muted-dark);
}
.topbar .navbar-search .form-control:focus {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 240, 255, 0.1) !important;
}
.topbar .navbar-search .btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0891b2) !important;
  border: none !important;
  color: #060b18 !important;
}
.topbar .navbar-search .btn-primary:hover {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}
.topbar .navbar-search .input-group {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
  border-radius: 8px;
  overflow: hidden;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s ease;
}
.card:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
}
.card.border-left-primary {
  border-left: 4px solid var(--accent-cyan) !important;
}
.card.border-left-info {
  border-left: 4px solid #6366f1 !important;
}
.card.border-left-success {
  border-left: 4px solid var(--accent-green) !important;
}
.card.border-left-warning {
  border-left: 4px solid var(--accent-amber) !important;
}
.card.border-left-danger {
  border-left: 4px solid #ef4444 !important;
}
.card.border-0 {
  border: 1px solid var(--border-card) !important;
}

.card-header {
  background: rgba(15, 27, 51, 0.9) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  font-weight: 600;
  border-radius: 14px 14px 0 0 !important;
  padding: 1rem 1.25rem;
}

.card-body {
  color: var(--text-primary);
}

/* ===== BADGES ===== */
.badge-primary {
  background: rgba(0, 240, 255, 0.15) !important;
  color: var(--accent-cyan) !important;
}
.badge-info {
  background: rgba(99, 102, 241, 0.15) !important;
  color: #818cf8 !important;
}
.badge-success {
  background: rgba(16, 185, 129, 0.15) !important;
  color: var(--accent-green) !important;
}
.badge-warning {
  background: rgba(245, 158, 11, 0.15) !important;
  color: var(--accent-amber) !important;
}
.badge-danger {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

/* ===== TEXT UTILITY OVERRIDES ===== */
.text-gray-800 {
  color: var(--text-primary) !important;
}
.text-gray-700 {
  color: var(--text-primary) !important;
}
.text-gray-600 {
  color: var(--text-secondary) !important;
}
.text-gray-500 {
  color: var(--text-muted-dark) !important;
}
.text-gray-400 {
  color: var(--text-muted-dark) !important;
}
.text-gray-300 {
  color: rgba(232, 237, 245, 0.15) !important;
}
.text-muted {
  color: var(--text-secondary) !important;
}
.text-dark {
  color: var(--text-primary) !important;
}
.text-primary {
  color: var(--accent-cyan) !important;
}
.text-info {
  color: #818cf8 !important;
}
.text-success {
  color: var(--accent-green) !important;
}
.text-warning {
  color: var(--accent-amber) !important;
}
.text-danger {
  color: #f87171 !important;
}
.text-secondary {
  color: var(--text-secondary) !important;
}
.text-light {
  color: rgba(232, 237, 245, 0.8) !important;
}
.text-white {
  color: var(--text-primary) !important;
}

/* ===== BACKGROUND OVERRIDES ===== */
.bg-white {
  background: var(--bg-card) !important;
}
.bg-light {
  background: var(--bg-secondary) !important;
}

.bg-gradient-tools {
  background: linear-gradient(135deg, #0f1b33 0%, #060b18 100%) !important;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0891b2) !important;
  border: none !important;
  color: #060b18 !important;
  font-weight: 600;
  border-radius: 10px !important;
  transition: all 0.3s ease;
}
.btn-primary:hover {
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.25);
  transform: translateY(-2px);
  color: #060b18 !important;
}
.btn-primary:active, .btn-primary:focus {
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3) !important;
}

.btn-outline-primary {
  border: 1px solid rgba(0, 240, 255, 0.3) !important;
  color: var(--accent-cyan) !important;
  border-radius: 10px !important;
  transition: all 0.3s ease;
}
.btn-outline-primary:hover {
  background: rgba(0, 240, 255, 0.1) !important;
  border-color: var(--accent-cyan) !important;
  color: var(--accent-cyan) !important;
  transform: translateY(-2px);
}

.btn-outline-secondary {
  border: 1px solid rgba(136, 153, 187, 0.25) !important;
  color: var(--text-secondary) !important;
  border-radius: 10px !important;
}
.btn-outline-secondary:hover {
  background: rgba(0, 240, 255, 0.06) !important;
  border-color: rgba(0, 240, 255, 0.3) !important;
  color: var(--accent-cyan) !important;
}

.btn-secondary {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
}
.btn-secondary:hover {
  border-color: var(--accent-cyan) !important;
  color: var(--accent-cyan) !important;
}

.btn-link {
  color: var(--accent-cyan) !important;
}

/* ===== FORMS ===== */
.form-control {
  background: rgba(6, 11, 24, 0.8) !important;
  border: 1px solid rgba(0, 240, 255, 0.1) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  transition: all 0.3s ease;
}
.form-control:focus {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 240, 255, 0.08) !important;
  background: rgba(6, 11, 24, 0.95) !important;
  color: var(--text-primary) !important;
}
.form-control::placeholder {
  color: var(--text-muted-dark) !important;
}
.form-control:disabled, .form-control[readonly] {
  background: rgba(6, 11, 24, 0.5) !important;
  opacity: 0.7;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238899bb' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 32px;
}

.custom-file-label {
  background: rgba(6, 11, 24, 0.8) !important;
  border: 1px solid rgba(0, 240, 255, 0.1) !important;
  color: var(--text-secondary) !important;
  border-radius: 10px !important;
}
.custom-file-label::after {
  background: var(--bg-card) !important;
  color: var(--accent-cyan) !important;
  border-left: 1px solid var(--border-subtle) !important;
}

.custom-file-input:focus ~ .custom-file-label {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 240, 255, 0.08) !important;
}

/* ===== FOOTER ===== */
footer.sticky-footer {
  background: var(--bg-secondary) !important;
  border-top: 1px solid var(--border-subtle) !important;
}
footer.sticky-footer .text-muted {
  color: var(--text-muted-dark) !important;
  font-size: 0.82rem;
}

/* ===== MODALS ===== */
.modal-content {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
}
.modal-header {
  border-bottom: 1px solid var(--border-subtle) !important;
  border-radius: 16px 16px 0 0 !important;
}
.modal-header .close {
  color: var(--text-secondary) !important;
  text-shadow: none !important;
  opacity: 0.7;
}
.modal-header .close:hover {
  color: var(--text-primary) !important;
  opacity: 1;
}
.modal-footer {
  border-top: 1px solid var(--border-subtle) !important;
}
.modal-body {
  color: var(--text-primary);
}
.modal-title {
  color: var(--text-primary) !important;
}

/* ===== ALERTS ===== */
.alert {
  border-radius: 12px !important;
  border: none !important;
}
.alert-danger {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #fca5a5 !important;
}
.alert-info {
  background: rgba(0, 240, 255, 0.08) !important;
  color: var(--accent-cyan) !important;
}
.alert-success {
  background: rgba(16, 185, 129, 0.1) !important;
  color: var(--accent-green) !important;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.1) !important;
  color: var(--accent-amber) !important;
}
.alert-light {
  background: var(--bg-secondary) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary) !important;
}
.alert .close {
  color: var(--text-secondary) !important;
  text-shadow: none !important;
  opacity: 0.7;
}
.alert .close:hover {
  color: var(--text-primary) !important;
  opacity: 1;
}

/* ===== TABLES ===== */
.table {
  color: var(--text-primary) !important;
  border-color: var(--border-subtle) !important;
}
.table thead th {
  background: rgba(12, 21, 40, 0.8) !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  font-weight: 600;
}
.table td, .table th {
  border-top: 1px solid var(--border-subtle) !important;
  vertical-align: middle;
}
.table-striped tbody tr:nth-of-type(odd) {
  background: rgba(15, 27, 51, 0.5) !important;
}
.table-hover tbody tr:hover {
  background: rgba(0, 240, 255, 0.03) !important;
}
.thead-light th {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-subtle) !important;
}

/* ===== DROPDOWNS ===== */
.dropdown-menu {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}
.dropdown-item {
  color: var(--text-secondary) !important;
  transition: all 0.2s ease;
}
.dropdown-item:hover {
  background: rgba(0, 240, 255, 0.05) !important;
  color: var(--text-primary) !important;
}
.dropdown-header {
  color: var(--accent-cyan) !important;
  font-size: 0.7rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.dropdown-divider {
  border-color: var(--border-subtle) !important;
}

/* ===== JUMBOTRON ===== */
.jumbotron {
  background: linear-gradient(135deg, #0f1b33 0%, #060b18 100%) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 20px !important;
}
.jumbotron .display-4 {
  color: var(--text-primary) !important;
}

/* ===== BORDER UTILITIES ===== */
.border {
  border-color: var(--border-subtle) !important;
}
.border-top {
  border-top-color: var(--border-subtle) !important;
}
.border-bottom {
  border-bottom-color: var(--border-subtle) !important;
}
.border-left {
  border-left-color: var(--border-subtle) !important;
}
.border-right {
  border-right-color: var(--border-subtle) !important;
}
.border-primary {
  border-color: var(--accent-cyan) !important;
}
.border-success {
  border-color: var(--accent-green) !important;
}
.border-info {
  border-color: #6366f1 !important;
}

.rounded {
  border-radius: 12px !important;
}
.rounded-lg {
  border-radius: 16px !important;
}
.shadow {
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2) !important;
}
.shadow-sm {
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.15) !important;
}
.shadow-lg {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3) !important;
}

/* ===== LIST GROUP ===== */
.list-group-item {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-primary);
}

/* ===== PROGRESS ===== */
.progress {
  background: rgba(6, 11, 24, 0.8) !important;
}
.progress-bar {
  background: linear-gradient(90deg, var(--accent-cyan), #6366f1) !important;
}

/* ===== HR ===== */
hr {
  border-color: var(--border-subtle) !important;
  opacity: 0.5;
}

/* ===== NAV TABS ===== */
.nav-tabs {
  border-bottom-color: var(--border-subtle) !important;
}
.nav-tabs .nav-link {
  color: var(--text-secondary) !important;
}
.nav-tabs .nav-link:hover {
  border-color: transparent !important;
  color: var(--text-primary) !important;
}
.nav-tabs .nav-link.active {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  border-bottom-color: var(--bg-card) !important;
  color: var(--accent-cyan) !important;
}

/* ===== PAGINATION ===== */
.page-link {
  background: var(--bg-card) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-secondary) !important;
}
.page-link:hover {
  background: rgba(0, 240, 255, 0.05) !important;
  color: var(--accent-cyan) !important;
}
.page-item.active .page-link {
  background: var(--accent-cyan) !important;
  border-color: var(--accent-cyan) !important;
  color: #060b18 !important;
}
.page-item.disabled .page-link {
  background: rgba(6, 11, 24, 0.5) !important;
  color: var(--text-muted-dark) !important;
}

/* ===== TOOLTIP ===== */
.tooltip-inner {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
}

/* ===== SCROLL TO TOP ===== */
.scroll-to-top {
  background: var(--bg-card) !important;
  color: var(--accent-cyan) !important;
  border: 1px solid var(--border-subtle) !important;
}
.scroll-to-top:hover {
  background: rgba(0, 240, 255, 0.1) !important;
}

/* ===== PAGE HEADER ===== */
.page-header {
  margin-bottom: 1.5rem;
}

.d-sm-flex h1, .d-sm-flex .h1, .d-sm-flex .h2, .d-sm-flex .h3 {
  color: var(--text-primary) !important;
}

/* ===== TOOLS LANDING PAGE ===== */
#tools-section {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  border-radius: 20px;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.bg-tools-light {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 20px !important;
}

/* Model download page */
#models-section {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-subtle);
  padding: 2rem;
  border-radius: 20px;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.model-card {
  border-left: 4px solid transparent !important;
}
.model-card:hover {
  border-left: 4px solid var(--accent-cyan) !important;
}
.model-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-cyan), #0891b2) !important;
  color: #060b18;
  font-size: 1.2rem;
}

/* ===== TOOL-ICON ON LANDING ===== */
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}
.tool-icon[style*="background"] {
  border-radius: 12px !important;
}

/* ===== CONTACT PAGE ===== */
.bg-success {
  background: rgba(16, 185, 129, 0.15) !important;
}
.bg-secondary {
  background: rgba(136, 153, 187, 0.1) !important;
}
.card.border-success {
  border-color: rgba(16, 185, 129, 0.25) !important;
  border-width: 2px !important;
}
.card.border-secondary {
  border-color: rgba(136, 153, 187, 0.2) !important;
  border-width: 2px !important;
}
.card-header.bg-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05)) !important;
  border-bottom: 1px solid rgba(16, 185, 129, 0.15) !important;
}
.card-header.bg-success h6 {
  color: var(--accent-green) !important;
  font-weight: 600;
}
.card-header.bg-secondary {
  background: linear-gradient(135deg, rgba(136, 153, 187, 0.15), rgba(136, 153, 187, 0.03)) !important;
  border-bottom: 1px solid rgba(136, 153, 187, 0.1) !important;
}
.card-header.bg-secondary h6 {
  color: var(--text-secondary) !important;
  font-weight: 600;
}

/* ===== FADE IN ANIMATION ===== */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== HOVER LIFT ===== */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}
.hover-lift:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3) !important;
}

/* ===== CHEM DECORATION ===== */
.chem-decoration {
  position: relative;
  padding-bottom: 10px;
}
.chem-decoration::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), #6366f1);
  border-radius: 3px;
}

/* ===== FORM LABELS ===== */
.col-form-label {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}

/* ===== SMALL TEXT IN CARDS ===== */
small.form-text {
  color: var(--text-muted-dark) !important;
}

/* ===== LIST UNSTYLED ===== */
.list-unstyled li {
  color: var(--text-secondary);
}
.list-unstyled li i {
  color: var(--accent-cyan);
}

/* ===== CUSTOM FILE LABEL ===== */
.custom-file-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5) !important;
  }
  .card {
    margin-bottom: 1rem;
  }
  .jumbotron .display-4 {
    font-size: 2.2rem;
  }
}
