
@import url('utilAndVariables.css');
@import url('nav.css');
@import url('keyFrames.css');

body {
  background: var(--main-color-darker);
  overflow: hidden;
}

/* Main container */
.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 85vh;
  transition: padding ease-in .2s;
  background: var(--main-color-darker); 
  margin: 0 auto;
}

/* Main content - Markets*/
#markets {
  margin: auto;
  padding: 1rem;
  display: grid;
  justify-content: center;
  align-items: center;
  gap: 5px;
  /* grid-template-columns: repeat( auto-fit, minmax(35rem, 1fr) ); */
  grid-template-areas:
"grid-one grid-two grid-three"
"grid-four grid-five grid-six";
}

.grid-1 {
grid-area: grid-one;
animation: floatUp 1s;
}

.grid-2 {
grid-area: grid-two;
animation: floatUp 1.3s;
}

.grid-3 {
grid-area: grid-three;
animation: floatUp 1.6s;
}

.grid-4 {
grid-area: grid-four;
animation: floatUp 1s;
}

.grid-5 {
grid-area: grid-five;
animation: floatUp 1.3s;
}

.grid-6 {
grid-area: grid-six;
animation: floatUp 1.6s;
}

#markets .wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}

.inital-border {
  border: 1px dotted var(--main-color-dark);
}

/* Color themes based on trading hours*/
.openForTrading {
  background: var(--color-open);
  color: var(--main-color-light);
  border: var(--main-color-light) var(--border-thin);
}

.closedForTrading {
  background: var(--color-closed);
  color: var(--main-color-darker);
  border: var(--color-stand-out-transparent) var(--border-thin);
}

.halfDayTrading {
  background: var(--color-half-day);
  color: var(--main-color-light);
  border: var(--main-color-light) var(--border-thin);
}


/* General style inside market wrappers*/
#markets .h1 {
  font-size: 2rem;
  white-space: nowrap;
  font-weight: 900;
  text-transform: capitalize;
  /* box-shadow: 1px 1px 5px; */
}

#markets .open{
  font-size: 1.2rem;
  padding: .5rem 0;
  /* border-top: 1px dotted; */
}

#markets .open span:nth-child(2),
#markets .counter span:nth-child(2){
  padding-left: .25rem;
}

#markets .counter {
  font-size: 1.2rem;
  padding-bottom: .25rem;
  border-bottom: 1px dotted;
}

#markets .counter span:nth-child(2) {
  padding-left: .5rem;
  letter-spacing: 1px;
}

#markets .time {
  padding: 1rem .5rem;
  font-size: 4rem;
  /* box-shadow: 1px 1px 5px; */
}

#markets .info-btn {
  /* position: absolute;
  bottom: .25rem;
  right: .25rem; */
  padding: .5rem .5rem;
  font-size: .8rem;
  text-align: center;
  border: 1px dotted;
  /* border-radius: 50%; */
  transition: all .3s ease-in-out;
}

/* For hiding i tags on inital load*/
a {
  color: var(--main-color-darker);
}

.info-btn:hover {
  cursor: pointer;
  box-shadow: 2px 2px 5px;
}

.openMarketBtn {
  color: rgb(240, 240, 240);
  background:rgb(40, 184, 90);
}

.openMarketBtn:hover {
  color: var(--main-color-light);
  background:rgb(55, 223, 113);
}

.closedMarketBtn {
  color: rgba(12, 12, 12, .7);
  color: rgb(1, 13, 26);
  border: 1px solid transparent;
  background: rgb(202, 69, 66);
}


.closedMarketBtn:hover {
  color: var(--main-color-darker);
  background: rgb(230, 85, 83);
}

.halfDayMarketBtn {
  color: rgb(240, 240, 240);
  background: rgb(241, 176, 91);
}

.halfDayMarketBtn:hover {
  color: var(--main-color-light);
  background: rgb(250, 191, 113);
}

#markets .fa-info-circle {
  font-size: 1.5rem;
}

/* Modal window pop up on info btn click*/
#markets .modal {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow-y: hidden;
  z-index: 999;
  background: rgba(0,0,0,.8);
  animation: fadeIn .3s;
  color: rgb(1, 13, 26);
}

/* Info square when modal is open*/
.modal .info {
  position: relative;
  background-color: #ececec;
  padding: 2.5rem;
  width: 45rem;
  max-width: 90vw;

  letter-spacing: 1px;
}

.modal h3 {
  font-size: 2rem;
  padding: 1rem 0;
  font-weight: 900;
  text-decoration: underline;
}

.modal .info span {
  display: block;
  color: rgb(1, 13, 26);
  background:#c8c8c871;
}

/* No trading - Half day*/
.modal .info span:nth-child(odd) {
  font-weight: bold;
  padding: 1rem 0 .25rem 0;
  border-bottom: none;
}

/* Date specifics*/
.modal .info span:nth-child(even) {
  padding: .25rem 1rem .25rem 1rem;
  line-height: 1;
}

.modal .info p {
  padding: .5rem;
  font-size: 1rem;
}

.modal .info p span:nth-child(even) {
  padding-bottom: 1rem;
  border-top: none;
}

.modal .close {
  position: absolute;
  top: 0;
  right: .5rem;
  color: var(--main-color-dark);
  font-size: 2rem;
  font-weight: bold;
}

.modal .close:hover,
.modal .close:focus {
  cursor: pointer;
  color: var(--color-closed);
}


/* Media queries*/
/* tablets landscape*/
@media(max-width: 1024px) {
  
  #main-nav ul {
    padding-top: 2rem;
  }

  #markets {
    padding: 1rem 2rem;
  }

  .region-wrapper a {
    padding: 2.5rem;
  }

  .modal .info {
    margin: 15% auto;
  }
}

@media(max-height: 500px) {
  #markets .h1 {
    font-size: 1.5rem;
  }

  .modal .info {
    margin: 0 auto;
  }
}

/* Tablets portrait - mobile landscape*/ 
@media(max-width : 850px) {
  #markets {
    grid-template-areas:
    "grid-one grid-two"
    "grid-three grid-four"
    "grid-five grid-six" 
  }

  .grid-1 {
    grid-area: grid-one;
    animation: fadeIn 1s;
    }
    
    .grid-2 {
    grid-area: grid-two;
    animation: fadeIn 1.3s;
    }
    
    .grid-3 {
    grid-area: grid-three;
    animation: fadeIn 1.3s;
    }
    
    .grid-4 {
    grid-area: grid-four;
    animation: fadeIn 1.6s;
    }
    
    .grid-5 {
    grid-area: grid-five;
    animation: fadeIn 1.3s;
    }
    
    .grid-6 {
    grid-area: grid-six;
    animation: fadeIn 1.6s;
    }
}

@media(max-height : 500px) {
  #markets .modal {
    overflow-y: auto;
  }

  .modal .close {
    position: absolute;
    top: 7rem;
  }
}

/* Mobile*/
@media(max-width : 500px){

  body {
    overflow-x: hidden;
  }

  .landing-content {
    flex-direction: column;
  }

  .landing-content .wrapper {
    flex: 1;
    padding: 4rem .5rem;
    text-align: center;
    border: none;
    border-top: var(--border-thin) var(--color-stand-out-transparent);
    z-index: 1;
  }

  .landing-content .wrapper:first-child{
    border-top: none;
  }

  #markets {
    margin-top: 5rem;
    grid-template-areas:
  "grid-one"
  "grid-two"
  "grid-three"
  "grid-four"
  "grid-five" 
  "grid-six";
  }

  #markets .wrapper {
    padding: 1rem 3rem;
  }

  #regions {
    flex-direction: column;
  }

  .region-wrapper {
    width: 100%;
  }

  .region-wrapper:first-child {
    border-top: none;
  }

  .region-wrapper a {
    padding: 5rem;
  }

  .modal .info {
    margin: 25% auto;
  }


}

/* Big screens*/
@media(min-width: 1950px){


  #markets .h1 {
    font-size: 3rem;
  }

  #markets .counter,
  #markets .open {
    font-size: 2;
  }

  #markets .time {
    font-size: 5rem;
  }
  
  #markets .info-btn {
    font-size: 1rem;
  }
}

