* {
  margin: 0px;
  padding: 0px;
  box-sizing: border-box;
}
:root {
  --color-1: #0f1016;
  --color-2: white;
  --text-color: #f0f0f0;
  --text-color-2: #000000;
  --acent-color: #006aff;
  --background-color: #222429;
  --primary-color: #cfd8dc;
  --secondary-color: #304ffe;
  --background-color-2: #a6a6a6;
  /* --background-color-3: rgba(166, 166, 166, .2); */
  --fill: #ffffff;
  --radius: 0.2rem;
}

.darkmode {
  --color-2: #0f1016;
  --text-color-2: #f0f0f0;
  --acent-color: #006aff;
  --background-color: #222429;
  --background-color-2: #272727;
  /* --background-color-3: rgba(39, 39, 39, .2); */
  --fill: #cccccc;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 12pt;
  font-family: Poppins, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* Naviagation Bar Styles */
nav {
  height: 60px;
  background-color: var(--color-1);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-right: 2%;

  border-bottom: 5px solid var(--acent-color);
  position: sticky; /* Sticky positioning */
  top: 0; /* Set top position */
  z-index: 10; /* Ensure it's on top of other content */
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  /* background: url("your-background-image.jpg") no-repeat center center fixed; */
  background-size: cover;
}

main {
  color: var(--text-color-2);
  padding: min(50px, 2%);
  background-color: var(--color-2);
  padding-top: 60px;
}
nav {
  background: rgba(255, 255, 255, 0.1); /* Initial transparent background */
  backdrop-filter: blur(10px); /* Blurring effect */
  color: var(--text-color-2);
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  width: 100%;
  top: 0;
  transition: background 0.3s ease, opacity 0.3s ease; /* Smooth transition */
}

.links-container {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
}


nav a {
  height: 100%;
  padding: 0 20px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-color-2);
}

nav a:hover {
  background-color: var(--acent-color);
}

/* Apply .active class styles globally, outside of any media queries */
.active {
  /* color: red; */
  background-color: var(--acent-color);
  font-weight: bold;
}

@media (max-width: 1000px) {
  /* Additional styles specific to smaller screens */
  .active {
    /* Example of something specific for small screens */
    font-size: 1.2em;
  }
}

.logo {
  margin-right: auto;
  font-weight: bolder;
  font-size: x-large;
}
@media (min-width: 1000px) {
  .sm-logo {
    display: none;
  }
}

#sidebar-active {
  display: none;
}

.open-sidebar-button,
.close-sidebar-button {
  display: none;
}

@media (max-width: 1000px) {
  .links-container {
    flex-direction: column;
    align-items: flex-start;
    position: fixed;
    top: 0;
    right: -100%;
    /* z-index: 10; */
    width: 300px;
    background-color: var(--color-1);
    box-shadow: -5px 0 5px var(--color-1);
    
    transition: right 0.75s ease-out; /* Smooth transition */
    height: 100dvh;
    z-index: 20; /* new Sidebar has a higher z-index than the overlay */


    color: var(--text-color-2);
    /* Glassmorphism Effect */
    background: rgba(0, 0, 0, 0.9); 
    backdrop-filter: blur(10px); 
    border-radius: 10px; /* Optional: Rounded corners */
    padding: 20px; /* Padding for spacing */


  }

  .links-container a {
    color: var(--text-color-2); /* Set the text color from your CSS variable */
    text-decoration: none; /* Remove underline from links */
    padding: 10px 15px; /* Add padding for clickable area */
    border-radius: 5px 0 0 5px;  /* Optional: rounded corners for a button-like appearance */
    transition: background 0.3s ease, color 0.3s ease; 
}

/* Optional: Add hover effect for links */
.links-container a:hover {
    background: rgba(255, 255, 255, 0.2); /* Slightly increase background opacity on hover */
    color: var(--text-color-1); /* Change text color on hover */
}


  #overlay {
    height: 0; /* Initially hidden */
    width: 0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 15; /* Overlay has a lower z-index than the sidebar */
    /* background: rgba(255, 0, 0, 0.5);  */
    transition: 0.5s;
  }

  nav a {
    box-sizing: border-box;
    height: auto;
    width: 100%;
    padding: 20px 30px;
    justify-content: flex-start;
  }
  .open-sidebar-button,
  .close-sidebar-button {
    padding: 0 20px;
    display: block;
  }
  #sidebar-active {
    display: none;
  }
  #sidebar-active:checked ~ .links-container {
    right: 0;
  }

  #sidebar-active:checked ~ #overlay {
    /* background: red; */
    position: fixed;
    top: 0;
    left: 0;
    /* z-index: 9; */
    height: 100vh;
    width: 100vw;
    z-index: 15; /* Keeps the overlay behind the sidebar */
  }
  #sidebar-active:checked ~ .links-container {
    z-index: 20; /* Sidebar stays on top of the overlay */
  }
}

/* Theme button Styles */
#theme-switch {
  height: 50px;
  width: 50px;
  transform: scale(0.8);
  background-color: var(--background-color-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10%;
  margin-left: 15%;
  position: absolute;
  right: 15%;
  padding: 0px;
  border-radius: 50%;
}

.darkmode #theme-switch svg:first-child {
  display: none;
}

.darkmode #theme-switch svg:last-child {
  display: block;
}
#theme-switch svg:last-child {
  display: none;
}
#theme-switch svg {
  transition: fill 0.3s;
}

#theme-switch svg {
  fill: var(--fill);
  transition: fill 0.3s;
}

nav svg {
  fill: var(--text-color-2);
}
#sidebar-active:not(:checked) #close {
  fill: var(--text-color);
}

/* SearchBox Styles */
#nav-search {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  margin-left: auto;
}
#Search-Box {
  background-color: rgb(255, 255, 255);
  font-family: Poppins, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  caret-color: var(--acent-color);
  border-width: 1px;
  border-style: solid;
  border-color: grey;
  border-image: initial;
  border-radius: 5px;
  padding: 8px;
  margin: 2%;
  outline: none;
}
#search-btn {
  color: white;
  background-color: rgb(55, 55, 55);
  margin-right: 10px;
  font-family: Poppins, "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  border-width: 1px;
  border-style: solid;
  border-color: grey;
  border-image: initial;
  border-radius: 3px;
  padding: 8px;
}

@media (max-width: 1000px) {
  /* Ensure .links-container is a flexbox */
  .links-container {
    display: flex;
    flex-direction: column; /* Stack items vertically */
    align-items: center;
  }
  .links-container a {
    color: white;
  }
  .links-container svg {
    fill: white;
  }

  /* Ensure the sm-logo appears first */
  .sm-logo {
    order: -2; /* Place before open-sidebar-button */
  }

  /* Sidebar open button */
  .open-sidebar-button {
    order: -1; /* Place right after the logo */
  }

  /* Ensure the logo (id="logo") appears at the top */
  #logo {
    order: 0;
  }

  /* Reorder the nav-search */
  #nav-search {
    order: 1;
    width: 90%;
    margin: 10px auto; /* Center the search bar */
  }

  /* Keep the nav-items below the search */
  .nav-item {
    order: 2;
  }

  /* Adjust the close button position */
  .close-sidebar-button {
    order: 0; /* Ensures it appears first in the sidebar */
    align-self: flex-start; /* Align to the left */
    margin-top: 10px;
    margin-left: -12px;
    transform: scale(1.2);
  }

  #theme-switch {
    right: 8%;
    top: 3%;
    transform: scale(.9);
  }
}

h1 {
  margin: 30px 0px;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 0.3fr));
  justify-content: center;
  gap: 2rem;
}

/* Cards Sytle */
.card {
  overflow: hidden;
  border: 1px solid var(--primary-color);
  box-shadow: 4px 4px var(--primary-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: border 200ms ease-in, box-shadow 200ms ease-in;
  box-shadow: rgb(207, 216, 220) 4px 4px;
  border-radius: 10px;
}

.card__image {
  height: 12rem;
  width: 100%;
  object-fit: cover;
}

.card__title {
  padding: 1rem;
}

.card__description {
  padding: 0 1rem;
}

.card__link {
  text-decoration: none;
  padding: 1rem;
  font-weight: bold;
  color: var(--secondary-color);
}

.card__link::after {
  content: "\f061";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: relative;
  left: 0.5rem;
}

.card:hover {
  border: 1px solid var(--secondary-color);
  box-shadow: 8px 8px var(--secondary-color);
}

.card:hover .card__link::after {
  animation: arrow 1s ease-in-out infinite alternate;
}

@keyframes arrow {
  0% {
    left: 0.5rem;
  }
  100% {
    left: 1.5rem;
  }
}

/* Link To Top Start  */
#myBtn {
  position: fixed;
  height: 50px;
  width: 50px;
  background: var(--acent-color);
  bottom: 40px;
  right: 50px;
  text-decoration: none;
  text-align: center;
  line-height: 50px;
  color: white;
  font-size: 22px;
  cursor: pointer;
  display: none;
  border-radius: 10px;
  z-index: 99;
}

#myBtn:hover {
  background-color: var(
    --background-color-2
  ); /* Add a dark-grey background on hover */
}

html {
  scroll-behavior: smooth;
}
