/* BASE */

:root {
    --header-colour: #005c7b;/* rgb(0, 0, 155);*/
    --menu-colour: rgb(17, 37, 110);/*rgb(0, 0, 109);*/
    --menu-click-colour: rgb(31, 59, 158);;
    --padding-size: 12px;
    --shadow-col: rgba(149, 149, 149, 0.608);
    --background-colour: #6b8e91;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--header-colour);
    color: #000000;
    line-height: 1.6;
}

div {
  box-sizing: border-box;
}

.error-message {
    color : rgb(132, 0, 0);
}

*::-webkit-scrollbar {
    display: none;
    width: 10px;    
    background-color: transparent;
}

*::-webkit-scrollbar-track {
    background: transparent;       /* track background */
    border-radius: 8px;
}

*::-webkit-scrollbar-thumb {
    background: rgba(91, 75, 168, 0.4);          /* draggable part */
    border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Chrome, Safari, Edge (WebKit browsers) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.row {
    display:flex;
    flex-direction: row;
    gap: 8px;
}

.wrap {
    flex-wrap: wrap;
}


/* HEADER */

.site-header {
    background-color: var(--header-colour);
    color: rgb(255, 255, 255);
    display: flex;
    flex-direction: column;
}

.container-header-inner {
    padding: 2vh 5vw;
}

/*.header-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow: auto;
}*/

.header-menu {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 1px;
}

@media (max-width: 768px) {
    .header-menu {
        grid-auto-flow: row;
    }
}

.header-menu-option-box {
    flex: 1 1 100px;
    display: flex;
    align-items: center; /* better than align-content here */
    gap: 10px;
    width: auto;
    padding: 5px;

    background-color: var(--menu-colour);
    color: white;
    justify-content: center;

    box-shadow: 2px 2px 6px rgba(255, 255, 255, 0.359);
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-menu-option-box:hover {
    background-color: var(--menu-click-colour);
}

.header-menu-option-href {
    display: flex;
    white-space: nowrap;
    color: rgb(208, 219, 221);
    font-style: normal;
    text-decoration: none;
    height: 100%;
    align-items: center;
    text-align: center;
    justify-content: center;
}

.layout-container {
    display: flex;
    justify-content:start;
    height: auto;
    min-height: 80vh;
    background-color: var(--background-colour);
}

.content {
    height: min-content;
    width: 100%;
    padding: 3vh 3vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.page-box {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    padding: 5vh 5vw;
    background-color: white;
    border-radius: 15px;
    box-shadow: 5px 5px 10px 2px rgb(149, 149, 149);
}

.page-box-soft {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 5vh 5vw;
    background-color: rgba(0, 0, 0, 0.23);
    border-radius: 15px;
    box-shadow: 5px 5px 10px 2px rgba(56, 56, 56, 0.562);
    gap: 15px;
}

/* Inputs and buttons */

input {
    width: 100%;
    height: 30px;
    border-radius: 5px;
    border-width: 1px;
    box-shadow: 2px 2px 5px rgba(149, 149, 149, 0.39);
    border-color: rgba(149, 149, 149, 0.608);
    padding: 2px 10px;
}

input:focus {
    border-color: var(--menu-colour);
    box-shadow: 0 0 0 2px var(--menu-colour);
    outline: none;
}

input:hover {
    cursor:text;
}

.rule-balance-input {
    width: 60px;
    height: auto;
    border-radius: 5px;
    border-width: 1px;
    background:none;
    box-shadow: 2px 2px 5px rgba(149, 149, 149, 0.39);
    border-color: rgba(149, 149, 149, 0);
    padding: 5px 10px;
    text-align: center;
}

.rule-external-select {
    width: 100%;
    height: auto;
    border-radius: 5px;
    border-width: 1px;
    background:none;
    box-shadow: 2px 2px 5px rgba(149, 149, 149, 0.39);
    border-color: rgba(149, 149, 149, 0);
    padding: 5px 10px;
    text-align: left;
}

button {
    display:block;
    height: 30px;
    flex: 1 1 auto;
    background-color: var(--menu-colour);
    color: white;
    padding: 2px 10px;
    border-radius: 5px;
    box-shadow: 2px 2px 5px var(--shadow-col);
    transition: all 0.2s ease;
}

button:hover {
    background-color: var(--menu-click-colour);
    cursor: pointer;
}

select {
    width: 100%;
    height: 30px;
    border-radius: 5px;
    border-width: 1px;
    box-shadow: 2px 2px 5px rgba(149, 149, 149, 0.39);
    border-color: rgba(149, 149, 149, 0.608);
    padding: 2px 10px;
}

select:focus {
    border-color: var(--menu-colour);
    box-shadow: 0 0 0 2px var(--menu-colour);
    outline: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #ccc;
  border-radius: 26px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

input:checked + .slider {
  background-color: #4CAF50;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Login and forms */

.form {
    display: flex;
    gap: 20px;
    flex-direction: column;
}

.form-fields {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.form-fields.row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: start;
    align-items:last baseline;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group.row {
    display: flex;
    flex-direction: row;
    gap: 5px;
}


/* INVENTORY */

.inventory-grid {
    padding: 20px 0px;
    display: grid;
    gap: 20px;
    justify-content: center;
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));

}

.inv-product-card {
    display: flex;
    flex-direction: column;
    justify-self: center;
    width:100%;
    /*width: minmax(220px, 300px);*/
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .inventory-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .inv-product-card {
        width: 90%;
  }
}

.inv-product-card-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--menu-colour);
    overflow: hidden;
    padding: 10px;
}

.product-card-title {
    text-align: center;
    color: #bacddd;
}

.product-card-amount {
    text-align: center;
    color: #bacddd;
    font-weight: 500;
}

.product-card-button-grid {
    display: flex;
    flex-direction: column;
    gap: 0px;
    background-color: var(--header-colour);
}
.product-new-title {
    display: flex; 
    flex-direction: row;
    text-align: center;
    align-content: center;
    align-items: center;
    justify-content: center;
    color: #bacddd;
    flex: 1;
    gap: 10px;
    padding: 0px 20px;
}

.product-new-title input {
    text-align: left;
    color: #bacddd;
    font-weight: 500;
    font-size: 16px;
    border:0cm;
    border-color: none;
    box-shadow: none;
}

.product-new-title input:focus {
    border-color: none;
    box-shadow: none;
    outline: none;
    border:0cm;
}

button {
    white-space: nowrap;
}

.add-btn {
    background-color: rgb(49, 130, 62);
    border-radius: 0;
    border-color: rgb(24, 87, 35);
    padding: 10px 10px;
    height:auto;
}

.add-btn:hover {
    background-color: rgb(29, 161, 93);
}

.custom-add-btn {
    background-color: rgb(49, 130, 62);
    border-radius: 0;
    border-color: rgb(24, 87, 35);
    padding: 10px 10px;
    height:auto;
}

.custom-add-btn:hover {
    background-color: rgb(29, 161, 93);
}

.custom-set-btn {
    background-color: rgb(134, 131, 19);
    border-radius: 0;
    border-color: rgb(105, 106, 27);
    padding: 10px 10px;
    height:auto;
}

.custom-set-btn:hover {
    background-color: rgb(172, 179, 50);
}

.custom-add-input {
    width: 100%;
    height: 100%;
    text-align: center;
    color: white;
    border-width: 1px;
    box-shadow: 2px 2px 5px rgba(149, 149, 149, 0.39);
    border-radius: 0;
    border-color: rgb(24, 87, 35);
    padding: 10px 10px;
    background-color: rgb(49, 130, 62);
}

.remove-btn {
    background-color: rgb(113, 36, 36);
    border-radius: 0;
    border-color: rgb(83, 24, 24);
    padding: 10px 10px;
    height: auto;
}

.remove-btn:hover {
    background-color: rgb(166, 79, 79);
}

.del-btn {
    background-color: rgb(113, 36, 36);
    border-radius: 5px;
    border-color: rgb(83, 24, 24);
    padding: 5px 10px;
    height: auto;
}

.del-btn:hover {
    background-color: rgb(166, 79, 79);
}

.undo-btn {
    background-color: rgb(113, 36, 36);
    border-color: rgb(83, 24, 24);
    flex: 0;
}

.undo-btn:hover {
    background-color: rgb(152, 62, 62);
}

.inv-btn {
    padding: 15px 10px;
}

/* EVENTS */

.events-list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    gap: 10px;
    padding: 10px;
}

.event-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    padding: 10px;
    gap: 10px;
    background-color: #2d778b;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-width: 2px;
    border-color: #164856;
}

.event-card p {
    flex: 1;
    color: white;
}

/* HOME PAGE */

.home-page-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.home-page-grid .page-box-soft {
    flex: 1;
    color: rgb(202, 210, 224);
}

.info-box {
    display: flex;
    flex-direction: row;
    white-space: nowrap;
    gap: 10px;
}

.home-page-grid h3 {
    white-space: nowrap;
}

.home-page-grid h5 {
    white-space: nowrap;
}

.home-page-grid p {
    white-space: nowrap;
}

.home-event-card {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items:baseline;
}

.home-page-list {
    overflow-y: auto;
    max-height: 30vh;
}

/* PRODUCTS */

.list {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
    list-style: none;
}

.title-box h2 {
    color: rgb(206, 209, 221);
}

.product-list {
    gap: 15px;
}

.product-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-shadow: 5px 5px 10px 2px rgba(56, 56, 56, 0.562);
    border-radius: 8px;
    overflow: hidden;
}

.product-card-header {
    display: flex;
    flex-direction: row;
    background-color: var(--menu-colour);
}

.product-card-header .product-card-title {
    flex: 1;
    justify-content:start;
    align-content: center;
    padding: 0px 20px;
}

.product-card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-content-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: start;
    align-items: left;
}

.product-card-header .product-card-title h3 {
    text-align: left;
}

.product-card-content {
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ccc;
}

.dropdown-content {
    display: none;
}

.dropdown-content.open {
    display:flex;
}

.trigger {
    cursor: pointer;
    padding: 10px;
    background: var(--menu-click-colour);
    color: white;
    justify-self: end;
    flex: 0;
    white-space: nowrap;
}

/* EVENT RULES */

.rule-card {
    display: flex;
    flex-direction: row;
    width: 100%;
    padding: 10px;
    gap: 10px;
    background-color: #2d778b5a;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-width: 2px;
    border-color: #164856;
}

.rule-card-field {
    flex: 0;
}

.rule-card-field.name-field {
    flex: 1;
}


/* USERS */

.user-link {
    color: var(--menu-colour);
    text-decoration: none;
}

.user-link:hover {
    text-decoration: underline;
}