@import 'colors.css';

* {
    box-sizing: border-box;
}

@font-face {
    font-family: 'Lato';
    src: url('../assets/Lato.ttf') format('truetype');
}

@property --main-color {
    syntax: '<color>';
    inherits: true;
    initial-value: transparent;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: linear-gradient(to bottom, hsl(from var(--main-color) h s l / 0.2), var(--body-bg));
    color: #fff;
    margin: 0;
}

main {
    flex: 1;
    padding-bottom: 2rem;
}

::selection {
    background-color: var(--main-color);
    color: #ffffff;
}

span.disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed !important;
}

h1, h2 {
    font-weight: bold;
}

a {
    text-decoration: none;
    color: inherit;
}

.seticon-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.flash-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    text-align: center;
    padding: 1.3rem;
    font-weight: bold;
    color: white;
    background-color: #ff4d4d;

    &.success {
        background-color: #4CAF50;
    }
}

.debug {
    color: var(--text-secondary);
    white-space: pre-wrap;
    font-family: monospace;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 80%;
    gap: 1.2rem;
}

.card {
    --shadow: 4px 4px 10px rgba(0, 0, 0, 0.3);
    color: white;
    max-width: 100%;
    background-color: var(--main-color);
    border: 1px solid;
    border-color: var(--main-color);
    border-radius: var(--bs-border-radius);
    box-shadow: var(--shadow);

    .card-header {
        text-align: center;
        border: none;

        ::selection {
            background-color: white;
            color: var(--main-color);
        }

        h2, h3, h4 {
            font-style: italic;
            font-weight: bold;
            margin-bottom: 0;
        }
    }

    .card-content {
        padding: 1.5rem 2rem;
        border-radius: var(--bs-border-radius);
        background-color: hsl(from var(--card-bg) h s l / 0.95);
        box-shadow: inset 0px 0px 6px 0px rgba(0, 0, 0, 0.5);
    }
}

/* Generic */
.img-wrapper img {
    opacity: 0;
    scale: 0.5;
    width: 100%;
    transition: all 0.3s var(--bouncy);

    &.loaded {
        opacity: 1;
        scale: 1;
    }
}

.loading {
    animation: pulse 0.6s ease alternate infinite;
}

button {
    --button-color: var(--text-secondary);
    background-color: var(--button-color);
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: var(--bs-border-radius);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;

    &.btn-icon {
        color: var(--text-secondary);
        background-color: transparent;
        padding: 0;
        transition: color 0.3s ease;
        vertical-align: middle;

        &:hover {
            color: var(--main-color);
        }
    }
}

.emoji-btn span {
    font-size: 1.75rem;
    line-height: 1;
}

.btn-corner-icon {
    position: absolute;
    font-size: 0.7rem;
    right: 3px;
    top: 0px;
}

.form-select, .form-control {
    font-family: 'Lato';

    &:focus {
        border-color: var(--main-color);
        box-shadow: 0 0 0 0.2rem hsl(from var(--main-color) h s l / 0.25);
    }
}

.form-check-input {
    cursor: pointer;

    &:focus {
        border-color: hsl(from var(--main-color) h s 60%);
        box-shadow: 0 0 0 0.25rem hsl(from var(--main-color) h s l / 0.25);
    }

    &:checked {
        background-color: var(--main-color);
        border-color: var(--main-color);
    }
}

div.dt-container {
    .dt-length {
        .dt-input {
            @supports (-moz-appearance: none) {
                background-color: transparent !important;
            }
        }

        label {
            margin-left: 6px;
        }
    }

    .dt-search .dt-input {
        font-size: 1rem;
        line-height: normal;
        margin-left: 6px;
        background-color: transparent !important;

        &:focus {
            border-color: var(--main-color);
            box-shadow: 0 0 0 0.2rem hsl(from var(--main-color) h s l / 0.25);
        }
    }
    
    table.dataTable thead {
        th {
            border-radius: var(--bs-border-radius);

            .dt-column-order {
                color: var(--main-color);
            }
        }
    }

    .dt-paging .dt-paging-button {
        border-radius: var(--bs-border-radius);
    }
}

.cond[data-condition] {
    background-color: var(--cond-bg);
}

input {
    font-size: 18px;
    padding: 0.2rem;
    font-family: 'Lato';
    border-radius: var(--bs-border-radius);
    outline: none;
    background: inherit;
    color: #fff;
    transition: border-color 0.5s ease;

    &:focus {
        border-color: var(--main-color);
    }

    &:disabled {
        color: var(--text-secondary);
        cursor: not-allowed;
    }
}

dialog {
    border: 1px solid hsl(from var(--main-color) h s l / 0.8);
    border-radius: var(--bs-border-radius);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    background: var(--card-bg);
    text-align: center;
    padding: 0;
    margin-top: 20vh;
    transition: opacity 0.5s ease, transform 0.5s ease;

    &::backdrop {
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(6px);
        transition: all 0.5s ease;
    }

    h4 {
        margin-block: 1rem;
    }

    .text-container {
        padding-inline: 1rem;
    }

    .btn-container {
        display: flex;
        gap: 1rem;
        padding: 0.75rem 1rem;
        background-color: var(--bs-body-bg);
        box-shadow: var(--inset-shadow), 0 -4px 8px 0 rgba(0, 0, 0, 0.2);

        button {
            font-weight: 600;
        }
    }

    &[open] {
        transform: translateY(5vh);

        &, &::backdrop {
            opacity: 1;
        }
    }

    @starting-style {
        &[open],
        &[open]::backdrop {
            opacity: 0;
            transform: translateY(0);
        }
    }
}

footer {
    position: relative;
    background-color: hsl(from var(--body-bg) h s l / 0.8);
    backdrop-filter: blur(12px);
    display: grid;
    place-items: center;
    color: var(--text-secondary);
    text-align: center;
    padding: 1rem 2rem;
}

@media (max-width: 1200px) {
    .container {
        max-width: unset !important;
    }
}

@media (max-width: 670px) {
    .container {
        align-items: unset;
    }
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
    -webkit-border-radius: 3px;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    -webkit-border-radius: 3px;
    border-radius: 3px;
    background: #999;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] { appearance: textfield; }

.slide-left  { --slide-x:  2rem; }
.slide-right { --slide-x: -2rem; }
.slide-up    { --slide-y:  2rem; }
.slide-down  { --slide-y: -2rem; }

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

@keyframes slideIn {
    from {
        transform: translate(var(--slide-x, 0), var(--slide-y, 0));
        opacity: 0;
    }

    to {
        transform: translate(0, 0);
        opacity: 1;
    }
}

@keyframes pulse {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

@keyframes spin {
    from { transform: rotateZ(0deg); }
    to { transform: rotateZ(360deg);}
}

@keyframes expand {
    from { width: 0%; }
    to { width: 100%; }
}
