{{ with site.Params.variables }}
// Color Variables
$primary-color: {{.primary_color}};
$secondary-color: {{.secondary_color}};
$text-color: {{.text_color}};
$text-color-dark: {{.text_color_dark}};
$body-color: {{.body_color}};
$border-color: {{.border_color}};
$black: {{.black}};
$white: {{.white}};
$light: {{.light}};

// Font Variables
$primary-font: '{{ replaceRE ":wght@[0-9;]+" "" .primary_font }}', sans-serif;
$secondary-font: '{{ replaceRE ":wght@[0-9;]+" "" .secondary_font }}', sans-serif;
$icon-font: '{{.icon_font}}';
{{ end }}

@import 'mixins';
@import 'typography';
@import 'buttons';
@import 'common';
@import 'templates/navigation.scss';
@import 'templates/main.scss';

// Base light theme styles
body {
  background: $light;
  color: $text-color;
}

.widget-banner {
  text-align: center;
}

.responsive-img {
  max-width: 100%;
  height: auto;
}

@media screen and (max-width: 768px) {
  .widget-banner {
      margin: 1rem auto;
      max-width: 90%;
  }
}

.stickyside {
  position: sticky;
  top: 2rem;
}

// Back to top button styles
#back-to-top {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 30px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: $primary-color;
  color: $white;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  transition: all 0.3s ease;
  opacity: 0;
  
  &.show {
    display: block;
    opacity: 1;
  }
  
  &:hover {
    background-color: darken($primary-color, 10%);
    transform: translateY(-3px);
  }

  svg {
    display: block;
    margin: 0 auto;
  }
}

// Theme toggle styles

.theme-toggle {
  .btn-link {
    color: $text-color;
    padding: 0;
    font-size: 1.25rem;
    line-height: 1;
    box-shadow: none !important;
    
    &:hover {
      color: $secondary-color;
    }

    &:focus {
      text-decoration: none;
    }
  }
}

/* Search result highlight styling */
.mark, mark {
  padding: 0;
  background-color: rgba(71, 196, 241, 0.15);
  color: inherit;
  border-radius: 2px;
  position: relative;
  z-index: 1;
  display: inline;
}

/* Optional: Add animation for better UX */
.mark {
  animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
  from {
      background-color: rgba(71, 196, 241, 0.5);
  }
  to {
      background-color: rgba(71, 196, 241, 0.15);
  }
}

/* Ensure search results container is properly positioned */
#search-results {
  position: relative;
  z-index: 2;
}

// Dark theme styles
[data-theme="dark"] {
  body, 
  body main * {
    background: #2d2d2d;
    color: $primary-color;
  }

  p, .paragraph {
    font-weight: 400;
    color: $primary-color;
    font-family: $primary-font;
  }

  blockquote p {
    font-weight: 400;
    color: $text-color !important;
    font-family: $primary-font;
  }

  table {
    background: rgb(205, 205, 205);
    color:#333;
  }

  header.sticky-top {
    background: #2d2d2d;
    
    .navbar-nav {
      .nav-link {
        color: $text-color-dark;
        &:hover {
          color: $secondary-color;
          text-decoration: none;
        }
      }
    }

    .dropdown-menu {
      background: #2d2d2d;
      
      .dropdown-item {
        color: $primary-color;
        &:hover {
          color: $secondary-color !important;
          background: #3a3a3a;
          text-decoration: none;
        }
      }
    }
  }

  a.px-3 {
    color: $text_color_dark;
  }

  .col-lg-8,
  .bg-white,
  li.list-inline-item,
  div.widget,
  .card-block,
  .col-md-6 *,
  .bannerpad {
    background: #2d2d2d !important;
  }

  a {
    color: #f5f5f5;
    &:hover{
      text-decoration: none;
      color: $secondary-color;
    }
  }

  a.text-dark {
    color: #f5f5f5;
    &:hover{
      text-decoration: none;
      color: $secondary-color;
    }
  }

  a.dropdown-item,a.nav-link {
    color: $text_color_dark;
    &:hover{
      text-decoration: none;
      color: $secondary-color;
    }
  }

  h1,h2,h3,h4,h5,h6 {
    color: $primary-color;
    font-family: $primary-font;
    font-weight: 600;
    line-height: 1.2;
    a{
        &:hover{
        text-decoration: none;
        }
    }
  }

  h2.article-center {
    display: block;
    margin: 0 auto;
    width: 300px;
    text-align: center;
  }

  .highlight {
    position: relative;
  }
  .highlight pre {
    padding-right: 75px;
  }
  .highlight-copy-btn {
    position: absolute;
    bottom: 7px;
    right: 7px;
    border: 0;
    border-radius: 4px;
    padding: 1px;
    font-size: 0.7em;
    line-height: 1.8;
    color: #fff;
    background-color: #777;
    min-width: 55px;
    text-align: center;
  }
  .highlight-copy-btn:hover {
    background-color: #666;
  }
  
  .block {
    background-color: #3A3A3A;
  }

  div.widget {
    background-color: #3A3A3A !important;
  }

  .shadow {
    box-shadow: none !important;
  }

  .post-meta {
    color: #999999;
  }

  .card-block {
    color: $primary-color;
    background-color: #3a3a3a !important;
  }

  .card-block * {
    color: $primary-color;
    background-color: inherit !important;
  }

  ::selection {
    background: $secondary-color;
    color: $white;
  }

  ::-moz-selection {
    background: $secondary-color;
    color: $white;
  }

  .theme-toggle .btn-link {
    color: $text-color-dark;
    
    &:hover {
      color: $secondary-color;
    }
  }

  #back-to-top {
    background-color: $secondary-color;
    
    &:hover {
      background-color: darken($secondary-color, 10%);
    }
  }

  /* Search result highlight styling */
.mark, mark {
  padding: 0;
  background-color: rgba(71, 196, 241, 0.1);
  color: inherit;
  border-radius: 2px;
  position: relative;
  z-index: 1;
  display: inline;
}

/* Optional: Add animation for better UX */
.mark {
  animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
  from {
      background-color: rgba(71, 196, 241, 0.25);
  }
  to {
      background-color: rgba(71, 196, 241, 0.1);
  }
}

/* Ensure search results container is properly positioned */
#search-results {
  position: relative;
  z-index: 2;
}
}