/* TODO: fix resources images so that they work for both desktop and mobile (currently images are square) */
/* --------------------------------------------------------------------------------------------------------------------------------- */

/* General */
@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  box-sizing: border-box;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

@font-face {
  font-family: "Countach";
  src: url("../fonts/Countach-Bold.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

body {
  margin: 0;
  font-family: "Barlow", sans-serif;
  display: flex;
  flex-direction: column;
}

h1 {
  font-family: "Barlow", sans-serif;
  font-weight: 500;
  font-size: clamp(28px, 1.875vw, 36px);
}

h2 {
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  font-size: 24px;
}

h3 {
  /*Image text, needs countach*/
  font-family: "Barlow", sans-serif;
  font-weight: 400;
  font-size: 16px;
}

p {
  font-family: "Barlow", sans-serif;
  font-weight: 400;
  font-size: 16px;
}

html,
body {
  /*Hides horizontal scrollbar*/
  overflow-x: hidden;
  max-width: 100vw;
}
/* --------------------------------------------------------------------------------------------------------------------------------- */

/* Nav Bar */
.top-bar {
  width: 100%;
  height: 75px;
  background-color: #a6192e;
  color: white;
  display: flex;
  align-items: center;
  vertical-align: center;
  padding: 0 20px;
  position: fixed;
  z-index: 100;
}

.toggle-btn {
  background-color: rgba(
    255,
    255,
    255,
    0
  ); /*Transparent background for menu icon*/
  color: white;
  border: none;
  padding-left: 5px;
  padding-bottom: 10px;
  cursor: pointer;
  font-size: 35px;
  line-height: 70px;
}



.sidebar {
  width: 250px;
  background-color: #a6192e;
  color: white;
  padding-top: 55px; /* Account for top-bar height */
  transition: transform 0.3s ease-in-out;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* This keeps space between the top and bottom items */
  padding-bottom: 20px;
  z-index: 90;
}

#sidebar-logo {
  margin-right: auto;
  max-width: 200px;
  padding: 25px
}

.sidebar.collapsed {
  transform: translateX(-250px);
}

.language :hover {
  cursor: pointer;
}

nav {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: space-between;
}
/* test */
nav ul {
  list-style-type: none;
  padding: 0;
  margin-top: 20px;
}

nav ul.top-items {
  margin-bottom: 20px; /* Pushes bottom items to the end */
}

nav ul.bottom-items {
  margin-top: auto; /* Sticks to the bottom */
  margin-bottom: 70px; /*The sidebar was behaving weirdly and cutting off the last item so this resolves that*/
}

nav ul li a {
  color: white;
  font-weight: 100;
  font-size: 21px;
  text-decoration: none;
  display: block;
  padding: 20px;
}

nav ul li #current {
  color: white;
  font-weight: 800;
  font-size: 21px;
  text-decoration: none;
  display: block;
  padding: 20px;
}

nav ul li a:hover {
  font-weight: 800;
  transition: font-weight 0.3s ease-in-out;
}

/* Adjust content margin when sidebar is collapsed */
.home {
  margin-top: 120px;
  transition: margin-left 0.3s;
}


/* Issue container with both header and content */
.collapsible-box {
  border: 2px solid #d3d3d3;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 20px;
  z-index: 40;
}

.link-content {
  cursor:pointer;
}

/* Just issue header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0px 20px;
  cursor: pointer;
  background-color: #d3d3d3;
  max-height: 68px;
}

.header-right {
  margin-left: auto;
  display: flex;
}

.header-right > * {
  padding: 10px 0px 10px 0px;
  margin: 16px 16px 16px 0px;
}

.header h1 {
  margin-right: auto;
}

/* Box content */
.collapsible-box .boxcontent {
  padding: 0 15px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
  opacity: 0;
}

.expanded .header-details {
  display: none;
  transition: opacity 0.4s ease-in-out; /*fade in doesnt currently work :( */
}

/* Body content in box */
.desc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #d3d3d3;
}

.details {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #d3d3d3;
}

.left-details {
  margin-right: auto;
  display: flex;
}

.left-details > * {
  padding-right: 5px;
}

.tags {
  display: flex;
  margin: 10px 0px 10px 10px;
  gap: 0.5em;
}



.tag p {
  margin: 0;
}

.tag {
  padding: 0px 13px 0px 13px;
  background-color: #57545f;
  color: #ffffff;
  height: 27px;
  border-radius: 15px;
  padding-top: 7px;
}

/* Issue box */
.arrow {
  color: #afafaf;
  display: inline-block;
  transition: transform 0.3s ease-in-out;
  transform-origin: center;
  scale: 1.5;
}

.expanded .header .arrow {
  transform: rotate(180deg);
}

.expanded .boxcontent {
  max-height: 700px;
  opacity: 1;
  padding-top: 5px;
  padding-bottom: 15px;
}
/* --------------------------------------------------------------------------------------------------------------------------------- */

/* Upvote & Downvote Buttons */
.vote-box {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 0px;
}

.vote {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.vote-box > .arrow {
  font-size: 40px;
  transition: color 0.2s;
}

.count {
  font-size: 24px;
  transition: color 0.2s, font-weight 0.2s;
}

/* Default inactive styles */
.upvote .arrow,
.up-count {
  color: #AFAFAF;
  padding-left: 3px;
}

.downvote .arrow,
.down-count {
  color: #AFAFAF;
  padding-right: 4px;
}

/* Active vote styles */
.upvote.active .arrow,
.upvote.active .up-count {
  color: #2d6a1f; /* green */
  font-weight: bold;
}

.downvote.active .arrow,
.downvote.active .down-count {
  color: #e08331;
  font-weight: bold;
}

/* Bottom gradient */
#gradient {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;

  background: linear-gradient(
    to top,
    rgba(133, 133, 133, 90),
    rgba(217, 217, 217, 0)
  );
}
/* --------------------------------------------------------------------------------------------------------------------------------- */

/* Plus Button */
.plus-button {
  z-index: 100;
  background-color: #cc0633;
  color: white;
  font-size: 60px;
  border: none;
  border-radius: 50%;
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
  position: fixed;
  bottom: 45px;
  right: 45px;
  padding-bottom: 8px;
}

.plus-button:hover {
  transform: scale(1.1);
}

.plus-button:active {
  transform: scale(0.95);
}

/* --------------------------------------------------------------------------------------------------------------------------------- */

/* Column setup */
.columns {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
}

.home > .columns > .resources-carousel {
  order: 2;
  grid-column-start: 12;
  grid-column-end: 15;
}

.home > .columns > .issues {
  order: 1;
  grid-column-start: 3;
  grid-column-end: 11;
  margin-top: 1rem;
}

#browse > .columns > .issues {
  grid-column-start: 4;
  grid-column-end: 13;
}

#browse {
  margin-top: 100px;
}

/* --------------------------------------------------------------------------------------------------------------------------------- */

/* Resources */

.allresources {
  display: flex;
  flex-direction: column;
  gap: 35px;
}

#advising {
  margin-left: -22vw;
}

#course-map {
  margin-bottom: 0;
  margin-right: 10vw;
}

#offerings {
  margin-bottom: -5vw;
  margin-right: -7vw;
}

.square-button {
  width: calc(100vw * 2 / 15); /* 2/15 of viewport width */
  height: calc(100vw * 2 / 15); /* 2/15 of viewport width, keeping it square */
  border-radius: 20px;
  border: none;
  position: relative;
  display: flex;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
}

.button-label {
  font-family: "Countach";
  font-size: 2.2vw;
  font-weight: bold;
  background-color: #cc0633;
  color: white;
  padding: 3px 5px 3px 30px;
  position: absolute;
  bottom: 20px;
  right: 0px;
  text-align: right;
  z-index: 80;
}
/* --------------------------------------------------------------------------------------------------------------------------------- */

/* Browse Issues Page */
#back {
  max-width: 100%;
  height: auto;
  padding-left: 3rem;
  padding-top: 17px;
}

.issue-page-header {
  display: flex;
  align-items: center; /* aligns them vertically */
  justify-content: space-between; /* spreads them out */
}

.issue-page-header a {
  color: #57545f;
  font-size: 1rem;
  align-self: flex-end; /* align this specific child to the bottom of the container */
  margin-bottom: 10px;
}

 .issue-page-header h1 {
  margin: 5px 0px 20px 0px;
}

.search-container {
  display: flex;
  align-items: center;
  background-color: #ddd;
  border-radius: 20px;
  padding: 8px 16px;
  width: auto;
  margin-top: 10px;
}

.search-icon {
  margin-right: 8px;
  max-width: 1.5em;
  max-height: 1.5em;
}

.search-bar {
  border: none;
  background: transparent;
  width: 100%;
  font-size: clamp(15px, 1.5vw, 24px);
  outline: none;
}

.filters {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
}

.active-filter {
  font-weight: 500;
  font-size: 1rem;
  background-color: #57545f;
  color: white;
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
}

.filter-dropdown {
  font-weight: 500;
  font-size: 1rem;
  background: #dddddd;
  border-radius: 10px;
  border: none;
  outline: 0;
  padding: 8px 6px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.filter-dropdown:hover {
  background-color: #c4c4c4;
}

option {
  background-color: #dddddd;
  padding: 0 10px 0 10px;
  border-radius: 20px;
}
/* --------------------------------------------------------------------------------------------------------------------------------- */

/* Popup styles */
#dark-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.5); /* Sheer black */
  z-index: 999;
  display: none;
}
#dark-account-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background-color: rgba(0, 0, 0, 0.5); /* Sheer black */
  z-index: 999;
  display: none;
}

.popup {
  display: none; /* Initially hidden */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

/* Red bar at the top */
.popup-header {
  display: flex;
  background-color: #a6192e;
  color: white;
  padding: 16px;
  border-top-left-radius: 15px;
  border-top-right-radius: 15px;
  height: 50px;
}
.issue-header {
  display: flex;
  font-size: 2px;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid #AFAFAF;
}

.issue-header strong {
  font-size: 24px;
  font-weight: 600;
}
.issue-header .tags {
  display: flex;
  gap: 10px;
}

.popup-title {
  margin-right: auto;
}

.popup h1 {
  font-size: 24px;
  font-weight: 400;
}

.popup-x {
  margin-left: auto;
  color: white;
  font-size: 60px;
  font-weight: 700;
  cursor: pointer;
  align-self: center;
  padding: 0;
  padding: 0 20px 5px 20px;
}

/* Font weight cannot be transitioned, so this is a workaround to make it bolder on hover */
.popup-x:hover {
  text-shadow:
    -0.5px -0.5px 0 white,
    0.5px -0.5px 0 white,
    -0.5px 0.5px 0 white,
    0.5px 0.5px 0 white;
    -webkit-transition: all .2s;
    -moz-transition: all .2s;
    -o-transition: all .2s;
    transition: all .2s ease-in-out;

}

.popup-content {
  padding: 20px;
  background-color: white;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

.popup textarea {
  display: flex;
  max-width: 99%;
  min-width: 99%;
  border-radius: 5px;
  height: 150px; 
  font-size: 16px;
  border: none; 
  margin-top: 12px;
  font-size: 16px;
}

/* comment out to test margins */
.popup textarea:focus {
  outline: none;
} 


.popup input {
  border: none; 
}

.popup button {
  background-color: #a6192e;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  
}

/* .popup button:hover {
  background-color: #8e1425;
} */

.popup select {
  padding: 10px;
  margin: 10px 0 20px 0;
  border-radius: 10px;
  border: 1px solid #AFAFAF;
  width: 100%;
  background-color: white;
  font-size: 16px;
}

.submit-btn {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  cursor: pointer;
  align-self: flex-end;
  margin-left: auto;
  padding: 0.5em 0.7em;
}

#submit-btn:hover {
  background-color: #8e1425;
  transition: background-color 0.3s ease-in-out;
  stroke-width: 5px;
}

#languageSubmit {
  margin-left: 0;
}


.suggestion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.suggestion strong {
  font-size: 16px;
}

.divider {
  border: none;
  height: 1px;
  background-color: #AFAFAF;
  margin: 10px 0; 
}

/* ------------------------------------------------------------------------------------------------------------------- */

.user-info {
  flex-shrink: 0;
}

.user {
  font-weight:400;
  color: #000000;
  font-size:.9rem;
  text-align: right;
  margin-left: auto;
}
.user-role-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  padding-top: 10px;
}

.tag {
  display: flex;
  justify-content: flex-end;
}
.user-role-tag .user {
  font-weight: 600;
  color: #000000;
  font-size: 0.9rem;
  margin: 0;         
  text-align: left;      
}

.pro-tag {
  background-color: #3B811A; 
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
}
.con-tag {
  background-color: #E08331; 
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
}
.add-tag {
  background-color: #57545F;
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
}

.ongoing-list {
  padding-left: 20px;
  margin-top: 10px;
  margin-bottom: 20px;
  color: #333;
}

.ongoing-list li {
  margin-bottom: 8px;
  font-size: 14px;
}

.close-btn {
  background-color: #a6192e;
  color: white;
  padding: 10px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.close-btn:hover {
  background-color: #8e1425;
}
.anonymous-toggle {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 20px;
  margin-bottom: 0;
  position: relative;
}

.switch-label {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  gap: 10px;
  cursor: pointer;
}

.switch-label input {
  display: none;
}

/* slider */
.slider {
  position: relative;
  width: 40px;
  height: 20px;
  background-color: #ccc;
  border-radius: 34px;
  transition: background-color 0.2s;
}

/* knob inside the slider */
.slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}

/* When checked */
input:checked + .slider {
  background-color: #a6192e;
}

input:checked + .slider::before {
  transform: translateX(20px);
}

/* Rounded slider */
.slider.round {
  border-radius: 34px;
}

.slider.round::before {
  border-radius: 50%;
}


/* --------------------------------------------------------------------------------------------------------------------------------- */

/* Sign in page */
.sign-in-container {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  height: 100vh;
  padding: 20px;
}

.sfu-logo {
  position: absolute;
  top: 20px;
  left: 0;
  width: 200px;
  height: auto;
  box-shadow: 4px 4px 6px rgba(0, 0, 0, 0.5);
}

.sign-in-rectangle {
  background-color: #a6192e;
  width: calc(5.5 * (100vw / 15));
  padding: 30px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  margin-bottom: 20px;
  box-sizing: border-box;
  margin-left: 23px;
}

.sign-in-header {
  font-family: "Barlow", sans-serif;
  font-weight: 600;
  font-size: 2rem;
  color: white;
  margin-bottom: 20px;
}

.input-field {
  width: 95%;
  max-width: 700px;
  padding: 10px;
  margin: 10px 0px;
  margin-bottom: 15px;
  border-radius: 24.5px;
  border: 0;
  font-size: 1rem;
  text-align: left;
  background-color: white;
  outline: 0;
}

.input-label {
  font-family: "Barlow", sans-serif;
  font-weight: 400;
  font-size: 1rem;
  color: white;
  margin-bottom: 5px;
  align-self: flex-start;
  width: 100%;
}

.forgot-password {
  font-family: "Barlow", sans-serif;
  font-size: 0.7rem;
  color: #dddddd;
  text-decoration: underline;
  align-self: flex-start;
  display: block;
  text-align: right;
  width: 98%;
}

.select-dropdown {
  font-family: "Barlow", sans-serif;
  font-weight: 500;
  font-size: 1rem;
  background: #dddddd;
  border-radius: 10px;
  border: none;
  outline: 0;
  display: block;
  padding: 4px 6px;
  margin-top: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.select-dropdown:hover {
  background-color: #c4c4c4;
}

.sign-in-btn {
  width: 80%;
  max-width: 350px;
  padding: 15px;
  background-color: white;
  color: black;
  border: 2px solid #57545f;
  border-radius: 24.5px;
  text-align: center;
  font-size: 20px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin-top: 20px;
  align-self: center;
  text-decoration: none;
}

.sign-in-btn:hover {
  background-color: #a6192e;
  color: white;
}

/* --------------------------------------------------------------------------------------------------------------------------------- */

/* Media Queries */
@media (max-width: 600px) {
  /*Mobile text styles*/
  h1 {
    font-family: "Barlow", sans-serif;
    font-weight: 500;
    font-size: 30px;
  }

  h2 {
    font-family: "Barlow", sans-serif;
    font-weight: 600;
    font-size: 20px;
  }

  h3 {
    font-family: "Barlow", sans-serif;
    font-weight: 500;
    font-size: 26px;
  }

  p {
    font-family: "Barlow", sans-serif;
    font-weight: 400;
    font-size: 13px;
  }
}

@media (max-width: 600px) {
  .plus-button {
    bottom: 15px;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  .plus-button:active {
    transform: translate(-50%, -50%) scale(0.95);
  }

  .plus-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
  }

  .columns > .issues {
    order: 2;
  }

  #gradient {
    height: 140px;
  }

  .popup {
    width: 95%;
  }

  .popup-title {
    font-size: 18px;
    align-self: center;
  }

  .popup input,
  .popup textarea {
    font-size: 14px;
  }

  .submit-btn {
    font-size: 14px;
  }

  .popup-x {
    font-size: 40px;
  }

  .sign-in-rectangle {
    width: calc(100% - 46px);
    padding: 20px;
  }

  .sign-in-btn {
    font-size: 16px;
    width: 80%;
  }

  .input-label {
    font-size: 14px;
  }

  .input-field {
    font-size: 14px;
  }
}

@media (max-width: 900px) {
  #back {
    width: 7%;
    height: auto;
    padding-left: 0rem;
    margin-left: 23px;
  } 

  .home {
    margin-top: 80px;
    transition: margin-left 0.3s;
  }

  .columns {
    display: flex;
    flex-direction: column;
  }

  .square-button {
    width: calc(50vw);
    height: calc(30vw);
    border-radius: 20px;
    border: none;
    position: relative;
    display: flex;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    background-color: darkgray;
  }

  .button-label {
    font-size: 6vw;
    padding: 3px 5px 3px 30px;
    position: absolute;
    bottom: 20px;
    right: 0px;
    text-align: right;
  }

  .resource-menu {
    display: flex;
    flex-direction: column;
  }

  .allresources {
    display: flex;
    flex-direction: row;
    gap: 3vw;
    overflow-x: scroll;
    scroll-behavior: smooth;
    cursor: grab;
    overflow-y: hidden;
  }

 .allresources.dragging {
  cursor: grabbing;
  user-select: none;
}

.allresources::-webkit-scrollbar {
  display: none;
} 

.resources {
  flex: 0 0 auto; /* Prevent shrinking, keeps cards side by side */
  scroll-snap-align: center;
}

#advising {
  margin-left: -30vw;
}

  .home > .columns > .allresources {
    order: 1;
  }

  .home .columns .issues {
    order: 2;
  }

  .columns {
    margin: 8px 23px 150px 23px;
  }

  #browse {
    margin: 100px 0px 150px 0px;
  }
}


