@import url("https://use.typekit.net/pnq5gyb.css");

:root{
  --bg: #F8F3EF;
  --card: #F2EBE5;
  --text: #111;
  --muted: #7b7b7b;
  --border: #d0d0d0;

  /* tight spacing */
  --pad: clamp(3px, 0.25vw, 4px);
  --gap: clamp(2px, 0.22vw, 3px);

  --inset: clamp(4px, 0.5vw, 8px);
  --chart-scale: 1;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }


body{
  margin: 0;
  background: var(--bg);
  font-family: "effra", sans-serif;
  color: var(--text);
}
html, body {
  height: auto !important;
  overflow: visible !important;
}

img, video, iframe {
  max-width: 100%;
}
.page{
  /* height: 100%; */
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--gap);
  padding: var(--pad);
  padding-top: 20px; 
    margin-left: 20px;
    margin-right: 20px;
}
a{
  color:#7d7d7d;
  cursor: pointer;
}
/* Header */
.header{
  display: grid;
  gap: calc(var(--gap) * 0.7);
}

.page-title{
  margin: 0;
  font-size: clamp(20px, 2.0vw, 32px);
  font-weight: 600;
  line-height: 1.05;
}
.source{
    display: flex;
    margin-bottom: 5;
  z-index:3;
}
.source p{
    font-size:1em;
    text-align: left;
    color:#7d7d7d;
    font-weight: 400;
}
#loader-wrapper {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #ffffff;
    display: -webkit-box; 
    display: -ms-flexbox; 
    display: flex;        
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4D45FF;
    border-radius: 50%;
    -webkit-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;
}

@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.headerRow{
  display: flex;
 align-items: anchor-center;
  width: 100%;
  gap: var(--gap);
}

.filterRow{
  width: clamp(220px, 20vw, 300px);
}

.countrySelect{
  margin-top:5%;
  margin-bottom:5%;
  width: 100%;
  height: clamp(45px, 5vh, 50px);
  border-radius: 50px;
  border: 1px solid #4D45FF;
  background: #fff;
  color: #000000;
  font-size: clamp(13px, 0.95vw, 15px);
  padding: 0 36px 0 12px;
  appearance: none;
  font-family: "effra", sans-serif;
  height: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%234D45FF' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-size: 22px;
  background-position: right 10px center;
  background-repeat: no-repeat;
}

.btn{
  margin-left: auto;
  height: clamp(24px, 2.5vh, 29px);
  padding: 0 12px;
  border-radius: 50px;
  border: 1px solid var(--border);
  background: #fff;
  color: #4b4b4b;
  font-family: "effra", sans-serif;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover{ opacity: 0.92; }

/* Dashboard layout */
.dashboard{
  min-height: 0;
  height: 100%;
  display: grid;

  /* LHS wider */
  grid-template-columns: 38% 62%;

  /* top row 65%, bottom row 35% */
  grid-template-rows: 0.65fr 0.35fr;

  gap: var(--gap);
}

/* Cards */
.card{
  background: var(--card);
  border-radius: 14px;
  /* overflow: hidden;
  min-height: 0; */
}

.card-tight{
  padding: var(--inset);
}

.chart{
  width: 100%;
  height: 100%;
  min-height: 0;

  transform: scale(var(--chart-scale));
  transform-origin: top left;
  width: calc(100% / var(--chart-scale));
  height: calc(100% / var(--chart-scale));
}

/* LEFT media spans both rows */
.card-map{
  grid-column: 1;
  grid-row: 1 / span 2;
  padding: var(--inset);
  min-height: 0;
}

/* Video wrapper */
.mediaWrap{
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}

/* MP4 fills the box cleanly */
.timelapseVideo{
  width: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 10px;
}
/*Video slider*/
.video-controls-container {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  background: white;
}

.slider-wrapper {
  display: flex;
  align-items: center;
  flex-grow: 1;
  gap: 10px;
 
}

.video-slider {
  flex-grow: 1;
  appearance: none;
  height: 4px; 
background: #bababa;
    border-radius: 20px;
      outline: none;
  padding: 0;
}
.slider-container{

    position: absolute;
    top: 6px;
    right: 10%;

}

.video-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: #4D45FF; 
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white; 
  
}

.bar-label {
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  white-space: nowrap;
  font-size: 14px;
}
/* Play/pause overlay */
.gifToggle{
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.65);
  background: #4D45FF;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(4px);
}
.gifToggle:hover{ 
  background: #000000; 
    border: 1px solid #4D45FF;

}

/* Right-top contains 2 charts */
.rightTop{
  grid-column: 2;
  grid-row: 1;
  /* min-height: 0; */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

/* AFIR bottom-right */
.card-afir{
  grid-column: 2;
  grid-row: 2;
}

.dashboard p{
  font-family: "Roboto", sans-serif;
}

/* Scale charts down on smaller screens */
@media (max-width: 1400px){
  :root{ --chart-scale: 0.95; }
}
@media (max-width: 1200px){
  :root{ --chart-scale: 0.90; }
}

/* Small screens: allow scroll + stack */
@media (max-width: 1100px){
  body{ overflow: auto; }
  .page{ height: auto; }

  .headerRow{
    flex-direction: column;
    align-items: stretch;
  }

  .btn{
    margin-left: 0;
    height: 40px;
  }

  .countrySelect{
    height: 44px;
  }

  .dashboard{
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .card-map{
    grid-column: auto;
    grid-row: auto;
    min-height: 420px;
  }

  .rightTop{
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: 1fr;
  }

  .card-afir{
    grid-column: auto;
    grid-row: auto;
    min-height: 420px;
  }

  .filterRow{
    width: 100%;
    max-width: 420px;
  }
}
@media (max-width: 800px){

.btn{
  width: 45%;
}
}
