/* ==========================================================================
   UtilifyZone — Custom Theme Refresh
   Modern, engaging, easy-to-read design system
   ========================================================================== */

/* ---------- 1. CSS Custom Properties (Design Tokens) ---------- */
:root {
  /* Primary palette — warm indigo to violet */
  --uz-primary: #5046e5;
  --uz-primary-hover: #3730a3;
  --uz-primary-light: #eef2ff;
  --uz-primary-subtle: #e0e7ff;

  /* Accent — teal for CTAs and highlights */
  --uz-accent: #0d9488;
  --uz-accent-light: #ccfbf1;

  /* Neutrals — improved contrast for readability */
  --uz-gray-50: #f8fafc;
  --uz-gray-100: #f1f5f9;
  --uz-gray-200: #e2e8f0;
  --uz-gray-300: #cbd5e1;
  --uz-gray-400: #94a3b8;
  --uz-gray-500: #64748b;
  --uz-gray-600: #475569;
  --uz-gray-700: #334155;
  --uz-gray-800: #1e293b;
  --uz-gray-900: #0f172a;

  /* Surfaces */
  --uz-bg-page: #f8fafc;
  --uz-bg-card: #ffffff;
  --uz-bg-elevated: #ffffff;

  /* Text — WCAG AA compliant */
  --uz-text-primary: #0f172a;
  --uz-text-secondary: #475569;
  --uz-text-muted: #64748b;

  /* Borders */
  --uz-border-color: #e2e8f0;
  --uz-border-radius: 0.75rem;
  --uz-border-radius-lg: 1rem;
  --uz-border-radius-xl: 1.5rem;

  /* Shadows — layered for depth */
  --uz-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --uz-shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --uz-shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --uz-shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.12);

  /* Transitions */
  --uz-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --uz-transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 2. Override Silicon CSS Variables ---------- */
:root {
  --si-primary: #5046e5;
  --si-primary-rgb: 80, 70, 229;
  --si-body-color: #334155;
  --si-body-bg: var(--uz-bg-page);
  --si-border-color: var(--uz-border-color);
  --si-link-color: #5046e5;
  --si-link-hover-color: #3730a3;
}

/* ---------- 3. Global Typography ---------- */
body {
  background: linear-gradient(165deg, #f5f3ff 0%, #f0f4ff 20%, #f8fafc 45%, #f0fdfa 70%, #faf5ff 100%) !important;
  background-attachment: fixed !important;
  color: var(--uz-text-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  min-height: 100vh;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 {
  color: var(--uz-text-primary);
  letter-spacing: -0.025em;
}

p {
  color: var(--uz-text-secondary);
  line-height: 1.7;
}

a {
  transition: color var(--uz-transition);
}

/* ---------- 4. Gradient Accent ---------- */
.text-gradient-primary {
  background: linear-gradient(135deg, #5046e5 0%, #7c3aed 50%, #a855f7 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: rgba(0,0,0,0) !important;
  background-clip: text !important;
}

/* ---------- 5. Navbar ---------- */
.header.navbar {
  background: rgba(255,255,255,0.85) !important;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226,232,240,0.6) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
  -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
  -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.04) !important;
  transition: box-shadow var(--uz-transition);
}

.header.navbar .navbar-brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.3rem;
}

.header.navbar .nav-link {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--uz-text-secondary) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 0.5rem;
  transition: all var(--uz-transition);
}

.header.navbar .nav-link:hover,
.header.navbar .nav-link:focus {
  color: var(--uz-primary) !important;
  background-color: var(--uz-primary-light);
}

.header.navbar .nav-link.active,
.header.navbar .nav-link.text-gradient-primary {
  background-color: var(--uz-primary-light);
}

/* Dropdown menus */
.header.navbar .dropdown-menu {
  border: 1px solid var(--uz-border-color);
  box-shadow: var(--uz-shadow-lg);
  border-radius: var(--uz-border-radius);
  padding: 0.5rem;
}

.header.navbar .dropdown-item {
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  transition: all var(--uz-transition);
}

.header.navbar .dropdown-item:hover,
.header.navbar .dropdown-item.active {
  background-color: var(--uz-primary-light);
  color: var(--uz-primary);
}

/* ---------- 6. Hero Section (Front Page) ---------- */
.uz-hero {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 25%, #f0f9ff 50%, #ede9fe 75%, #faf5ff 100%);
  position: relative;
  overflow: hidden;
  margin-top: -10px;
}

.uz-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(80,70,229,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.uz-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(13,148,136,0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.uz-hero h1,
.uz-hero .h1,
.uz-hero h2,
.uz-hero .h2 {
  color: var(--uz-gray-900);
  font-weight: 800;
  line-height: 1.15;
}

.uz-hero p {
  color: var(--uz-gray-600);
  font-size: 1.125rem;
  line-height: 1.75;
}

/* ---------- 7. Cards — The core UI element ---------- */
.card {
  background-color: var(--uz-bg-card);
  border: 1px solid var(--uz-border-color);
  border-radius: var(--uz-border-radius) !important;
  transition: all var(--uz-transition-slow);
  overflow: hidden;
}

.card-hover:hover {
  border-color: rgba(80,70,229,0.2) !important;
  box-shadow: var(--uz-shadow-lg) !important;
  transform: translateY(-2px);
}

/* Tool cards */
.card-hover .card-body h6.text-primary,
.card-hover .card-body .h6.text-primary {
  color: var(--uz-primary) !important;
  font-weight: 700;
  transition: color var(--uz-transition);
}

.card-hover:hover .card-body h6.text-primary,
.card-hover:hover .card-body .h6.text-primary {
  color: var(--uz-primary-hover) !important;
}

.card-hover .card-body .text-body,
.card-hover .card-body p {
  color: var(--uz-text-secondary);
  line-height: 1.6;
}

/* Blog article cards */
article.card {
  background-color: var(--uz-bg-card) !important;
  border: 1px solid var(--uz-border-color);
}

article.card h3 a,
article.card .h4 a {
  color: var(--uz-primary) !important;
  text-decoration: none;
  font-weight: 700;
  transition: color var(--uz-transition);
}

article.card h3 a:hover,
article.card .h4 a:hover {
  color: var(--uz-primary-hover) !important;
}

article.card .img-thumbnail {
  border-radius: var(--uz-border-radius) !important;
  border: none !important;
}

/* ---------- 8. Buttons ---------- */
.btn-primary {
  background-color: var(--uz-primary) !important;
  border-color: var(--uz-primary) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: all var(--uz-transition);
  box-shadow: 0 1px 2px rgba(80,70,229,0.2);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--uz-primary-hover) !important;
  border-color: var(--uz-primary-hover) !important;
  box-shadow: 0 4px 12px rgba(80,70,229,0.3);
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--uz-primary) !important;
  border-color: var(--uz-primary) !important;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all var(--uz-transition);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--uz-primary) !important;
  border-color: var(--uz-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(80,70,229,0.25);
}

.btn-secondary {
  background-color: var(--uz-gray-100) !important;
  border-color: var(--uz-gray-200) !important;
  color: var(--uz-text-secondary) !important;
  border-radius: 0.5rem;
}

.btn-secondary:hover {
  background-color: var(--uz-gray-200) !important;
  color: var(--uz-text-primary) !important;
}

/* ---------- 9. Search Form ---------- */
#mainSearchForm .form-control {
  border: 2px solid var(--uz-gray-200);
  border-radius: 0.75rem 0 0 0.75rem !important;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  color: var(--uz-text-primary);
  background-color: #fff;
  transition: all var(--uz-transition);
}

#mainSearchForm .form-control:focus {
  border-color: var(--uz-primary);
  box-shadow: 0 0 0 4px rgba(80,70,229,0.1);
}

#mainSearchForm .btn {
  border-radius: 0 0.75rem 0.75rem 0 !important;
}

/* Modal search */
#searchModal .modal-content {
  border-radius: var(--uz-border-radius-lg) !important;
  border: none;
  box-shadow: var(--uz-shadow-xl);
}

#searchModal .modal-header {
  border-bottom: 1px solid var(--uz-border-color);
}

#searchModal .modal-footer {
  border-top: 1px solid var(--uz-border-color);
}

/* ---------- 10. Badges ---------- */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: 0.375rem;
  padding: 0.35em 0.65em;
}

.badge.bg-faded-info {
  background-color: rgba(80,70,229,0.08) !important;
  color: var(--uz-primary) !important;
  border: 1px solid rgba(80,70,229,0.12);
}

.badge.bg-faded-success,
.search-card-badge {
  background-color: rgba(13,148,136,0.08) !important;
  color: var(--uz-accent) !important;
  border: 1px solid rgba(13,148,136,0.15) !important;
}

/* ---------- 11. Sidebar ---------- */
.offcanvas-body .card {
  border: 1px solid var(--uz-border-color);
  box-shadow: var(--uz-shadow-sm);
}

.offcanvas-body .card-body .nav-link {
  color: var(--uz-text-secondary);
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all var(--uz-transition);
}

.offcanvas-body .card-body .nav-link:hover {
  color: var(--uz-primary);
  background-color: var(--uz-primary-light);
}

.offcanvas-body .card-body .nav-link.active {
  color: var(--uz-primary);
  font-weight: 600;
}

/* Categories card */
.offcanvas-body .card-body h3,
.offcanvas-body .card-body h5,
.offcanvas-body h3.h5,
.offcanvas-body h5 {
  color: var(--uz-text-primary);
  font-weight: 700;
}

/* ---------- 12. Tabs (Front Page tool category tabs) ---------- */
.nav-tabs {
  border-bottom: 2px solid var(--uz-gray-200);
  gap: 0.25rem;
}

.nav-tabs .nav-link {
  color: var(--uz-text-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem 0.5rem 0 0;
  transition: all var(--uz-transition);
}

.nav-tabs .nav-link:hover {
  color: var(--uz-primary);
  background-color: var(--uz-primary-light);
  border-bottom-color: rgba(80,70,229,0.3);
}

.nav-tabs .nav-link.active {
  color: var(--uz-primary) !important;
  background-color: var(--uz-primary-light);
  border-bottom-color: var(--uz-primary) !important;
  font-weight: 700;
}

/* ---------- 13. Breadcrumbs ---------- */
.breadcrumb {
  background: none;
  padding: 0;
}

.breadcrumb-item a {
  color: var(--uz-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--uz-transition);
}

.breadcrumb-item a:hover {
  color: var(--uz-primary);
}

.breadcrumb-item.active {
  color: var(--uz-text-secondary);
  font-weight: 600;
}

/* ---------- 14. Footer ---------- */
footer.uz-footer {
  background: linear-gradient(180deg, var(--uz-gray-900) 0%, #060a14 100%) !important;
  color: rgba(255,255,255,0.7);
}

footer.uz-footer .navbar-brand,
footer.uz-footer h5,
footer.uz-footer h3 {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

footer.uz-footer .text-gradient-primary {
  background: linear-gradient(135deg, #818cf8, #c084fc) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: rgba(0,0,0,0) !important;
}

footer.uz-footer p,
footer.uz-footer .fs-sm {
  color: rgba(255,255,255,0.6);
}

footer.uz-footer .nav-link {
  color: rgba(255,255,255,0.65) !important;
  font-weight: 500;
  padding: 0.3rem 0 !important;
  transition: all var(--uz-transition);
  border-radius: 0.25rem;
}

footer.uz-footer .nav-link:hover {
  color: #fff !important;
  padding-left: 0.5rem !important;
}

footer.uz-footer .nav-link.active {
  color: #a5b4fc !important;
}

footer.uz-footer hr {
  border-color: rgba(255,255,255,0.1);
  margin: 0;
}

footer.uz-footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 1.5rem 0;
}

footer.uz-footer .footer-bottom p {
  color: rgba(255,255,255,0.4);
}

footer.uz-footer .footer-bottom a {
  color: #a5b4fc !important;
  -webkit-text-fill-color: #a5b4fc !important;
}

/* ---------- 15. Back to Top Button ---------- */
.btn-scroll-top {
  background-color: var(--uz-primary) !important;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(80,70,229,0.3);
}

.btn-scroll-top:hover {
  background-color: var(--uz-primary-hover) !important;
}

/* ---------- 16. Scrollbar Styling ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--uz-gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--uz-gray-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--uz-gray-400);
}

/* ---------- 17. Selection ---------- */
::selection {
  background-color: rgba(80,70,229,0.15);
  color: var(--uz-text-primary);
}

/* ---------- 18. Focus States (Accessibility) ---------- */
:focus-visible {
  outline: 2px solid var(--uz-primary);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* ---------- 19. Category section headings ---------- */
.tab-pane h1 {
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* ---------- 20. Page Loading Spinner Override ---------- */
.page-spinner {
  border-color: rgba(80,70,229,0.2) !important;
  border-right-color: transparent !important;
}

/* ---------- 21. Popular Blogs card gradient ---------- */
.card-body .bg-gradient-primary.opacity-10 {
  background: linear-gradient(135deg, rgba(80,70,229,0.06), rgba(124,58,237,0.04)) !important;
  opacity: 1 !important;
}

/* ---------- 22. Alerts ---------- */
.alert-primary {
  background-color: var(--uz-primary-light);
  border-color: var(--uz-primary-subtle);
  color: var(--uz-primary-hover);
}

/* ---------- 23. Tool page header area ---------- */
.page-wrapper hr {
  border-color: var(--uz-gray-200);
  opacity: 0.6;
}

/* ---------- 24. Social / follow buttons ---------- */
.btn-icon.btn-secondary {
  background-color: var(--uz-gray-100) !important;
  border: 1px solid var(--uz-gray-200) !important;
  border-radius: 0.5rem !important;
  transition: all var(--uz-transition);
}

.btn-icon.btn-secondary:hover {
  background-color: var(--uz-primary) !important;
  border-color: var(--uz-primary) !important;
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(80,70,229,0.25);
}

/* ---------- 25. Related posts section ---------- */
.related-posts .card {
  border: 1px solid var(--uz-border-color);
}

.related-posts .card:hover {
  border-color: rgba(80,70,229,0.2);
  box-shadow: var(--uz-shadow-lg);
}

.related-posts .card .card-title a {
  color: var(--uz-primary) !important;
  text-decoration: none;
  font-weight: 600;
}

.related-posts .card .card-title a:hover {
  color: var(--uz-primary-hover) !important;
}

/* ---------- 26. Smooth scroll ---------- */
html {
  scroll-behavior: smooth;
}

/* ---------- 27. Image treatments ---------- */
.img-thumbnail {
  border: 1px solid var(--uz-border-color) !important;
  border-radius: var(--uz-border-radius) !important;
  padding: 0 !important;
}

/* ---------- 28. Developer box override ---------- */
.developer-box .light-dev-card {
  border: 1px solid var(--uz-border-color);
  border-radius: var(--uz-border-radius-lg);
  box-shadow: var(--uz-shadow-md);
}

.developer-box .light-img-wrapper {
  background: linear-gradient(135deg, var(--uz-primary-light), #f5f3ff);
}

.developer-box .dev-profile-img {
  border-color: rgba(80,70,229,0.2);
  box-shadow: 0 8px 20px rgba(80,70,229,0.15);
}

.developer-box .light-icon-btn:hover {
  background-color: var(--uz-primary);
  border-color: var(--uz-primary);
  box-shadow: 0 5px 15px rgba(80,70,229,0.3);
}

/* ---------- 29. Animation: subtle entry for cards ---------- */
@media (prefers-reduced-motion: no-preference) {
  .card-hover {
    will-change: transform, box-shadow;
  }
}

/* ---------- 30. Footer logo brightness for dark bg ---------- */
footer.uz-footer .navbar-brand img {
  filter: brightness(1.3) saturate(1.2);
}

/* ---------- 31. Search modal body background ---------- */
#searchModal .modal-content {
  background-color: var(--uz-gray-50) !important;
}

/* ---------- 32. Responsive tweaks ---------- */
@media (max-width: 767.98px) {
  .uz-hero h2,
  .uz-hero .h1 {
    font-size: calc(1.4rem + 1.2vw);
  }
  
  .uz-hero p {
    font-size: 1rem;
  }
}

/* ---------- 33. Print-friendly ---------- */
@media print {
  .uz-hero,
  footer.uz-footer {
    background: #fff !important;
    color: #000 !important;
  }
}
