/**
 * TwinCETool Next-Gen Theme & Modern Design System
 * Comprehensive UI overhaul: Glassmorphism, modern typography,
 * responsive cards, dynamic gradients, micro-interactions, dark & light mode.
 */

:root {
  --tct-font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Primary & Accents */
  --tct-primary: #2563eb;
  --tct-primary-hover: #1d4ed8;
  --tct-primary-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --tct-primary-glow: rgba(37, 99, 235, 0.25);
  --tct-secondary-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  --tct-accent-cyan: #06b6d4;
  --tct-accent-purple: #8b5cf6;
  --tct-accent-emerald: #10b981;
  --tct-accent-amber: #f59e0b;
  --tct-accent-rose: #ef4444;

  /* Light Theme Palette */
  --tct-bg: #f8fafc;
  --tct-card-bg: #ffffff;
  --tct-surface: #ffffff;
  --tct-border: #e2e8f0;
  --tct-border-light: #f1f5f9;
  --tct-text-main: #0f172a;
  --tct-text-muted: #64748b;
  --tct-text-light: #94a3b8;
  
  /* Modern Shadows */
  --tct-shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.04);
  --tct-shadow-card: 0 10px 30px -8px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.8);
  --tct-shadow-hover: 0 20px 40px -10px rgba(37, 99, 235, 0.16), 0 0 0 1px rgba(37, 99, 235, 0.25);
  --tct-shadow-glow: 0 16px 36px -6px rgba(37, 99, 235, 0.35);

  /* Geometry */
  --tct-radius-sm: 8px;
  --tct-radius-md: 14px;
  --tct-radius-lg: 20px;
  --tct-radius-xl: 28px;
}

/* Dark Theme Overrides */
[data-pc-theme="dark"] {
  --tct-bg: #090d16;
  --tct-card-bg: #111827;
  --tct-surface: #161f30;
  --tct-border: rgba(255, 255, 255, 0.08);
  --tct-border-light: rgba(255, 255, 255, 0.04);
  --tct-text-main: #f8fafc;
  --tct-text-muted: #94a3b8;
  --tct-text-light: #64748b;
  --tct-shadow-card: 0 12px 36px -8px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.08);
  --tct-shadow-hover: 0 22px 46px -10px rgba(37, 99, 235, 0.3), 0 0 0 1px rgba(59, 130, 246, 0.35);
}

/* Base Reset & Modern Font */
html {
  scroll-behavior: smooth;
}

body, body.tct-modern-body {
  font-family: var(--tct-font) !important;
  color: var(--tct-text-main);
  background-color: var(--tct-bg) !important;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--tct-font) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--tct-text-main);
}

a {
  color: var(--tct-primary);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

a:hover {
  color: var(--tct-primary-hover);
}

.container {
  max-width: 1280px;
}

/* --------------------------------------------------------------------------
   GLASSMORPHIC TOP HEADER & NAVBAR
   -------------------------------------------------------------------------- */
.pc-header, header.navbar, .navbar {
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  border-bottom: 1px solid var(--tct-border) !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.03) !important;
  transition: all 0.25s ease;
  z-index: 1020;
}

[data-pc-theme="dark"] .pc-header,
[data-pc-theme="dark"] header.navbar,
[data-pc-theme="dark"] .navbar {
  background: rgba(17, 24, 39, 0.88) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35) !important;
}

.pc-header .m-header {
  padding: 0 20px;
}

.navbar-brand img, .m-header img {
  max-height: 44px;
  width: auto;
  transition: transform 0.2s ease;
}

.navbar-brand:hover img, .m-header:hover img {
  transform: scale(1.02);
}

/* Navigation Links */
.navbar-nav .nav-link, .pc-header .pc-h-item .pc-head-link {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--tct-text-muted) !important;
  padding: 8px 16px !important;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.navbar-nav .nav-link:hover, .pc-header .pc-h-item:hover .pc-head-link {
  color: var(--tct-primary) !important;
  background: rgba(37, 99, 235, 0.06);
}

.navbar-nav .nav-link.active {
  color: var(--tct-primary) !important;
  background: rgba(37, 99, 235, 0.08);
}

/* --------------------------------------------------------------------------
   MODERN CARDS OVERRIDE (Replaces all .card and .rounded-0 instances)
   -------------------------------------------------------------------------- */
.card, .rounded-0.card, div.card {
  background-color: var(--tct-card-bg) !important;
  border: 1px solid var(--tct-border) !important;
  border-radius: var(--tct-radius-lg) !important;
  box-shadow: var(--tct-shadow-card) !important;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease;
  overflow: hidden;
}

.card-header, .rounded-0.card .card-header {
  background-color: transparent !important;
  border-bottom: 1px solid var(--tct-border) !important;
  padding: 18px 24px !important;
  font-weight: 700;
  border-top-left-radius: var(--tct-radius-lg) !important;
  border-top-right-radius: var(--tct-radius-lg) !important;
}

.card-body {
  padding: 24px !important;
}

.card-footer {
  background-color: transparent !important;
  border-top: 1px solid var(--tct-border) !important;
  padding: 16px 24px !important;
}

/* --------------------------------------------------------------------------
   HIGH-TECH MODERN HOMEPAGE HERO
   -------------------------------------------------------------------------- */
.tct-hero-modern {
  position: relative;
  overflow: hidden;
  margin: 12px 0 36px 0;
  padding: clamp(36px, 6vw, 76px) clamp(24px, 5vw, 64px);
  border-radius: var(--tct-radius-xl);
  background: radial-gradient(circle at 85% 15%, rgba(14, 165, 233, 0.28), transparent 42%),
              radial-gradient(circle at 10% 85%, rgba(37, 99, 235, 0.22), transparent 45%),
              linear-gradient(135deg, #090e1a 0%, #0d1a33 50%, #102652 100%);
  color: #ffffff;
  box-shadow: 0 28px 65px -12px rgba(10, 24, 52, 0.38), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.tct-hero-modern::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.6;
  pointer-events: none;
}

.tct-hero-modern::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  right: -90px;
  bottom: -150px;
  box-shadow: 0 0 0 45px rgba(255, 255, 255, 0.025), 0 0 0 90px rgba(255, 255, 255, 0.015);
  pointer-events: none;
}

.tct-hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.tct-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e0f2fe;
  margin-bottom: 20px;
}

.tct-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseLive 2s infinite;
}

@keyframes pulseLive {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.tct-hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  color: #ffffff;
}

.tct-gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 50%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

.tct-hero-sub {
  font-size: clamp(1.02rem, 1.8vw, 1.2rem);
  color: rgba(241, 245, 249, 0.85);
  max-width: 680px;
  line-height: 1.65;
  margin-bottom: 30px;
}

/* Quick Interactive Service Search Bar */
.tct-quick-search-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px);
  border-radius: var(--tct-radius-md);
  padding: 6px 8px 6px 18px;
  display: flex;
  align-items: center;
  max-width: 620px;
  margin-bottom: 24px;
  transition: all 0.2s ease;
}

.tct-quick-search-box:focus-within {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25);
  background: rgba(255, 255, 255, 0.16);
}

.tct-quick-search-box i {
  color: #93c5fd;
  font-size: 1.1rem;
  margin-right: 12px;
}

.tct-quick-search-box input {
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 1rem;
  outline: none;
  width: 100%;
  font-family: var(--tct-font);
}

.tct-quick-search-box input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.tct-hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.tct-btn-glow {
  background: var(--tct-primary-gradient) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  padding: 12px 28px !important;
  font-weight: 700;
  border-radius: var(--tct-radius-md) !important;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4) !important;
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tct-btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(37, 99, 235, 0.5) !important;
  color: #ffffff !important;
}

.tct-btn-glass {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
  padding: 12px 26px !important;
  font-weight: 700;
  border-radius: var(--tct-radius-md) !important;
  backdrop-filter: blur(8px);
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tct-btn-glass:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* Trust Counters Row */
.tct-trust-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 36px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.tct-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f1f5f9;
  font-size: 0.88rem;
  font-weight: 600;
}

.tct-trust-item i {
  color: #38bdf8;
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   FEATURE HIGHLIGHT CARDS (3-column Modern Grid)
   -------------------------------------------------------------------------- */
.tct-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-bottom: 34px;
}

.tct-feature-card {
  background: var(--tct-card-bg);
  border: 1px solid var(--tct-border);
  border-radius: var(--tct-radius-lg);
  padding: 24px;
  box-shadow: var(--tct-shadow-card);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.tct-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--tct-shadow-hover);
  border-color: rgba(37, 99, 235, 0.3);
}

.tct-feature-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 18px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--tct-primary);
}

.tct-feature-card:nth-child(2) .tct-feature-icon-wrapper {
  background: rgba(16, 185, 129, 0.08);
  color: var(--tct-accent-emerald);
}

.tct-feature-card:nth-child(3) .tct-feature-icon-wrapper {
  background: rgba(14, 165, 233, 0.08);
  color: var(--tct-accent-cyan);
}

.tct-feature-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tct-feature-card p {
  color: var(--tct-text-muted);
  font-size: 0.92rem;
  margin-bottom: 0;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   CAROUSEL / SLIDER POLISH
   -------------------------------------------------------------------------- */
.carousel {
  border-radius: var(--tct-radius-lg);
  overflow: hidden;
  box-shadow: var(--tct-shadow-card);
}

.carousel-inner img {
  border-radius: var(--tct-radius-lg);
  object-fit: cover;
  transition: transform 0.4s ease;
}

.carousel-indicators {
  margin-bottom: 16px;
  gap: 8px;
}

.carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.6);
  border: none;
  transition: all 0.3s ease;
}

.carousel-indicators .active {
  width: 30px;
  background-color: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* --------------------------------------------------------------------------
   MODERN SEGMENTED SERVICE TABS
   -------------------------------------------------------------------------- */
.service-tab .card {
  border-radius: var(--tct-radius-xl) !important;
  box-shadow: var(--tct-shadow-card) !important;
}

.service-tab .card-header {
  padding: 16px 24px 0 24px !important;
}

.analytics-tab.nav-tabs {
  border-bottom: 1px solid var(--tct-border);
  gap: 8px;
}

.analytics-tab .nav-link {
  border: none !important;
  background: transparent !important;
  color: var(--tct-text-muted) !important;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 20px;
  border-radius: var(--tct-radius-md) var(--tct-radius-md) 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: all 0.2s ease;
}

.analytics-tab .nav-link:hover {
  color: var(--tct-primary) !important;
}

.analytics-tab .nav-link.active {
  color: var(--tct-primary) !important;
  background: rgba(37, 99, 235, 0.07) !important;
}

.analytics-tab .nav-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 3px;
  background: var(--tct-primary-gradient);
  border-radius: 999px;
}

/* Service Item Card in List */
.service-tab .list-group-item {
  background: transparent !important;
  border-color: var(--tct-border-light) !important;
  padding: 16px 12px !important;
  border-radius: var(--tct-radius-md);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.service-tab .list-group-item:hover {
  background: rgba(37, 99, 235, 0.03) !important;
  transform: translateX(4px);
}

.service-tab img.rounded {
  border-radius: 12px !important;
  object-fit: cover;
  border: 1px solid var(--tct-border);
}

/* --------------------------------------------------------------------------
   MODERN BADGES & BUTTONS
   -------------------------------------------------------------------------- */
.badge {
  border-radius: 999px !important;
  padding: 0.4em 0.85em !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
}

.bg-light-primary {
  background-color: rgba(37, 99, 235, 0.1) !important;
  color: var(--tct-primary) !important;
}

.bg-light-success {
  background-color: rgba(16, 185, 129, 0.1) !important;
  color: #059669 !important;
}

.bg-light-warning {
  background-color: rgba(245, 158, 11, 0.1) !important;
  color: #d97706 !important;
}

.bg-light-danger {
  background-color: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
}

.bg-light-secondary {
  background-color: rgba(100, 116, 139, 0.1) !important;
  color: #475569 !important;
}

/* Buttons */
.btn {
  font-family: var(--tct-font);
  font-weight: 600;
  border-radius: var(--tct-radius-md);
  padding: 10px 20px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: var(--tct-primary-gradient) !important;
  border-color: var(--tct-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  border-color: var(--tct-primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.btn-light-primary {
  background: rgba(37, 99, 235, 0.08) !important;
  color: var(--tct-primary) !important;
  border: 1px solid rgba(37, 99, 235, 0.15) !important;
}

.btn-light-primary:hover {
  background: var(--tct-primary) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   FORM CONTROLS & INPUTS
   -------------------------------------------------------------------------- */
.form-control, .form-select {
  font-family: var(--tct-font);
  min-height: 46px;
  border-radius: var(--tct-radius-md);
  border: 1px solid var(--tct-border);
  background-color: var(--tct-card-bg);
  color: var(--tct-text-main);
  padding: 0.65rem 1rem;
  transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--tct-primary);
  box-shadow: 0 0 0 4px var(--tct-primary-glow);
  background-color: var(--tct-card-bg);
  color: var(--tct-text-main);
}

.form-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--tct-text-main);
  margin-bottom: 6px;
}

/* --------------------------------------------------------------------------
   MODERN TABLES
   -------------------------------------------------------------------------- */
.table {
  --bs-table-bg: transparent;
  color: var(--tct-text-main);
  vertical-align: middle;
}

.table thead th {
  background: rgba(241, 245, 249, 0.8);
  color: var(--tct-text-muted);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tct-border);
}

[data-pc-theme="dark"] .table thead th {
  background: rgba(30, 41, 59, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--tct-border);
}

.table-responsive {
  border-radius: var(--tct-radius-md);
  border: 1px solid var(--tct-border);
}

/* --------------------------------------------------------------------------
   MODERN MODALS (Glassmorphic & Clean)
   -------------------------------------------------------------------------- */
.modal-content {
  border-radius: var(--tct-radius-xl) !important;
  border: 1px solid var(--tct-border) !important;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25) !important;
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.modal-header {
  border-bottom: 1px solid var(--tct-border) !important;
  padding: 22px 26px !important;
}

.modal-body {
  padding: 26px !important;
}

.modal-footer {
  border-top: 1px solid var(--tct-border) !important;
  padding: 18px 26px !important;
}

/* --------------------------------------------------------------------------
   MODERN FOOTER OVERRIDE
   -------------------------------------------------------------------------- */
.gt-footer {
  background: linear-gradient(180deg, #0d1322 0%, #080c16 100%) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  padding-top: 60px;
}

.gt-widget .gt-widget-title {
  color: #ffffff !important;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  position: relative;
}

.gt-widget .gt-widget-desc {
  color: #94a3b8 !important;
  font-size: 0.92rem;
  line-height: 1.6;
}

.gt-widget .gt-widget-links a {
  color: #cbd5e1 !important;
  transition: all 0.2s ease;
}

.gt-widget .gt-widget-links a:hover {
  color: #60a5fa !important;
  transform: translateX(4px);
}

.gt-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 28px 0;
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   TOP LOADER & ANIMATIONS
   -------------------------------------------------------------------------- */
.top-loader {
  background: linear-gradient(90deg, #2563eb, #06b6d4, #8b5cf6, #2563eb) !important;
  background-size: 200% 100% !important;
  animation: gradientMove 2s infinite linear;
}

@keyframes gradientMove {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

/* --------------------------------------------------------------------------
   RESPONSIVE POLISH
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .tct-hero-modern {
    padding: 32px 20px;
    border-radius: var(--tct-radius-lg);
  }
  
  .tct-hero-title {
    font-size: 2.1rem;
  }
  
  .tct-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .tct-trust-stats {
    flex-direction: column;
    gap: 12px;
  }
}
