
html, body {
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  height: 100%;

  /* background: #111111; */
  position: relative;
}

button {
  all: unset;
}

body {
  min-height: 100dvh;
  background: #2cccfd;
}

body::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;

  background-image: url("/rsrc/cloud.png");
  background-repeat: no-repeat;
  background-size: cover;
  image-rendering: pixelated;

  mix-blend-mode: lighten;
  isolation: isolate;
}

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track:vertical {
  background-image: linear-gradient(90deg, #00000000 35%, #ffffffaa 35%, #ffffffaa 65%, #00000000 65%);
  border-radius: 0px;
}

::-webkit-scrollbar-track:horizontal {
  background-image: linear-gradient(0deg, #00000000 35%, #ffffffaa 35%, #ffffffaa 65%, #00000000 65%);
  border-radius: 0px;
}

::-webkit-scrollbar-thumb {
    background-color: #ffffff88;
    border: 2px outset rgba(0, 0, 0, 0.8);
    border-radius: 7px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: white;
}

.background {
  /* background-image: linear-gradient(10deg, #477e13, #6d7905, #235c26, #4e7c22, #728b18, #6a7505, #2a7529, #6b7022); */
  /* background-image: linear-gradient(20deg, #135c7e, #1a878f, #335fbe, #22587c, #187a8b, #205fb1, #297075, #38b3a8); */
  background-image:
    radial-gradient(circle farthest-side at 80% 95%,
      rgba(255,255,255,.25) 40%,
      rgba(255,255,255,.5) 42%,
      rgba(255,255,255,.3) 46%,
      rgba(255,255,255,0) 100%),
    radial-gradient(circle closest-corner at 100% 50%,
      rgba(255,255,255,.2) 30%,
      rgba(255,255,255,.5) 33%,
      rgba(255,255,255,.25) 44%,
      rgba(255,255,255,0) 100%),
    /* linear-gradient(10deg,
      #2a8bb855, #24c7d355, #4c7eeb55, #358ac455,
      #0eb8d655, #2676dd55, #3667c277, #0a887d99) */
    linear-gradient(20deg,
      #2a33b8aa, #1f8fb199, #14addb77, #0a5ba799,
      #0e43d6aa, #2676dd99, #3667c299, #0a178899)
    /* linear-gradient(rgba(10, 10, 151, 0.4), rgba(12, 194, 194, 0.4)) */
  ;
  background-size: 100% 100%;
  /* background-size: 200% 200%; */
}

/*
.high-def-mode .background {
  animation: gradient 20s infinite ease-in-out alternate;
}

@keyframes gradient {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}
*/

#background-overlay {
  /* Optimised afaik */
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.4;
  z-index: -1;
  pointer-events: none;

  /* contain: layout paint; */
}

#background-overlay::before {
  content: "";
  position: absolute;
  left: -35%;
  top: 56%;
  width: 170%;
  height: 20%;
  background: url("/rsrc/flow-small.webp") no-repeat 0 0 / 100% 100%;
  transform-origin: 50% 70%;

  /* Going to disable animation permanently... it's horribly slow */
  /* will-change: transform, scale, translate; */
}

/*
.high-def-mode #background-overlay::before {
  animation:
    wavy-scale 20s infinite ease-in-out alternate,
    wavy-x 24.5s infinite ease-in-out alternate,
    wavy-y 17.5s infinite ease-in-out alternate;
}

@keyframes wavy-scale {
  from { scale: 0.941 0.5; }
  to   { scale: 1.059 1.5; }
}

@keyframes wavy-x {
  from { transform: translateX(8.24%); }
  to   { transform: translateX(-8.24%); }
}

@keyframes wavy-y {
  from { translate: 0 -40%; }
  to   { translate: 0 40%; }
}
*/

/* https://deloughry.co.uk/field-notes/building-glitch-effects-with-css/ */
.screen-lines {
  position: relative;
}

.high-def-mode .screen-lines::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: repeating-linear-gradient(
    rgba(16, 17, 18, 0) 0px,
    rgba(16, 16, 18, 0) 2px,
    rgba(0, 0, 0, 0.07) 2px,
    rgba(0, 0, 0, 0.07) 4px
  );
  z-index: 2;
  pointer-events: none; 
  mix-blend-mode: soft-light;
}

.blur-filters {
  position: absolute;
  height: 150px;
  width: 300px;
  left: -9999px;
  top: 0;
  /* display: none; */
}


@font-face {
  font-family: 'nokia-sans';
  src: url('/rsrc/nokia-sans-regular.ttf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

#actual-content {
  position: absolute;

  top: 0; left: 0;
  width: 100%;
  height: 100%;

  display: flex;
  justify-content: center;
  align-items: center;

  font-family: "nokia-sans";
}


#content-container {
  /* max-width: 600px; */
  aspect-ratio: 3 / 4;
  height: 80%;
  margin: 20px;
  display: block;
  
  /* text-align: justify; */
  box-sizing: content-box;

  transform: translate(0, 20px);

  /* outline: 100px solid black; */
}

.high-def-mode #content-container-2 {
  filter:
    url("#horizontal-blur-small")
    /* blur(0.5px) */
    url("#overexpose")
    /* contrast(1.3) saturate(0.75) */
  ;
}

/* border hack */
#content-container::before {
  content: "";
  position: absolute;

  top: -77px;
  right: -37px;
  bottom: -37px;
  left: -37px;
  /* must be same width as border */
  border-image-source: url("/rsrc/nokia-border.png");
  border-image-repeat: stretch;
  border-image-width: 80px 40px 40px 40px;
  border-image-slice: 15.9% 10.5% 8% 10.5%;
  pointer-events: none;
  
  /* z-index: 2; */
}

#logo {
  position: absolute;
  background-image: url("/rsrc/nokia-logo.png");
  background-size: auto 100%;
  background-position: 50% 50%;
  background-repeat: no-repeat;

  top: -60px;
  right: calc(50% - 75px);
  width: 150px;
  height: 60px;

  z-index: 3;
}

@media (max-width: 768px) {
  #content-container {
    width: calc(100% - 60px);
    max-height: 75%;
    aspect-ratio: 9 / 16;

    transform: translate(0, 10px);
  }

  #content-container::before {
    top: -57px;
    right: -17px;
    bottom: -17px;
    left: -17px;
    border-image-width: 60px 20px 20px 20px;
  }

  #logo {
    top: -45px;
    right: calc(50% - 75px);
    width: 150px;
    height: 45px;
  }
}

#content-container-2 {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  padding: 10px;
  box-sizing: border-box;

  /* box-shadow:
    inset 5px 5px 3px rgba(68, 56, 0, 0.6),
    inset -5px -5px 3px rgba(68, 56, 0, 0.6); */

  box-shadow:
    inset 5px 5px 3px rgba(0, 54, 68, 0.6),
    inset -5px -5px 3px rgba(0, 16, 68, 0.6);
}


#content {
  height: 100%;
  display: grid;
  max-width: 100%;
  grid-template-rows: 4.5em 1fr 2.2em;
}

@media (max-width: 768px) {
  #content {
    grid-template-rows: 3.5em 1fr 2em;
  }
}

#header {
  display: grid;
  width: 100%;
  margin-bottom: 0.5em;
  grid-template-columns: 1.5em 1fr 2.5em;
}

.high-def-mode #header {
  filter:
    url("#horizontal-blur-medium")
    /* blur(0.7px) */
  ;
}

@media (max-width: 768px) {
  #header {
    grid-template-columns: 0.7em 1fr 2.5em;
  }
}

#wifi {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
}

#wifi-bg {
  background-image: url("/rsrc/wifi.svg");
  background-size: 100% 100%;
}

.high-def-mode #wifi-bg {
  filter:
    drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5))
  ;
}

#wifi-word {
  color: white;
  font-size: 1em;
  text-shadow: 1px 1.5px 1px rgb(9, 21, 29);
}

#header-content {
  color: white;
  font-size: 2em;
  text-align: left;
  height: 100%;
  padding-left: 40px;
  font-weight: bold;

  overflow-x: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;

  align-items: top;
  text-shadow: 1px 2px 2px rgb(29, 22, 9);
}

#battery {
  height: 100%;
  display: grid;
  grid-template-rows: 60% auto;
  align-items: stretch;
  justify-items: stretch;
  padding-right: 5px;
}

#battery-bg {
  background-image: url("/rsrc/battery-3.svg");
  background-size: auto 100%;
  background-repeat: no-repeat;
  background-position: right center;
  position: relative;
}

.high-def-mode #battery-bg {
  filter:
    drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.5))
  ;
}

.charging::after {
  content: "";
  position: absolute;
  background-image: url("/rsrc/charging.svg");
  background-size: auto 100%;
  background-repeat: no-repeat;
  left: 3px;
  top: 4px;
  width: 20px;
  height: 20px;
}

#battery-word {
  color: white;
  text-align: right;
  font-size: 1em;
  text-shadow: 1px 1.5px 1px rgb(29, 22, 9);
}

#content-panel {
  position: relative;
}

#home-page {
  /* background-color: green; */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  overflow-y: auto;
  padding-left: 1em;
  padding-right: 1em;

  box-sizing: border-box;

  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  #home-page {
    padding-left: 0.2em;
    padding-right: 0.5em;
  }
}

#navigation {
  /* background-color: red; */
  display: flex;
  justify-content: space-between;
  align-items: flex-end;

  color: #000000;
  font-size: 1.5em;
  text-shadow: 1.5px 0px 0px rgb(20, 176, 182);
}

.high-def-mode #navigation {
  filter:
    url("#horizontal-blur-medium")
    /* blur(0.7px) */
  ;
}

.nav-button {
  padding: 2px;
  padding-top: 0px;
  box-sizing: border-box;
  border-radius: 5px;
}

.nav-button:hover {
  background-color: #ffffff33;
  border: 1px solid #ffffff66;
  cursor: pointer;
}

.nav-button:disabled {
  visibility: hidden;
}

.high-def-mode .nav-button:hover {
  mix-blend-mode: screen;
}

#icon-menu {
  display: flex;
  
  align-content: flex-start;
  flex-wrap: wrap;

  color: black;
  text-shadow:
    1px 0px 0px rgb(93, 185, 201)
  ;
}

.icon {
  /* margin: 0.5em; */
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  max-width: 100px;
  display: grid;
  grid-template-rows: auto 1em;
  justify-items: center;
  border-radius: 10px;
  box-sizing: border-box;
  border: 1px solid #ffffff00;
}

.icon img {
  padding-left: 1em;
  padding-right: 1em;
  width: 50px;
  height: 72px;
  /* aspect-ratio: 35 / 50; */
}

.high-def-mode .icon img {
  filter: drop-shadow(5px 5px 5px #00000055);
}

.icon-label {
  width: 100%;
  text-align: center;
  font-size: 1em;
}

.icon:hover {
  background-color: #ffffff33;
  border: 1px solid #ffffff66;
  cursor: pointer;
  color: rgb(253, 92, 29);
  text-shadow: 0.5px 0px 1px rgb(29, 22, 9);
}

.icon-header {
  width: 100%;
  border-bottom: 2px white solid;
  margin-top: 10px;
  margin-bottom: 10px;
  color: white;
  font-size: 1.2em;
  text-shadow: 1px 1.5px 1px rgb(29, 22, 9);
  background-color: rgba(39, 114, 175, 0.5);
  padding-left: 0.2em;
  box-sizing: border-box;
}

.high-def-mode .icon-header {
  filter: url("#horizontal-blur-small");
}

.default-button {
  box-shadow: 3px 3px rgba(0, 36, 156, 0.4);

}

.default-button:hover {
  translate: 3px 3px;
  box-shadow: none;
  cursor: pointer;
}

#button-text::selection {
  background-color: #00ffc8;
  color: black;
}

.widget-disabled {
  display: none;
}

.app-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.app-content {
  box-sizing: border-box;
  height: 100%;
}

/*
==============
  WIDGET CSS 
==============
*/

#content-panel .app-content {
  /* background: rgba(14, 8, 105, 0.5); */
  /* background: rgba(38, 172, 235, 0.3); */
  box-shadow:
    -3px -3px 0px rgba(10, 26, 119, 0.1);
  border-radius: 5px;
}

/* t-link */

#t-link .app-content {
  padding: 1em;
  display: flex;
  flex-direction: column;
  justify-content: start;

  /* background-color: rgba(14, 8, 105, 0.2); */
  border-radius: 5px;
  /* border: inset 2px rgb(14, 8, 105); */
}

@media (max-width: 768px) {
  #t-link .app-content {
    padding: 0.5em;
  }
}

#t-link .app-content iframe {
  width: 100%;
  flex-grow: 2;
  border-radius: 7px;
  box-sizing: border-box;
}

#t-link .app-content a {
  color: white;

  margin-bottom: 0.5em;

  text-align: center;
  text-decoration: none;
  font-size: 1em;

  background-color: #025ca755;
  border-radius: 7px;
  box-shadow: 2px 5px 0px #00000055;
  border: solid 1px #00000000;
}

.high-def-mode #t-link .app-content a {
  filter: url("#horizontal-blur-small");
}

.hover-effect {
  background-color: #ffffff33;
  border: 1px solid #ffffff66;
  border-radius: 4px;
  margin: 0.1em;
  color: black;
}

#t-link .app-content a:hover {
  background-color: #ffffff33;
  border: 1px solid #ffffff66;
  cursor: pointer;
  color: rgb(253, 92, 29);
  text-shadow: 0.5px 0px 1px rgb(29, 22, 9);
  transform: translate(0px, 3px);
}

/* t-doc */

#t-doc .app-content {
  padding: 1em;
  /* background: rgba(14, 8, 105, 0.5); */
  background: rgba(19, 164, 231, 0.5);
  box-shadow: -3px -3px 0px rgba(10, 26, 119, 0.1);
  border-radius: 5px;
  /* margin-top: 0.3em; */
  height: calc(100% - 0.3em);
  width: 100%;
  overflow-y: auto;

  text-align: justify;
}

@media (max-width: 768px) {
  #t-doc .app-content {
    padding: 0.5em;
  }
}

/* doc-listing */

#t-listing .app-content {
  padding: 1em;
  /* background: rgba(14, 8, 105, 0.5); */
  /* background: rgba(19, 164, 231, 0.8); */
  box-shadow: -3px -3px 0px rgba(10, 26, 119, 0.1);
  border-radius: 5px;
  /* margin-top: 0.3em; */
  height: calc(100% - 0.3em);
  width: 100%;
  overflow-y: auto;
}

@media (max-width: 768px) {
  #t-listing .app-content {
    padding: 0.5em;
  }
}

#t-listing .doc-item {
  color: black;
  background-color: rgba(84, 156, 250, 0.3);
  width: 100%;
  box-sizing: border-box;
  padding-left: 1em;
  padding-right: 0.5em;
  padding-top: 0.2em;
  padding-bottom: 0.4em;
  text-align: left;
  display: block;
  border-bottom: 1px white solid;
}

#t-listing .doc-item:hover {
  background-color: rgb(25, 245, 190);
  color: black;
  cursor: pointer;
}

#t-listing .doc-item > * {
  width: 100%;
}

#t-listing .doc-item-title {
  font-size: 1.2em;
}

#t-listing .doc-item-details {
  display: grid;
  grid-template-columns: 1fr auto;
}

#t-listing .doc-item-excerpt {
  font-size: 0.9em;
  padding-right: 0.5em;
}

#t-listing .doc-item-date {
  font-size: 0.9em;
  text-align: right;
  padding-left: 0.5em;
  border-left: 1px solid white;
  align-self: end;
}