/* ==========================================================================
   Base Styles and Layout
   ========================================================================== */
/* Apply theme transitions with slight delay for smoother rendering */
html[data-bs-theme] {
  transition: background-color 0.3s ease, color 0.3s ease;
  transition-delay: 0.05s;
}

body {
  background: #fafafa;
  color: #333333;
  margin-top: 6rem;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  color: #444444;
}

/* Smooth transitions for theme switching */
.card, .alert, .list-group-item, .btn, body, nav {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Dark mode base styles */
[data-bs-theme="dark"] body {
  background: #212529;
  color: #f8f9fa;
}

[data-bs-theme="dark"] h1, 
[data-bs-theme="dark"] h2, 
[data-bs-theme="dark"] h3, 
[data-bs-theme="dark"] h4, 
[data-bs-theme="dark"] h5, 
[data-bs-theme="dark"] h6 {
  color: #e9ecef;
}

/* Dark mode component styles */
[data-bs-theme="dark"] .card {
  background-color: #343a40;
  border-color: #495057;
  color: #f8f9fa;
}

[data-bs-theme="dark"] .alert-info {
  background-color: #17a2b8;
  border-color: #138496;
  color: #ffffff;
}

[data-bs-theme="dark"] .list-group-item {
  background-color: #343a40;
  border-color: #495057;
  color: #f8f9fa;
}

/* Custom shadows for theme modes - consolidated selectors for performance */
[data-bs-theme="dark"] .shadow {
  box-shadow: 0 1rem 1.5rem rgba(255, 255, 255, 0.15) !important;
}
[data-bs-theme="dark"] .shadow-sm {
  box-shadow: 0 0.125rem 0.25rem rgba(255, 255, 255, 0.075) !important;
}
[data-bs-theme="dark"] .shadow-lg {
  box-shadow: 0 1rem 3rem rgba(255, 255, 255, 0.175) !important;
}

/* ==========================================================================
   Navigation Styles
   ========================================================================== */
.navbar {
  min-height: 50px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  height: 100%;
}

/* Navigation Background */
.bg-nav {
  background-color: rgba(33, 37, 41, 0.95) !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  opacity: 0.9;
}

[data-bs-theme="dark"] .bg-nav {
  background-color: rgba(248, 249, 250, 0.95) !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  opacity: 0.9;
}

/* Navigation Links */
.navbar-nav .nav-link {
  color: #f8f9fa;
}

.navbar-nav .nav-link:hover {
  color: #ffffff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.889);
}

.navbar-nav .nav-link.active {
  font-weight: 500;
  color: #ffffff;
  border-bottom: 2px solid #ffffff;
}

.text-decoration-none {
  text-decoration: none;
}
/* Dark Mode Navigation */
[data-bs-theme="dark"] .navbar-nav .nav-link {
  color: #212529;
}

[data-bs-theme="dark"] .navbar-nav .nav-link:hover {
  color: #000000;
  text-shadow: 0 0 4px rgba(95, 95, 95, 0.2);
}

[data-bs-theme="dark"] .navbar-nav .nav-link.active {
  font-weight: 500;
  color: #000000;
  border-bottom: 2px solid #000000;
}

/* Theme Toggle Button Styling */
#theme-toggle {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  color: #f8f9fa;
}

#theme-toggle i {
  color: #f8f9fa;
}

/* In dark mode, make the sun icon visible with dark color */
[data-bs-theme="dark"] #theme-toggle {
  border-color: rgba(0, 0, 0, 0.5);
  color: #212529;
}

[data-bs-theme="dark"] #theme-toggle i {
  color: #212529;
}

/* Custom Navigation */
.sub-sticky-nav {
  position: sticky;
  top: 56px; /* Height of the main navbar - adjust if needed */
  z-index: 1020;
}

/* ==========================================================================
   Layout Elements
   ========================================================================== */
main {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.container {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

img {
  width: auto;
  height: 32px;
  margin: 2px;
}

/* ==========================================================================
   Content and Article Styles
   ========================================================================== */
.article-content {
  white-space: pre-line;
}

.article-img {
  height: 65px;
  width: 65px;
  margin-right: 16px;
}

.article-svg {
  width: 25px;
  height: 25px;
  vertical-align: middle;
}

a.article-title:hover {
  color: #428bca;
  text-decoration: none;
}

.account-img {
  height: 125px;
  width: 125px;
  margin-right: 20px;
  margin-bottom: 16px;
}

.account-heading {
  font-size: 2.5rem;
}

/* ==========================================================================
   Footer Styles
   ========================================================================== */
#foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

#copyright {
  width: 100%;
  margin-top: 2px;
  order: 2;
}

/* Footer links */
#copyright a {
  color: #495057;
  text-decoration: none;
}

#copyright a:hover {
  color: #212529;
  text-decoration: underline;
}

[data-bs-theme="dark"] #copyright a {
  color: #f8f9fa;
}

[data-bs-theme="dark"] #copyright a:hover {
  color: #f8f9fa;
}

.login-btn {
  display: inline-block;
  width: 10px;
  height: 32px;
  margin: 0px;
  padding: 0px;
}

.text-decoration-none {
  text-decoration: none;
}

/* ==========================================================================
   Cookie Banner Styles
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  z-index: 1000;
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

[data-bs-theme="dark"] .cookie-banner {
  background-color: #343a40;
  color: #f8f9fa;
  border-top: 1px solid #495057;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

/* ==========================================================================
   Showcase Styles
   ========================================================================== */
.showcase-container {
  width: 100%;
  margin-bottom: 2rem;
}

.showcase-background {
  position: relative;
  width: 100%;
  height: 400px;
  background-size: contain;
    background-repeat: no-repeat;
  background-position: center;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity 0.3s ease-in-out, transform 0.5s ease-in-out;
}

.showcase-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  z-index: 2;
}

.showcase-title {
  color: white;
  margin-bottom: 0.5rem;
}

.showcase-description {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.showcase-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  transform: translateY(-50%);
  z-index: 2;
}

.showcase-controls button {
  opacity: 0.7;
  transition: opacity 0.3s;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

.showcase-controls button:hover {
  opacity: 1;
}

/* Progress indicators */
.showcase-progress {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 3;
}

.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.3s;
}

.progress-dot.active {
  background-color: white;
}

/* Touch feedback */
.showcase-background.swiping {
  transition: transform 0.1s ease-out;
}

/* Accessibility */
.showcase-controls button:focus,
.progress-dot:focus {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .showcase-background {
    height: 300px;
  }
  
  .showcase-controls button {
    padding: 6px 12px;
    font-size: 14px;
  }
  
  .progress-dot {
    width: 8px;
    height: 8px;
  }
}

/* ==========================================================================
   Details and Summary Elements
   ========================================================================== */
details {
  transition: all 0.4s ease;
}

details summary {
  cursor: pointer;
  position: relative;
  list-style: none;
  margin-bottom: 0.5rem;
}



details summary::marker,
details summary::-webkit-details-marker {
  display: none;
}

details summary::before {
  content: '\25B6';
  margin-right: 0.5rem;
  display: inline-block;
  transition: transform 0.3s ease;
  color: #0d6efd;
}

details[open] summary::before {
  transform: rotate(90deg);
}

/* ========================================================================== 
   Custom details elements animation
   ========================================================================== */

/* Force details content to be hidden by default (override any browser defaults) */
details:not([open]) .card {
  display: block !important;
  height: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Show content when details is open with animation */
details[open] .card {
  display: block;
  height: auto;
  opacity: 1;
  margin-top: 1rem;
  animation: fadeIn 0.5s ease;
}

/* Define fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hide Feature Comparison on small devices */
@media (max-width: 767px) {
    .feature-comparison {
        display: none;
    }
}

/* Prevent horizontal scrolling on controls pages */
.tab-content {
    overflow-x: hidden;
}

/* Ensure tables don't cause overflow */
.table-responsive {
    max-width: 100%;
}

/* Controls page specific fixes */
/* Fix tab navigation issues */
#controlsTabs {
    max-width: 100%;
    flex-wrap: wrap;
}

/* Prevent horizontal scrolling on controls page */
#our-solutions .card {
    overflow-x: hidden;
}

/* Adjust tab sizing on small screens */
@media (max-width: 767px) {
    #controlsTabs .nav-item {
        width: 100%;
    }
    
    #controlsTabs .nav-link {
        text-align: left;
        border-radius: 0;
        padding: 8px;
    }
    
    #controlsTabContent {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Fix container overflow */
    #our-solutions .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}
