@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    h1 {
        @apply text-2xl;
    }

    h2 {
        @apply text-xl;
    }
}

body {
    font-family: "Bender", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto",
    "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
}

@font-face {
    font-family: "Bender";
    font-style: normal;
    font-weight: 400;
    src: local(""),
    url("../fonts/Bender.woff") format("woff");
}

#app {
    height: 100vh;
    text-align: center;
}

.toast {
    z-index: 1000;
}

/* <div id="loader" class="button-loader">
           <span class="loading loading-spinner"></span>
           <span class="button-hide">Give</span>
 </div> */
.button-loader .loading {
    display: none;
}

.button-loader .button-hide {
    display: block;
}

.htmx-request.button-loader .loading {
    display: block;
}

.htmx-request.button-loader .button-hide {
    display: none;
}

/* override tabs from daisy as per https://github.com/saadeghi/daisyui/issues/2988 */
.tabs {
    display: flex;
    flex-wrap: wrap;
}

.tab {
    order: 0;
}

.tab-content {
    order: 1;
    width: 100%;
    /* this takes into the tab header! */
    height: calc(100% - 48px);
}

/*fix for summary arrow on Windows webview*/
summary {
    display: flex;
    align-items: center;
    cursor: pointer;
}

details > summary {
    list-style: none;
}

details > summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: "\25B2";
    display: inline-block;
    margin-right: 0.5em;
    transform: rotate(90deg); /* Rotate based on open/closed state */
    transition: transform 0.1s ease-in-out;
}

details[open] summary::before {
    transform: rotate(180deg); /* Rotate to a downward arrow when open */
}

/*fix scrolling issue, if you put mouse on top of it when it's closed you cant scroll */
dialog.modal:not([open]) {
    z-index: -1;
}

:root:has(:is(.modal-open, .modal:target, .modal-toggle:checked + .modal, .modal[open])) {
    scrollbar-gutter: auto !important;
}

.grid-stash {
    display: grid;
    overflow-y: auto;
}

.grid-stash .grid-item {
    height: 64px;
    width: 64px;
    position: relative;
    background-image: url("../images/grid_cell.png");
    background-size: cover;
}
.grid-stash .grid-item .empty {
    height: 64px;
    width: 64px;
}

.grid-stash .grid-item .item {
    z-index: 2;
}

.grid-stash .grid-item .item .item-image {
    width: 100%;
    height: 100%;
}

.grid-stash .grid-item .item .short-name {
    font-size: 11px;
    position: absolute;
    right: 2px;
    top: 2px;
}

.grid-stash .grid-item .item .item-data {
    position: absolute;
    top: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
}

.grid-stash .grid-item .item .item-data .fir {
    height: 12px;
    width: 12px;
    background-image: url("../images/fir.png");
    background-size: 12px 12px;
}
.grid-stash .grid-item .item .item-data .amount {
    font-size: 13px;
}

table.kits {

}

table.kits tr td .kit-slot.w128-h128 {
    width: 128px;
    height: 128px;
}

table.kits tr td .kit-slot.w128-h64 {
    width: 128px;
    height: 64px;
}

table.kits tr td .kit-slot.w256-h128 {
    width: 256px;
    height: 128px;
}

table.kits tr td .kit-slot {
    display: flex;
    flex-direction: column;
}

table.kits tr td .kit-slot .image {
    min-height: 0;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

table.kits tr td .kit-slot .title {
    text-align: start;
}

table.kits tr td {
    vertical-align: top;
}

.snowflake {
    color: #fff;
    font-size: 1em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px #000;
}

.snowflake, .snowflake .inner {
    animation-iteration-count: infinite;
    animation-play-state: running
}

@keyframes snowflakes-fall {
    0% {
        transform: translateY(0)
    }
    100% {
        transform: translateY(110vh)
    }
}

@keyframes snowflakes-shake {
    0%, 100% {
        transform: translateX(0)
    }
    50% {
        transform: translateX(80px)
    }
}

.snowflake {
    position: fixed;
    top: -10%;
    z-index: 9999;
    -webkit-user-select: none;
    user-select: none;
    cursor: default;
    animation-name: snowflakes-shake;
    animation-duration: 3s;
    animation-timing-function: ease-in-out
}

.snowflake .inner {
    animation-duration: 10s;
    animation-name: snowflakes-fall;
    animation-timing-function: linear
}

.snowflake:nth-of-type(0) {
    left: 1%;
    animation-delay: 0s
}

.snowflake:nth-of-type(0) .inner {
    animation-delay: 0s
}

.snowflake:first-of-type {
    left: 10%;
    animation-delay: 1s
}

.snowflake:first-of-type .inner, .snowflake:nth-of-type(8) .inner {
    animation-delay: 1s
}

.snowflake:nth-of-type(2) {
    left: 20%;
    animation-delay: .5s
}

.snowflake:nth-of-type(2) .inner, .snowflake:nth-of-type(6) .inner {
    animation-delay: 6s
}

.snowflake:nth-of-type(3) {
    left: 30%;
    animation-delay: 2s
}

.snowflake:nth-of-type(11) .inner, .snowflake:nth-of-type(3) .inner {
    animation-delay: 4s
}

.snowflake:nth-of-type(4) {
    left: 40%;
    animation-delay: 2s
}

.snowflake:nth-of-type(10) .inner, .snowflake:nth-of-type(4) .inner {
    animation-delay: 2s
}

.snowflake:nth-of-type(5) {
    left: 50%;
    animation-delay: 3s
}

.snowflake:nth-of-type(5) .inner {
    animation-delay: 8s
}

.snowflake:nth-of-type(6) {
    left: 60%;
    animation-delay: 2s
}

.snowflake:nth-of-type(7) {
    left: 70%;
    animation-delay: 1s
}

.snowflake:nth-of-type(7) .inner {
    animation-delay: 2.5s
}

.snowflake:nth-of-type(8) {
    left: 80%;
    animation-delay: 0s
}

.snowflake:nth-of-type(9) {
    left: 90%;
    animation-delay: 1.5s
}

.snowflake:nth-of-type(9) .inner {
    animation-delay: 3s
}

.snowflake:nth-of-type(10) {
    left: 25%;
    animation-delay: 0s
}

.snowflake:nth-of-type(11) {
    left: 65%;
    animation-delay: 2.5s
}
