/* =========== Dashboard =========== */

/* Import */
@import url("styles.css");

/* Headline */
.headline {
  margin: 48px 0 16px 0;
}
.headline .content {
  align-items: center;
  justify-content: space-between;
}
.headline-left,
.headline-right,
.refresh {
  display: flex;
  align-items: center;
}
.refresh {
  margin-left: 32px;
}
.refresh img {
  animation: spin 2s linear infinite;
  animation-timing-function: ease;
}
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* Dashboard settings */
.settings .content {
  align-items: center;
  justify-content: space-between;
  height: 96px;
  box-shadow: 0px -1px 0px #e0e0e0;
}

.settings-left,
.settings-right {
  display: flex;
}
.settings-left select {
  width: 255px;
}
.project {
  position: relative;
}
.project select {
  padding-left: 42px;
}
.project img {
  position: absolute;
  left: 16px;
  top: 16px;
}

/* Categories of visits */
.categories {
  background-color: #e7f6ff;
}
.categories .content {
  height: 169px;
  align-items: center;
  justify-content: space-between;
}
.category {
  width: 255px;
  box-shadow: 1px 0px 0px #b1e2ff;
  padding-right: 24px;
}
.category:last-child {
  box-shadow: none;
}
.category-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dynamics {
  display: inline-block;
  height: 24px;
  padding: 2px 7px 0 19px;
  border: 1px solid #121212;
  border-radius: 12px;
}
.positive {
  background: url(../img/positive.svg) left 7px center no-repeat;
}
.negative {
  background: url(../img/negative.svg) left 7px center no-repeat;
}
.stability {
  background: url(../img/stability.svg) left 7px center no-repeat;
  padding: 0 11px;
}

/* Graph */
.graph {
  background: linear-gradient(180deg, #e7f6ff 64px, #ffffff 0px);
}

.graph .content {
  height: 420px;
  background-color: #ffffff;
  padding: 64px 95px;
  justify-content: space-between;
}

.graph-wrap {
  width: 635px;
  height: 292px;
}

.graph-dynamics {
  position: relative;
  width: 255px;
  height: 292px;
  padding-top: 30px;
}

.graph-dynamics img {
  position: absolute;
  top: 0;
  left: 97px;
}
.graph-dynamics-content {
  height: 262px;
  padding-top: 54px;
  text-align: center;
}

/* Sources and countries */
.metrics-one {
  margin: 32px 0;
}
.metrics-one .content {
  justify-content: space-between;
  border: 1px solid #e0e0e0;
  padding: 64px 95px;
}
.sources {
  width: 540px;
}
.metrics-headline {
  display: flex;
  align-items: center;
}

.sources-countries-data {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  border-radius: 20px;
  padding: 0 24px;
}

.sources-countries-item {
  position: relative;
  width: 100%;
  height: 40px;
  border-radius: 20px;
  padding: 0px 8px 0px 12px;
  background-color: #ffffff;
}

.sources-countries-item-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 40px;
}

.percent-line {
  position: absolute;
  height: 1px;
  top: 0;
  left: 0;
  border-left: 12px solid #ffffff;
  border-right: 8px solid #ffffff;
  background-color: #b1e2ff;
}

.sources-countries-item span {
  display: flex;
  align-items: center;
}
.sources-countries-item img:first-child {
  margin-right: 12px;
}
.sources-countries-item a {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl;
  text-align: left;
}
.item-percent {
  height: 24px;
  border-radius: 12px;
  padding: 0 8px;
}
.countries {
  width: 350px;
}
.view-all-icon {
  width: 16px;
  height: 16px;
  border: 1px solid #b1e2ff;
  border-radius: 50%;
  margin-right: 12px;
}
.view-all:hover .view-all-icon {
  border: 1px solid #121212;
}
.view-all:hover .view-all-text {
  color: #147efb;
}

/* Devices, platforms, browsers and Ad */
.metrics-two {
  margin-bottom: 32px;
}
.metrics-two .content {
  padding: 64px 95px;
  justify-content: space-between;
  align-items: flex-end;
}
.metrics-two-graph-wrap {
  width: 96px;
  height: 96px;
}
.metrics-two-item {
  width: 160px;
}
.metrics-two-data {
  padding: 32px;
  margin-top: 16px;
}
.metrics-two-data .caption {
  flex: 1;
}
.graph-dot {
  display: flex;
  align-items: center;
}
.graph-dot-ellipse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.graph-dot .caption-strong {
  display: none;
}
.da,
.da img {
  width: 350px;
  height: 284px;
}
.da img {
  object-fit: cover;
  object-position: 0 100%;
}

/* Languages, screens and time */
.metrics-three .content {
  padding: 64px 95px;
  margin-bottom: 32px;
  justify-content: space-between;
}
.metrics-three-item {
  width: 350px;
}
.metrics-three-data {
  margin-top: 16px;
}
.languages-screens-group {
  display: flex;
  width: 730px;
  justify-content: space-between;
}

.metrics-three-data-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 24px;
}

.metrics-three-data-content,
.metrics-three-data-content dashboard-nodata {
  height: 280px;
  padding: 0 24px;
}
.metrics-three-data-content-day {
  padding: 32px;
}

.metrics-three-data-content-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  box-shadow: 0px 1px 0px #e7f6ff;
}

.metrics-three-data-content-item span {
  display: flex;
  align-items: center;
}
.metrics-three-data-footer {
  height: 16px;
  border-radius: 0px 0px 16px 16px;
  box-shadow: 0px -2px 2px rgba(0, 0, 0, 0.04);
}
.metrics-three-graph-wrap {
  width: 96px;
  height: 108px;
}
.week-column-wrap {
  display: flex;
  justify-content: space-between;
}
.week-column {
  width: 48px;
}

.hour-item {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0px 1px 0px #e7f6ff;
}

/* Pages and visits */
.metrics-four {
  margin: 32px 0;
}
.metrics-four .content {
  padding: 64px 95px;
  justify-content: space-between;
}
.metrics-four-item {
  width: 445px;
}
.visits-date {
  width: 86px;
}
.visits-time {
  width: 46px;
  text-align: center;
}
.visits-ip {
  width: 16px;
  text-align: center;
}
.visits-device {
  width: 16px;
  text-align: center;
}
.visits-platform {
  width: 16px;
  text-align: center;
}
.visits-referrer {
  width: 177px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.page {
  width: 340px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Our tips */
.tip-number {
  display: flex;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
}

/* Mobile */
@media (max-width: 1110px) {
  .headline {
    margin: 24px 0;
  }
  .headline .content {
    flex-direction: column;
    align-items: unset;
  }
  .headline-left {
    justify-content: space-between;
    margin-bottom: 8px;
  }
  .refresh {
    flex-direction: row-reverse;
    margin-left: 0;
  }
  .refresh span {
    margin-right: 8px;
    margin-left: 0;
  }
  .headline-right span {
    margin-left: 0;
  }
  .settings .content {
    height: auto;
    align-items: unset;
    flex-direction: column;
    box-shadow: none;
    margin-bottom: 24px;
  }
  .settings-left {
    width: 100%;
    margin-bottom: 16px;
  }
  .settings-left select {
    width: 50%;
  }
  .project {
    width: 50%;
  }
  .project select {
    width: 100%;
    padding-left: 16px;
  }
  .settings-right {
    flex-direction: row-reverse;
  }
  .settings-right > * {
    margin-right: 0;
    margin-left: 16px;
  }
  .settings-right > *:last-child {
    width: 100%;
    margin: 0;
    text-align: center;
  }
  .categories .content {
    flex-wrap: wrap;
    align-items: unset;
    padding: 16px 15px;
  }
  .category {
    width: 50%;
    padding: 0;
  }
  .category:nth-child(1),
  .category:nth-child(2) {
    margin-bottom: 16px;
  }
  .category:nth-child(1),
  .category:nth-child(3) {
    padding-right: 15px;
  }
  .category:nth-child(2),
  .category:nth-child(4) {
    padding-left: 15px;
    box-shadow: none;
  }
  .category-label {
    font: 400 14px "Nunito Sans";
  }
  .dynamics {
    padding: 0 11px;
  }
  .dynamics-mobile,
  .graph,
  .metrics-headline,
  .sources-countries-data,
  /* .visits-date, */
  .headline-right img,
  .project img {
    display: none;
  }
  .visits-referrer {
    width: 140px;
  }
  .metrics-one {
    margin: 8px 0 16px 0;
    background-color: #fafafa;
  }
  .metrics-one .content {
    padding: 0;
    border: none;
    flex-direction: column;
  }
  .sources,
  .countries {
    width: 100%;
    padding: 15px;
  }
  .metrics-one,
  .metrics-two {
    margin-bottom: 16px;
  }
  .metrics-two .content,
  .metrics-four .content {
    flex-direction: column;
    align-items: unset;
    padding: 0;
    border-radius: 0;
  }
  .metrics-two-item,
  .metrics-four-item {
    width: 100%;
    padding: 15px;
  }
  .metrics-two-data {
    display: flex;
    margin: 0;
    padding: 24px;
    align-items: center;
  }
  .metrics-two-data .caption,
  .metrics-three-data-content-day .caption,
  .metrics-three-data-content-day .week-column-wrap {
    margin: 0;
  }
  .metrics-two-graph-wrap,
  .metrics-three-graph-wrap {
    margin-right: 16px;
  }
  .graph-dot .caption-strong {
    display: inline;
    margin-left: auto;
  }
  .metrics-three .content {
    flex-direction: column;
    align-items: unset;
    padding: 0;
    border-radius: 0;
    margin-bottom: 16px;
  }
  .metrics-three-item {
    width: 100%;
    padding: 15px 15px 0 15px;
  }
  .metrics-three-data {
    margin: 0;
  }
  .metrics-three-data-content,
  .metrics-three-data-headline {
    padding-left: 16px;
    padding-right: 16px;
  }
  .languages-screens-group {
    width: 100%;
    flex-direction: column;
  }
  .metrics-three-data-content-day {
    padding: 24px;
    display: flex;
  }
  .week-column-wrap,
  .metrics-three-data-content-day .caption {
    flex: 1;
  }
  .week-column {
    width: 50%;
  }
  .week-column:nth-child(1) {
    margin-right: 16px;
  }
  .metrics-three-data-content,
  .metrics-three-data-content dashboard-nodata {
    height: 168px;
  }
  .metrics-four {
    margin: 0 0 32px 0;
  }
  .page {
    width: 230px;
  }
  .sources-countries-item a {
    max-width: 180px;
  }
}

dashboard-dynamics dashboard-nodata {
  position: relative;
  bottom: 30px; /* compensate padding-top in a different place */
  width: 255px;
  height: 292px;
}

.postponed-visibility {
  animation: cssAnimation 0s 3s forwards;
  visibility: hidden;
}

@keyframes cssAnimation {
  to {
    visibility: visible;
  }
}

/* START TOOLTIP STYLES */
[tooltip] {
  position: relative;
}

/* Applies to all tooltips */
[tooltip]::before,
[tooltip]::after {
  text-transform: none;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  position: absolute;
  display: none;
  opacity: 0;
}
[tooltip]::before {
  content: "";
  border: 5px solid transparent;
  z-index: 1001;
}
[tooltip]::after {
  content: attr(tooltip);
  line-height: 25px;

  font: 400 14px "Nunito Sans";
  color: #616161;

  min-width: 12em;
  padding: 1ch 1.5ch;
  border-radius: 0.3ch;
  box-shadow: 0 0.5em 2em -0.1em rgb(0 0 0 / 40%);

  background: white;
  z-index: 1000; /* absurdity 2 */
}

[tooltip]:hover::before,
[tooltip]:hover::after {
  display: block;
}

/* don't show empty tooltips */
[tooltip=""]::before,
[tooltip=""]::after {
  display: none !important;
}

/* FLOW: UP */
[tooltip]:not([flow])::before,
[tooltip][flow^="up"]::before {
  bottom: 100%;
  border-bottom-width: 0;
  border-top-color: white;
}
[tooltip]:not([flow])::after,
[tooltip][flow^="up"]::after {
  bottom: calc(100% + 5px);
}
[tooltip]:not([flow])::before,
[tooltip]:not([flow])::after,
[tooltip][flow^="up"]::before,
[tooltip][flow^="up"]::after {
  left: 50%;
  transform: translate(-50%, -0.5em);
}

/* FLOW: DOWN */
[tooltip][flow^="down"]::before {
  top: 100%;
  border-top-width: 0;
  border-bottom-color: white;
}
[tooltip][flow^="down"]::after {
  top: calc(100% + 5px);
}
[tooltip][flow^="down"]::before,
[tooltip][flow^="down"]::after {
  left: 50%;
  transform: translate(-50%, 0.5em);
}

/* FLOW: LEFT */
[tooltip][flow^="left"]::before {
  top: 50%;
  border-right-width: 0;
  border-left-color: #333;
  left: calc(0em - 5px);
  transform: translate(-0.5em, -50%);
}
[tooltip][flow^="left"]::after {
  top: 50%;
  right: calc(100% + 5px);
  transform: translate(-0.5em, -50%);
}

/* FLOW: RIGHT */
[tooltip][flow^="right"]::before {
  top: 50%;
  border-left-width: 0;
  border-right-color: white;
  right: calc(0em - 5px);
  transform: translate(0.5em, -50%);
}
[tooltip][flow^="right"]::after {
  top: 50%;
  left: calc(100% + 5px);
  transform: translate(0.5em, -50%);
}

/* KEYFRAMES */
@keyframes tooltips-vert {
  to {
    opacity: 0.9;
    transform: translate(-50%, 0);
  }
}

@keyframes tooltips-horz {
  to {
    opacity: 0.9;
    transform: translate(0, -50%);
  }
}

/* FX All The Things */
[tooltip]:not([flow]):hover::before,
[tooltip]:not([flow]):hover::after,
[tooltip][flow^="up"]:hover::before,
[tooltip][flow^="up"]:hover::after,
[tooltip][flow^="down"]:hover::before,
[tooltip][flow^="down"]:hover::after {
  animation: tooltips-vert 300ms ease-out forwards;
}

[tooltip][flow^="left"]:hover::before,
[tooltip][flow^="left"]:hover::after,
[tooltip][flow^="right"]:hover::before,
[tooltip][flow^="right"]:hover::after {
  animation: tooltips-horz 300ms ease-out forwards;
}

.da,
.da img {
  width: 350px;
  height: 284px;
}
.da img {
  object-fit: cover;
  object-position: 0 100%;
}

dashboard-daterangeselector form {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  min-height: 480px; /*measured by eyesight*/
}
