// dark themed
$base-color-fg: #fff;
$base-color-bg: #222;
$base-color-black: #000;

$theme-color-primary: #00f8a5;
$theme-color-secondary: #44b0ff;
$theme-color-tertiary: #fe7abf;


html,
body,
div,
h1,
h2,
h3,
p,
header,
ul,
li,
table,
menu {
    margin: 0;
    padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* BODY */
body {
  min-height: 100vh;
  position: relative;
  padding: 0px;
  font-family: "Roboto", sans-serif;
  background-image: url('{{ "images/django-cake.png" | relURL }}');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top;
  background-attachment: fixed;
  background-color: $base-color-bg;

  &.landing_page {
    background-image: none;
  }
}

/* CONTENT FOR ALL PAGES */
.container {
    margin: 0 auto;
    @media only screen and (min-width: 800px) {
        min-width: 800px;
        max-width: 1200px;
    }

    @media only screen and (max-width: 800px) {
        width: auto;
    }

    article {
      padding: 0 20px;
      img {
          display: block;
          width: 100%;
      }
    }
}

/* HEADER WITH LOGO AND NAVIGATION */
header {
  width: 100%;
  height: 100%;
  color: $base-color-fg;

  a, a:visited, a:active {
    // text-shadow: $base-color-black 1px 0 2px;
    font-weight: bold;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
  }

  a:hover, a:focus {
    color: $base-color-fg;
  }

  .nav-container {
    background-color: $theme-color-primary;
    margin-top: 50px;
    border-width: 5px 0;
    border-color: $base-color-black;
    border-style: solid;
    padding: 10px;

    @media only screen and (min-width: 800px) {
      margin-top: 100px;
      padding: 20px;
    }
  }

  .logo-and-nav {
    display: flex;
    align-items: center;
    width: 100%;
    column-gap: 20px;
    font-size: 1.3em;

    @media only screen and (min-width: 800px) {
      column-gap: 20px;
      font-size: 1.8em;
    }

    .logo {
      margin: -70px 0;
    }
  }

  .main-nav {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    width: 100%;
    column-gap: 25px;
    align-items: center;
  }

  .logo {
    img {
      display: block;
      width: 100px;
      margin-right: -10px;

      @media screen and (min-width: 800px) {
        width: 150px;
        margin-right: -20px; // This is empty space in the image
      }
    }
  }

  #check {
    display: none;
  }

  .icons {
    position: absolute;
    right: 5%;
    font-size: 2.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    display: none;

    svg {
      width: 0.6em;
      height: 0.6em;
      color: $base-color-black;
    }
  }
}

/* BREAKPOINTS FOR NAVIGATION */
$menu-links: {{ len .Site.Menus.main }};
@media only screen and (max-width: #{($menu-links * 100) + 200}px) { // Adjust breakpoint based on number of links
  #check:checked~.icons #menu-icon {
    display: none;
  }

  label.icons {
    display: inline-flex;
    align-items: center;

    #close-icon {
      display: none;
    }
  }

  #check:checked~.icons #close-icon {
    display: block;
    margin-top: 0.3rem;
    margin-left: 0.2rem;

  }

  .logo-and-nav {
    height: 20px;

    .logo {
      z-index: 10001;
    }
  }

  header .main-nav {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    flex-direction: column;
    column-gap: 0;
    height: 0;
    z-index: 1000;
    background-color: $theme-color-primary;
    overflow: hidden;
    box-shadow: 0 0.5rem rgba(0, 0, 0, 0.5);
  }

  $nav-height: 2rem + ($menu-links * 2rem);
  #check:checked~.main-nav {
    height: #{$nav-height}; // Adjust height based on number of links
    padding: 0.5rem 0;
  }

  @for $i from 0 through 5 {
    .delay-#{$i} {
      --i: #{$i};
    }
  }

  .main-nav a {
      display: block;
      margin: 0.5rem 0;
      text-align: center;
      transform: translateY(-50px);
      transition: 0.4s ease;
      opacity: 0;
  }

  #check:checked~.main-nav a {
    transform: translateY(0);
    opacity: 1;
    transition-delay: calc(0.15s * var(--i));
  }
}

/* LANDING PAGE SECTION */
.landing-page {
  width: 100%;
  background-color: $base-color-bg;
  display: flex;
  justify-content: center;

  .row {
    width: 100%;
    margin: 2.5rem 3rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;

    .happy-birthday {
      width: 45%;

      h1 {
        color: $base-color-fg;
        font-size: 3.5rem;
        margin: 0;
      }
    }

    .cake {
      width: 55%;
      img {
        width: 100%;
      }
    }

    @media screen and (max-width: 800px) {
      flex-direction: column;
      align-items: center;
      justify-content: center;
      margin: 2rem 1.5rem;

      .happy-birthday {
        text-align: center;
        width: 100%;
        margin-top: 2rem;

        h1 {
          font-size: 2.8rem;
        }
      }

      .cake {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 2rem;

        img {
          width: 75%;
          margin: 0 auto;
        }
      }
    }

    @media screen and (max-width: 550px) {
      .happy-birthday {
        h1 {
          font-size: 2.2rem;
        }
      }

      .cake {
        img {
          width: 90%;
        }
      }
    }
  }
}

/* HERO SECTION */
.hero {
  color: $base-color-fg;
  margin: 40px 0;
  padding: 40px;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 5px;

  @media only screen and (max-width: 1200px) {
      margin: 0 0;
  }

  h1 {
    font-size: 2.2em;
    margin: 20px 0;

    @media only screen and (min-width: 800px) {
      font-size: 3.5em;
    }
  }

  p.subtitle {
    font-size: 1.5em;
    margin-bottom: 30px;

    @media only screen and (min-width: 800px) {
      font-size: 2.5em;
      margin-bottom: 40px;
    }
  }

  p.subsubtitle {
    font-size: 1.2em;
    margin-bottom: 30px;

    @media only screen and (min-width: 800px) {
      font-size: 2em;
      margin-bottom: 40px;
    }
  }

  a, a:visited, a:active {
    color: #FFF;
  }
}

section {
  background-color: $theme-color-primary;
  border-width: 5px 0 5px 0;
  border-color: #000;
  border-style: solid;
  margin-bottom: 20px;
}

section.events {
  background-color: $theme-color-secondary;
  border-width: 5px 0 5px 0;
  border-color: #000;
  border-style: solid;
}

section.map {
  background: rgba(0, 0, 0, 0.8);
  border-width: 5px 0 5px 0;
  border-color: #000;
  border-style: solid;
  article {
    color: #fff;
  }

  #map {
    max-width: 1400px;
    margin: 0 auto;
  }

  @media only screen and (max-width: 800px) {
      width: auto;
  }
}

section.timeline {
	background:
		radial-gradient(farthest-side at top right, #222 98%, #0000)
			calc(50% - 10px) 0/20px 20px no-repeat,
		radial-gradient(farthest-side at bottom right, #222 98%, #0000)
			calc(50% - 10px) 100%/20px 20px no-repeat,
		linear-gradient(90deg, $theme-color-tertiary 50%, $theme-color-secondary 0);
  ul {
	  list-style: none;
	  padding: 0;
	  margin: 0;
	  display: grid;
	  grid-template-columns: repeat(3, 30%);
	  justify-content: center;
  }
  li {
    font-size: 24px;
    padding: 20px;
	  grid-column: span 2;
	  border-radius: 65px;
	  color: #fff;
	  position: relative;
	  /* NB! #0000 means transparent */
	  border: 20px solid #0000;
	  background: linear-gradient(#222 0 0) content-box,
		  linear-gradient(var(--c, $theme-color-tertiary) 0 0) padding-box,
		  linear-gradient(var(--d, 90deg), #0000 75%, #222 0) border-box;
	  margin: 0px;
	  p {
	    padding: 20px;
	    a, a:visited, a:active {
	      color: #FFF;
	    }
      code {
        background: lighten(#000, 20%);
        border: 1px solid lighten(#000, 50%);
        padding: 1px 3px;
        font-size: 80%;
        font-family: monospace;
      }
	  }
    img {
      display: block;
      max-width: 100%;
    }
    &.release p {
      font-size: 80%;
      padding: 10px 20px;
    }

	  blockquote {
	    font-style: italic;
	    padding-right: 30px;
	    position: relative;
	  }
    blockquote:before {
      position: absolute;
      content: open-quote;
      font-size: 2em;
      margin-left: -0.6em;
      margin-top: -0.4em;
    }
    blockquote:after {
      position: absolute;
      content: close-quote;
      font-size: 2em;
      bottom: 0;
      right: 0;
      margin-right: 0em;
      margin-bottom: -1em;
    }
	  iframe {
	    width: 100%;
	    min-height: 300px;;
	  }
  }
  li:nth-child(even) {
	  grid-column-end: -1;
	  --d: -90deg;
	  --c: #44b0ff;
  }
  li:not(:last-child) {
	  margin-bottom: -20px;
  }
  li:before,
  li:after {
	  content: "";
	  padding: 0;
	  display: block;
	  height: 0.6em;
  }

  time {
	  position: absolute;
	  left: calc(100% + 50px);
	  top: 50%;
	  transform: translateY(-50%);
	  white-space: nowrap;
	  background: rgba(0,0,0,0.5);
	  border-radius: 5px;
	  border: 2px solid rgba(0,0,0,0.5);
	  padding: 4px;
  }
  li:nth-child(even) time {
	  left: auto;
	  right: calc(100% + 50px);
  }
  time:before {
	  content: "";
	  position: absolute;
	  height: 10px;
	  top: calc(50% - 5px);
	  right: calc(100% + 5px);
	  width: 65px;
	  background: repeating-linear-gradient(-90deg, #fff 0 5px, #0000 0 10px) 50%/100%
		  2px no-repeat;
  }
  li:nth-child(even) time:before {
	  right: auto;
	  left: calc(100% + 5px);
	  background: repeating-linear-gradient(90deg, #fff 0 5px, #0000 0 10px) 50%/100%
		  2px no-repeat;
  }

}


article {

  margin: 30px 0;
  font-size: 1em;

  @media only screen and (min-width: 800px) {
      margin: 40px 0;
      font-size: 1.5em;
    }

  h1 {
    font-size: 1.3em;
    margin: 20px 0;

    @media only screen and (min-width: 800px) {
      font-size: 2em;
      margin: 20px 0;
    }
  }

  h2 {
    font-size: 1.5em;
    margin: 20px 0;

    @media only screen and (min-width: 800px) {
      font-size: 2em;
      margin: 20px 0;
    }
  }

  p {
    max-width: 800px;
    line-height: 150%;
    margin: 20px 0;
  }

  ul {
    margin: 20px 0;
    padding-left: 40px;
  }

  img.icon {
    width: 50px;
    display: inline-block;
    margin-right: 10px;
    margin-bottom: -20px;
  }

  a, a:active, a:visited {
    color: darken($theme-color-secondary, 20%);
  }

}

footer {

  margin-top: 300px;
  color: $base-color-fg;
  background: rgba(0, 0, 0, 0.8);
  font-size: 1em;

  &.landing_page {
    // It has no background image, so no margin needed
    margin-top: 0px;
  }


  @media screen and (min-width: 800px) {
    margin-top: 500px;
    font-size: 1.4em;
    &.landing_page {
      // It has no background image, so no margin needed
      margin-top: 0px;
    }
  }

  h5 {
    text-transform: uppercase;
    font-size: 1.2em;
  }

  a {
    color: $base-color-fg;
  }

  p {
    margin-bottom: 20px;
    line-height: 150%;
  }

  p.minor {
    font-size: 0.8em;
    color: #ccc;
  }

  .footer-columns {
    padding: 40px;
    display: flex;
    flex-wrap: wrap;
    flex-flow: row;
    //width: 100%;
    column-gap: 50px;
    align-items: center;
    align-content: space-between;

    .footer-column {
      width: 33%;
      p {
        font-size: 90%;
      }
    }

    .credits {
      text-align: right;
    }

    .logo {
      img {
        display: block;
        width: 100%;
      }
    }
  }

  @media only screen and (max-width: 800px) {
    .footer-columns {
      display: block;
      padding: 0;
      column-gap: 0;

      .logo {
        img {
          display: inline-block;
          width: 50%;
        }
      }

      .footer-column {
        margin-top: 20px;
        width: auto;
        text-align: center;
        padding: 0.5rem;
      }
    }
  }
}

section.events {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-color: $theme-color-secondary;
  padding-bottom: 3rem;

  .table {
    width: 80vw;
    height: 100%;
    background-color: #fff5;
    backdrop-filter: blur(7px);
    border-radius: 0.8rem;
    margin-top: 2rem;
    overflow: hidden;

    @media screen and (max-width: 1200px) {
      width: 90vw;
    }

    &__header {
      background-color: #fff4;
      backdrop-filter: blur(7px);
      border: none;
      width: 100%;
      height: 15%;
      padding: 0.8rem 1rem;

      .event-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        margin-right: 2rem;

        &:hover {
          color: $base-color-fg;
        }

        h2 {
          margin: 1rem 1rem 0.5rem 0;
        }

        svg {
          width: 32px;
          height: 32px;
          transition: transform 0.3s ease;
        }
      }
    }

    &__body {
      width: 95%;
      max-height: calc(90% - 0.8rem);
      background-color: #fffb;
      margin: 0.8rem auto;
      border-radius: 0.6rem;
      border: none;
      overflow: auto;

      &::-webkit-scrollbar {
        width: 0.5rem;
        height: 0.5rem;
      }

      &::-webkit-scrollbar-thumb {
        border-radius: 0.5rem;
        background-color: #0004;
        visibility: hidden;
      }

      &:hover::-webkit-scrollbar-thumb {
        visibility: visible;
      }

      table, th, td {
        border-collapse: collapse;
        padding: .5rem;
        text-align: left;

        @media screen and (min-width: 800px) {
          padding: 1rem;
        }
      }

      table {
        width: 100%;
      }

      thead {
        border-bottom: solid 2px #0004;

        th {
          position: sticky;
          top: 0;
          left: 0;
          background-color: #cbecfffe;
        }
      }

      tbody tr {
        &:nth-child(even) {
          background-color: #0000000b;
        }

        &:hover {
          background-color: #fff6;
        }
      }

      .event-link {
        width: 30%;

        svg {
        width: 18px;
        height: 18px;
        margin-bottom: .4rem;
        vertical-align: middle;
        color: #005935;

          @media screen and (min-width: 800px) {
            width: 24px;
            height: 24px;
            margin-right: .5rem;
            vertical-align: middle;
          }
        }

        a {
          text-decoration: none;
          font-weight: 600;
          color: #005935;
        }
      }

      .event-link:hover {
        svg, a {
          color: #00f8a5;
        }
      }

      .event-location {
        width: 20%;
      }

      .event-date {
        width: 20%;
      }

      .event-category {
        padding: 0.4rem;
        border-radius: 2rem;
        text-align: center;

        &.conference {
          background-color: #00f8a5;
          color: #005935;
        }

        &.meetup {
          background-color: #005935;
          color: #00f8a5;
        }

        &.sprint {
          background-color: #b57edc;
          color: #3b1f54;
        }

        &.other {
          background-color: #222222;
          color: #fafcfb;
        }
      }

      .event-host {
        width: 20%;
        font-weight: 600;
        color: #3b1f54;
      }

      @media screen and (max-width: 1200px) {
        td:first-of-type {
          min-width: 12rem;
        }
      }
    }
  }

  .event-dropdown {
    input {
      display: none;
    }

    input:not(:checked) ~ .dropdown-content {
      display: none;
    }

    input:checked ~ .dropdown-content {
      display: block;
    }

    // Arrow rotation
    label svg {
      transition: transform 0.3s ease;
    }

    // Rotate arrow based on checked state
    input:checked + section label svg {
      transform: rotate(180deg);
    }

    input:not(:checked) + section label svg {
      transform: rotate(0deg);
    }
  }
}

// TODO: Properly integrate this CSS into the SASS + theme

:root {
	--color-django-dark: darken(#00f8a5, 0.8);
	--color-django-accent: #00f8a5;
	--color-white: #fff;
	--color-bg-light: #f8f9fa;
	--header-height: 120px;
	--spacing-lg: 2rem;
	--spacing-sm: 1.2rem;
}

#map {
	width: 100%;
	height: 70vh;
	min-height: 350px;
}
