/* ============================================================
   DreamHost Custom Theme — Bootstrap 4.5.3 Overrides
   Matches dreamhost.in branding
   ============================================================ */

/* --- Inter Font (loaded via head.tpl) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- Bootstrap 4 CSS Variable Overrides --- */
:root {
  /* Brand palette */
  --primary: #2563EB;
  --secondary: #0F172A;
  --success: #22C55E;
  --info: #38BDF8;
  --dark: #0F172A;
  --light: #F8FAFC;

  /* Body */
  --body-bg: #F8FAFC;
  --body-color: #475569;

  /* Text */
  --text-muted: #94A3B8;

  /* Borders */
  --border-color: #E2E8F0;

  /* Border radius */
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --border-radius-sm: 8px;

  /* Font */
  --font-family-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadows */
  --box-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --box-shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

/* --- Body --- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: #F8FAFC;
  color: #475569;
  font-size: 1rem;
  line-height: 1.7;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  color: #0F172A;
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* --- Paragraphs --- */
p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* --- Links --- */
a {
  color: #2563EB;
  transition: color 0.15s ease;
}
a:hover {
  color: #1d4ed8;
}

/* --- Header / Navbar --- */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  overflow: visible;
  /* backdrop-filter creates a stacking context; without this the header paints
     at z-index:0 and page content covers nav dropdowns (trapped z-index:9999) */
  position: relative;
  z-index: 1030;
}

.dh-header {
  height: 74px;
  display: flex;
  align-items: center;
}

.navbar-light {
  background: transparent !important;
}

.navbar-light .navbar-nav .nav-link {
  color: #64748B;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.625rem 1.125rem;
  transition: color 0.15s ease;
}
.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
  color: #2563EB;
}
.navbar-light .navbar-nav .nav-link.active {
  color: #2563EB;
}

.navbar-brand {
  padding-top: 0;
  padding-bottom: 0;
}
.navbar-brand .logo-img {
  max-height: 48px;
  width: auto;
  object-fit: contain;
}

/* --- Topbar (logged in) --- */
.topbar {
  background: #0F172A;
  color: #fff;
  font-size: 0.875rem;
  padding: 0.5rem 0;
}
.topbar .btn {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  border: none;
  padding: 0.375rem 0.875rem;
}
.topbar .btn:hover {
  color: #fff;
}
.btn-active-client {
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
}
.btn-active-client:hover {
  background: rgba(255, 255, 255, 0.2);
}
.btn-return-to-admin {
  color: #38BDF8 !important;
}

/* --- Main Navbar Wrapper --- */
.main-navbar-wrapper {
  background: #fff;
  border-top: 1px solid #E2E8F0;
  overflow: visible;
  position: relative;
  z-index: 1;
}

/* ─── WHMCS Nav Dropdown Fixes ─── */

/* Unclip the entire nav chain */
.navbar-collapse {
  overflow: visible !important;
}
.navbar-nav {
  overflow: visible !important;
}
.navbar-nav .dropdown {
  position: relative !important;
  overflow: visible !important;
}

/* Force dropdowns to stack above everything */
.navbar-nav .dropdown-menu {
  position: absolute !important;
  z-index: 9999 !important;
  overflow: visible !important;
  display: none;
}
.navbar-nav .dropdown-menu.show {
  display: block !important;
}

/* CSS hover fallback — works without Bootstrap JS */
.navbar-nav .dropdown:hover > .dropdown-menu {
  display: block !important;
}

/* Fix collapsing animation from clipping */
.collapsing {
  overflow: visible !important;
}

/* ─── WHMCS Sidebar / Card Fixes ─── */
.collapsable-card-body {
  overflow: visible !important;
}
.card-sidebar {
  overflow: visible;
}
.sidebar .card {
  overflow: visible;
}

/* ─── DataTable Fixes ─── */
.table-container {
  overflow-x: auto;
  overflow-y: visible;
}
.dataTables_wrapper {
  overflow: visible;
}

/* Ensure WHMCS card collapse works (display toggle) */
.card-body-collapsed {
  display: none;
}

/* --- Buttons --- */
.btn {
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.625rem 1.5rem;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
}
.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}
.btn-primary:focus, .btn-primary.focus {
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.35);
}

.btn-secondary {
  background: #0F172A;
  border-color: #0F172A;
  color: #fff;
}
.btn-secondary:hover {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
}
.btn-secondary:focus, .btn-secondary.focus {
  box-shadow: 0 0 0 0.2rem rgba(15, 23, 42, 0.35);
}

.btn-outline-primary {
  border-color: #2563EB;
  color: #2563EB;
}
.btn-outline-primary:hover {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
}

.btn-default {
  background: #fff;
  border-color: #E2E8F0;
  color: #64748B;
}
.btn-default:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}

.btn-success {
  background: #22C55E;
  border-color: #22C55E;
}
.btn-success:hover {
  background: #16A34A;
  border-color: #16A34A;
}

.btn-lg {
  padding: 0.75rem 2rem;
  font-size: 1.0625rem;
  border-radius: 9999px;
}

.btn-sm {
  padding: 0.4375rem 1rem;
  font-size: 0.8125rem;
  border-radius: 9999px;
}

/* --- Cards --- */
.card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  overflow: visible;
}
.card-header {
  background: transparent;
  border-bottom: 1px solid #E2E8F0;
  padding: 1.125rem 1.5rem;
  color: #0F172A;
  font-weight: 600;
  overflow: visible;
}
.card-body {
  padding: 1.5rem;
}
.card-footer {
  background: transparent;
  border-top: 1px solid #E2E8F0;
  padding: 1rem 1.5rem;
}
.accordion > .card,
.accordion > .mc-promo-login,
.accordion > .mc-promo-manage {
  overflow: visible;
}
.client-home-cards .card-body {
  overflow: visible;
}

/* WHMCS promo containers (same as card) — fix stacking & styling */
.mc-promo-login,
.mc-promo-manage {
  position: static !important;
  border-radius: 12px !important;
  border: 1px solid #E2E8F0 !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
  overflow: visible !important;
}

/* --- Panels (WHMCS convention) --- */
.panel {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  overflow: visible;
}
.panel-heading {
  background: transparent;
  border-bottom: 1px solid #E2E8F0;
  padding: 1.125rem 1.5rem;
  color: #0F172A;
  font-weight: 600;
  border-radius: 12px 12px 0 0;
}
.panel-body {
  padding: 1.5rem;
}
.panel-footer {
  background: transparent;
  border-top: 1px solid #E2E8F0;
  padding: 1rem 1.5rem;
  border-radius: 0 0 12px 12px;
}

.panel-default > .panel-heading {
  background: transparent;
  border-color: #E2E8F0;
}
.panel-primary > .panel-heading {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
}
.panel-info > .panel-heading {
  background: #38BDF8;
  border-color: #38BDF8;
  color: #fff;
}

/* --- Tables --- */
.table {
  color: #64748B;
}
.table thead th {
  border-bottom: 2px solid #E2E8F0;
  color: #0F172A;
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.table td, .table th {
  border-top: 1px solid #E2E8F0;
  vertical-align: middle;
  padding: 1rem 1rem;
}
.table-hover tbody tr:hover {
  background: #F8FAFC;
}
.table-striped tbody tr:nth-of-type(odd) {
  background: #FAFBFC;
}

/* --- Form Controls --- */
.form-control {
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  color: #0F172A;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}
.form-control::placeholder {
  color: #94A3B8;
  font-weight: 300;
}
select.form-control {
  border-radius: 12px;
}
.input-group-text {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  color: #64748B;
  font-size: 0.9375rem;
  padding: 0.625rem 1rem;
}

/* --- Alerts --- */
.alert {
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  padding: 1rem 1.25rem;
}
.alert-success {
  background: #F0FDF4;
  color: #166534;
}
.alert-danger {
  background: #FEF2F2;
  color: #991B1B;
}
.alert-warning {
  background: #FFFBEB;
  color: #92400E;
}
.alert-info {
  background: #EFF6FF;
  color: #1E40AF;
}

/* --- Breadcrumb --- */
.master-breadcrumb {
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  padding: 1rem 0;
}
.breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}
.breadcrumb-item a {
  color: #2563EB;
}
.breadcrumb-item.active {
  color: #94A3B8;
}
.breadcrumb-item + .breadcrumb-item::before {
  color: #CBD5E1;
}

/* --- Sidebar --- */
.sidebar .panel,
.sidebar .card {
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: visible;
}
.sidebar .nav-item {
  border-bottom: 1px solid #E2E8F0;
}
.sidebar .nav-item:last-child {
  border-bottom: none;
}
.sidebar .nav-link {
  color: #64748B;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
}
.sidebar .nav-link:hover {
  color: #2563EB;
  background: #F8FAFC;
}
.sidebar .nav-link.active {
  color: #2563EB;
  font-weight: 600;
}

/* --- List Groups --- */
.list-group-item {
  border: 1px solid #E2E8F0;
  color: #64748B;
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
}
.list-group-item.active {
  background: #2563EB;
  border-color: #2563EB;
}
.list-group-item:first-child {
  border-radius: 12px 12px 0 0;
}
.list-group-item:last-child {
  border-radius: 0 0 12px 12px;
}

/* --- Badges --- */
.badge {
  font-weight: 600;
  padding: 0.3em 0.75em;
  border-radius: 9999px;
  font-size: 0.8125rem;
}
.badge-info {
  background: #EFF6FF;
  color: #2563EB;
}
.badge-success {
  background: #F0FDF4;
  color: #16A34A;
}
.badge-danger {
  background: #FEF2F2;
  color: #DC2626;
}
.badge-warning {
  background: #FFFBEB;
  color: #D97706;
}

/* --- Footer --- */
.footer {
  background: #fff;
  border-top: 1px solid #E2E8F0;
  padding: 3rem 0 2rem;
  font-size: 0.9375rem;
  color: #64748B;
}
.footer .nav-link {
  color: #64748B;
  padding: 0.375rem 0.875rem;
  font-size: 0.9375rem;
}
.footer .nav-link:hover {
  color: #2563EB;
}
.footer .copyright {
  color: #94A3B8;
  font-size: 0.75rem;
}

/* --- DreamHost Custom Footer --- */
.dh-footer {
  background: #fff;
  border-top: 1px solid #E2E8F0;
}
.dh-footer-brand {
  font-size: 0.875rem;
  color: #64748B;
  line-height: 1.7;
}
.dh-footer-heading {
  color: #0F172A;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.025em;
  margin-bottom: 1rem;
}
.dh-footer-link {
  color: #64748B;
  font-size: 0.875rem;
  transition: color 0.15s ease;
}
.dh-footer-link:hover {
  color: #2563EB;
  text-decoration: none;
}
.dh-footer-bottom {
  border-top: 1px solid #E2E8F0;
  font-size: 0.6875rem;
  font-weight: 500;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- DreamHost Public Header --- */
.dh-public-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  height: 74px;
  display: flex;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}
.dh-public-header .dh-nav-link {
  color: #64748B;
  font-weight: 500;
  font-size: 0.9375rem;
  padding: 0.5rem 0.875rem;
  transition: color 0.15s ease;
}
.dh-public-header .dh-nav-link:hover {
  color: #2563EB;
  text-decoration: none;
}
.dh-nav-cta {
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.dh-nav-cta-primary {
  background: #0F172A;
  color: #fff;
}
.dh-nav-cta-primary:hover {
  background: #2563EB;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

/* --- Dropdown Menu (public header) --- */
.dh-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 0.5rem;
  z-index: 9999;
  display: none;
}
.dh-dropdown-menu.show {
  display: block;
}
.dropdown {
  z-index: 1;
}
.dropdown:hover > .dh-dropdown-menu {
  display: block !important;
}
.dh-dropdown-menu .dropdown-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 0;
  min-width: 12rem;
}
.dh-dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: #64748B;
  transition: all 0.15s ease;
}
.dh-dropdown-item:hover {
  background: #F8FAFC;
  color: #2563EB;
  text-decoration: none;
}

/* --- Mobile Menu --- */
.dh-mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1050;
}

/* --- Login / Register pages --- */
.login-container {
  max-width: 420px;
  margin: 3rem auto;
}
.login-container .card {
  border-radius: 16px;
}

/* --- Cart / Store --- */
.store-order .cart-items {
  border-radius: 12px;
}
.cart-btn .badge {
  position: relative;
  top: -2px;
}

/* --- Tabs --- */
.nav-tabs {
  border-bottom: 1px solid #E2E8F0;
}
.nav-tabs .nav-link {
  border: none;
  color: #64748B;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}
.nav-tabs .nav-link:hover {
  color: #2563EB;
  border-color: transparent;
}
.nav-tabs .nav-link.active {
  color: #0F172A;
  border-bottom-color: #2563EB;
  background: transparent;
}

/* --- Pagination --- */
.page-link {
  border: 1px solid #E2E8F0;
  color: #64748B;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  border-radius: 8px !important;
  margin: 0 0.125rem;
}
.page-link:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
  color: #0F172A;
}
.page-item.active .page-link {
  background: #2563EB;
  border-color: #2563EB;
}
.page-item.disabled .page-link {
  color: #CBD5E1;
  pointer-events: none;
}

/* --- Modals --- */
.modal-content {
  border: none;
  border-radius: 16px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.modal-header {
  border-bottom: 1px solid #E2E8F0;
  padding: 1.25rem 1.75rem;
}
.modal-body {
  padding: 1.75rem;
}
.modal-footer {
  border-top: 1px solid #E2E8F0;
  padding: 1.25rem 1.75rem;
}

/* --- Progress Bars --- */
.progress {
  background: #E2E8F0;
  border-radius: 9999px;
  height: 0.625rem;
}
.progress-bar {
  background: #2563EB;
  border-radius: 9999px;
}

/* --- Search --- */
.search .btn-default {
  border-radius: 12px 0 0 12px;
}
.search .appended-form-control,
.search .prepended-form-control {
  border-radius: 0 12px 12px 0;
}

/* --- Client Area Specific --- */
.client-home-cards .card {
  transition: box-shadow 0.15s ease;
}
.client-home-cards .card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.client-home-cards .card-icon {
  color: #2563EB;
}

/* --- Domain Search --- */
.domain-pricing .domain-row {
  border-bottom: 1px solid #E2E8F0;
  padding: 1rem 0;
}
.domain-pricing .domain-row:last-child {
  border-bottom: none;
}

/* --- Knowledgebase --- */
.kb-article-title {
  color: #0F172A;
  font-weight: 700;
}
.kb-category {
  border-radius: 12px;
  transition: box-shadow 0.15s ease;
}
.kb-category:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* --- Support Ticket --- */
.ticket-reply {
  background: #F8FAFC;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1rem;
}

/* --- Invoice --- */
.invoice-detail {
  font-size: 0.875rem;
}
.invoice-detail dt {
  color: #0F172A;
  font-weight: 600;
}
.invoice-status {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* --- Announcements --- */
.announcement-single {
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}
.announcement-single:last-child {
  border-bottom: none;
}

/* --- Spacing / Utility Overrides --- */
.container {
  max-width: 1320px;
}

/* Prevent Bootstrap columns from creating stacking contexts
   that clip absolutely-positioned dropdowns */
.col, .col-1, .col-10, .col-11, .col-12, .col-2, .col-3, .col-4,
.col-5, .col-6, .col-7, .col-8, .col-9, .col-auto,
.col-lg, .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2,
.col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8,
.col-lg-9, .col-lg-auto,
.col-md, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2,
.col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8,
.col-md-9, .col-md-auto,
.col-sm, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2,
.col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8,
.col-sm-9, .col-sm-auto,
.col-xl, .col-xl-1, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl-2,
.col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8,
.col-xl-9, .col-xl-auto {
  position: static !important;
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
  .dh-public-header .dh-nav-links {
    display: none;
  }
  .dh-public-header .dh-nav-ctas {
    display: none;
  }
}
@media (min-width: 992px) {
  .dh-mobile-toggle {
    display: none !important;
  }
}
