/* Basic css classes that can be applied to various components to make them look fancy*/

/* https://stackoverflow.com/questions/16679146/force-footer-on-bottom-on-pages-with-little-content */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
}

.bordered {
  border: 1px solid #ddd;
}

.fade {
  box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
  border: 1px lightgray dashed;
}

@media (min-width: 1072px) {
  .fade-hide {
    box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.1);
  }

  .m-center {
    max-width: 1072px;
    margin-left: calc(50% - 1072px / 2) !important;
    margin-right: calc(50% - 1072px / 2) !important;
  }

  /* center using padding */
  .center {
    max-width: 1072px;
    padding-left: calc(50% - 1072px / 2);
    padding-right: calc(50% - 1072px / 2);
  }
}

@media (min-width: 1359px) {
  /* center using margin */
  .m-center {
    max-width: 1072px;
    margin-left: calc(50% - 1072px / 2) !important;
    margin-right: calc(50% - 1072px / 2) !important;
  }

  /* center using padding */
  .center {
    max-width: 1072px;
    padding-left: calc(50% - 1072px / 2);
    padding-right: calc(50% - 1072px / 2);
  }
}


.clickable {
  cursor: pointer;
}

.see-through {
  opacity: 0.95;
}

.disabled,
*[disabled] {
  opacity: 0.7;
}

.hover,
.hover:hover:not(.disabled):not([disabled]) {
  transition: all 0.8s ease;
}

.hover.scale:hover:not(.disabled):not([disabled]) {
  transform: scale(1.1);
}

/* color modifying styles */

.blue {
  background-color: var(--color-pc-button-bg);
  color: var(--color-pc-button-text);
}

.blue.hover:not(.disabled):not([disabled]):hover,
.blue.active {
  background-color: var(--color-pc-button-bg-hover);
}

.blue.hover:not(.disabled):not([disabled]):active {
  background-color: var(--color-pc-button-bg-click);
  color: var(--color-pc-button-text-click);
}

.white {
  background-color: var(--color-unobstrusive-button-bg);
  color: var(--color-unobstrusive-button-text);
}

.white.hover:not(.disabled):not([disabled]):hover,
.white.active {
  background-color: var(--color-unobstrusive-button-bg-hover);
}

.white.hover:not(.disabled):not([disabled]):active {
  background-color: var(--color-unobstrusive-button-bg-click);
  color: var(--color-unobstrusive-button-text-click);
}

.red {
  background: var(--color-imp-button-bg);
  color: var(--color-pc-button-text);
}

.red.hover:not(.disabled):not([disabled]):hover,
.red.active {
  background: var(--color-imp-button-bg-hover);
}

.red.hover:not(.disabled):not([disabled]):active,
.red.active {
  background: var(--color-imp-button-bg-click);
  color: var(--color-pc-button-text-click);
}

/* size modifying styles */

.large {
  padding: 20px 40px;
}

.medium {
  padding: 10px 20px;
}

.small {
  padding: 5px 10px;
}

.xsmall {
  padding: 1px 2px;
}

/* animations */

.fade-in,
.fade-out {
  animation-name: fade;
  animation-duration: 1s;
  animation-timing-function: ease-out;
}

.fade-in {
  opacity: 1;
}

.fade-out {
  opacity: 0;
}

.scale-in,
.scale-out {
  animation-name: scale;
  animation-duration: 1;
  animation-timing-function: ease-out;
}

.fade-out,
.scale-out {
  animation-direction: reverse;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scale {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}


/* =========================================================
   EZ LIST — GLOBAL LIGHT / DARK THEME
   ========================================================= */

html {
    --ezl-bg: #eef1f8;
    --ezl-card: #ffffff;
    --ezl-text: #2a2a33;
    --ezl-muted: #666978;
    --ezl-border: #cfd4e2;
    --ezl-input: #ffffff;
    --ezl-purple: #6d1fd6;
}

html[data-ezl-theme="dark"] {
    --ezl-bg: #12141c;
    --ezl-card: #1b1e29;
    --ezl-text: #e9eaf2;
    --ezl-muted: #a3a6b8;
    --ezl-border: #363a4d;
    --ezl-input: #151821;

    /* Override Pointercrate's global colour system */
    --color-bg: #12141c;
    --color-panel-bg: #1b1e29;
    --color-text: #e9eaf2;
    --color-link: #9b5cff;
    --color-pc-button-bg: #6d1fd6;
    --color-pc-button-bg-hover: #7d31e5;
    --color-pc-button-bg-click: #5c18bc;
    --color-pc-button-text: #ffffff;
    --color-unobstrusive-button-bg: #252936;
    --color-unobstrusive-button-bg-hover: #303545;
    --color-unobstrusive-button-bg-click: #3a4052;
    --color-unobstrusive-button-text: #e9eaf2;
}

html[data-ezl-theme="dark"],
html[data-ezl-theme="dark"] body {
    background: var(--ezl-bg) !important;
    color: var(--ezl-text) !important;
}

html[data-ezl-theme="dark"] .content,
html[data-ezl-theme="dark"] main {
    color: var(--ezl-text);
}

/* General text */
html[data-ezl-theme="dark"] h1,
html[data-ezl-theme="dark"] h2,
html[data-ezl-theme="dark"] h3,
html[data-ezl-theme="dark"] h4,
html[data-ezl-theme="dark"] h5,
html[data-ezl-theme="dark"] h6,
html[data-ezl-theme="dark"] p,
html[data-ezl-theme="dark"] label,
html[data-ezl-theme="dark"] li,
html[data-ezl-theme="dark"] td,
html[data-ezl-theme="dark"] th {
    color: var(--ezl-text);
}

html[data-ezl-theme="dark"] a {
    color: #9b5cff;
}

/* Pointercrate panels/cards */
html[data-ezl-theme="dark"] .panel,
html[data-ezl-theme="dark"] .fade,
html[data-ezl-theme="dark"] .bordered {
    background-color: var(--ezl-card) !important;
    color: var(--ezl-text) !important;
    border-color: var(--ezl-border) !important;
}

/* Forms */
html[data-ezl-theme="dark"] input,
html[data-ezl-theme="dark"] textarea,
html[data-ezl-theme="dark"] select {
    background-color: var(--ezl-input) !important;
    color: var(--ezl-text) !important;
    border-color: var(--ezl-border) !important;
}

html[data-ezl-theme="dark"] input::placeholder,
html[data-ezl-theme="dark"] textarea::placeholder {
    color: var(--ezl-muted);
}

html[data-ezl-theme="dark"] option {
    background: var(--ezl-card);
    color: var(--ezl-text);
}

/* Tables */
html[data-ezl-theme="dark"] table,
html[data-ezl-theme="dark"] tr,
html[data-ezl-theme="dark"] td,
html[data-ezl-theme="dark"] th {
    border-color: var(--ezl-border) !important;
}

/* Miscellaneous Pointercrate white backgrounds */
html[data-ezl-theme="dark"] .white {
    background-color: #252936;
    color: var(--ezl-text);
}

html[data-ezl-theme="dark"] .white.hover:not(.disabled):not([disabled]):hover {
    background-color: #303545;
}

/* Footer */
html[data-ezl-theme="dark"] footer {
    background-color: #1b1e29 !important;
    color: var(--ezl-muted) !important;
}

html[data-ezl-theme="dark"] footer a {
    color: #b98aff;
}

/* Smooth theme change */
body,
.panel,
input,
textarea,
select,
header nav,
footer {
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease;
}
