/* RAE Home Hub - Custom Styles */

/* Theme toggle icon styling */
[data-coreui-toggle="theme-toggle"] {
  border: none;
  background: transparent;
}

[data-coreui-toggle="theme-toggle"]:hover {
  opacity: 0.7;
}

/* Active theme indicator */
[data-coreui-theme-value].active {
  background-color: var(--cui-dropdown-link-active-bg);
  color: var(--cui-dropdown-link-active-color);
}

/* Footer background should adapt to theme */
.footer.bg-light {
  background-color: var(--cui-body-bg) !important;
  border-top: 1px solid var(--cui-border-color);
}

/* Navbar separation for public pages */
.navbar {
  border-bottom: 1px solid var(--cui-border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Dark theme navbar shadow */
[data-coreui-theme="dark"] .navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Hamburger menu icon sizing */
.header-toggler .icon {
  display: inline-block;
  width: 24px;
  height: 24px;
}

/* Add your custom styles below */

/* Prevent horizontal scroll from any overflow */
html, body {
  overflow-x: hidden;
}

/* Fix sidebar overlap - ensure content wrapper respects sidebar width */
/* Using margin-left with minimal transition for smooth but performant animation */
.wrapper {
  transition: margin-left 0.15s ease-out;
}

/* When sidebar is expanded (default state on desktop) */
@media (min-width: 992px) {
  .sidebar ~ .wrapper {
    margin-left: 256px;
  }

  /* When sidebar is narrowed (either mode) */
  .sidebar.sidebar-narrow ~ .wrapper,
  .sidebar.sidebar-narrow-unfoldable ~ .wrapper {
    margin-left: 56px;
  }
}

/* Mobile - sidebar overlays, no margin needed */
@media (max-width: 991.98px) {
  .sidebar ~ .wrapper {
    margin-left: 0;
  }
}

/* Sidebar brand - show/hide text based on narrow state */
.brand-logo,
.brand-favicon {
  flex-shrink: 0;
  /* Crisp rendering for retina displays */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  /* Prevent blurry upscaling */
  -ms-interpolation-mode: nearest-neighbor;
}

.brand-text {
  display: inline;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.15s ease-in-out, width 0.15s ease-in-out;
}

/* When sidebar is narrow, hide the text */
.sidebar-narrow .brand-text,
.sidebar-narrow-unfoldable:not(:hover) .brand-text {
  opacity: 0;
  width: 0;
  margin: 0;
}

/* Center brand in narrow sidebar */
.sidebar-narrow .sidebar-brand,
.sidebar-narrow-unfoldable:not(:hover) .sidebar-brand {
  justify-content: center;
}

/* ===== Reusable shine/sweep hover effect ===== */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
  z-index: 1;
  pointer-events: none;
}

.shine-effect:hover::before {
  left: 100%;
}

/* Shine effect for images (favicon) */
.shine-icon-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 6px;
  line-height: 0;
}

.shine-icon-wrapper img {
  display: block;
}

.shine-icon-wrapper::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 60%,
    transparent 100%
  );
  transition: left 0.4s ease;
  pointer-events: none;
}

.shine-icon-wrapper:hover::after {
  left: 100%;
}

/* ===== Social Links ===== */
.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--cui-body-color);
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.2s ease, border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

/* Override shine-icon-wrapper defaults for circular shape */
.social-icon-btn.shine-icon-wrapper {
  border-radius: 50%;
  line-height: 1;
}

.social-icon-btn:hover {
  transform: scale(1.12);
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.18);
  color: #8b5cf6;
}

[data-coreui-theme="light"] .social-icon-btn {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
}

[data-coreui-theme="light"] .social-icon-btn:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: #8b5cf6;
}
