@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:ital,wght@0,100..700;1,100..700&display=swap');

/* Global Reset and Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Josefin Sans", sans-serif;
    font-size: 18px;
}

/* Variables */
:root {
    --colorBG: #000b14;
    --colorBGBox: rgba(255, 255, 255, .01);
    --colorBGInput: rgba(155, 155, 155, .05);
    --colorText: #f2f2f2;
    --colorAltText: #f2f2f2;
    --colorSliders: #555555;
    --colorA: #32edf2;
    --colorB: #1f8eff;
    --colorC: #FF1F8E;
    --colorSelect: rgba(75, 75, 75, .50);
    --colorCheckBox: rgba(75, 75, 75, .50);
    --colorHoverCheckbox: rgba(75, 75, 75, .50);
}

/* Body Setup */
html,
body {
    height: 100%;
    background-color: var(--colorBG);
    color: var(--colorText);
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 15px;
}

/* Typography */
h1,
h2 {
    font-size: 1.75rem;
    font-weight: 300;
}

h3 {
    font-size: 1rem;
    font-weight: 500;
}

/* Container */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background-color: var(--colorBG);
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    overflow: auto;
}

.container::-webkit-scrollbar {
    display: none;
}

/* Header and Footer */
.header,
.footer {
    display: flex;
    width: 100%;
    text-align: center;
    flex-shrink: 0;
    background-color: var(--colorBGBox);
    padding: 0 25px;
}

.header {
    height: 90px;
    justify-content: space-between;
    padding: 15px 25px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: .5em;
    margin: auto 0;
}

.header-right {
    display: flex;
    margin-top: auto;
    gap: .15rem;
}

.header-branding {
    display: flex;
}

.header-branding img {
    height: 1.45em;
    margin-left: 1em;
}

/* Footer */
.footer {
    height: 50px;
    margin-top: auto;
}

.footer .copyright {
    font-weight: 400;
}

.footer-content {
    margin: auto 0;
    font-weight: 300;
}

/* Body (Main Content) */
.body {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
    justify-content: space-between;
    align-content: flex-start;
    flex-grow: 1;
}

/* Modules */
.module {
    flex-direction: column;
    flex: 1 1 calc(22% - 100px);
    min-width: calc(22% - 100px);
    height: 100%;
    background-color: var(--colorBGBox);
    display: flex;
    padding: 25px;
}

.large-module {
    flex-direction: column;
    flex: 2 1 calc(34% - 100px);
    min-width: calc(34% - 100px);
    height: 100%;
    background-color: var(--colorBGBox);
    display: flex;
    padding: 25px;
}

.section {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: 1rem;
}

.entries-display, .bans-display {
    display: flex;
    justify-content: space-between;
}

.entries-display svg, .bans-display svg {
    height: 1rem;
    fill: var(--colorText);
    padding-right: .25em;
    margin-top: -3px;
}

.entries-display svg:hover, .bans-display svg:hover {
    fill: var(--colorC);
    cursor: pointer;
}

.viewer-outer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 550px;
    gap: .5em;
    margin-top: .5rem;
    padding: 25px 15px;
    background-color: #000b14;
    border: solid 1px var(--colorSliders);
    border-radius: 4px;
    overflow: hidden;
    font-size: 16px;
}

.viewer-container, .ban-container {
    display: flex;
    flex-direction: column;
    gap: .25em;
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.viewer-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, and Opera */
}

.viewer-container div {
    display: flex;
    flex-direction: row;
    gap: .5em;
    padding: 3px 6px;
}

.viewer-container span {
    display: flex;
    margin-right: auto;
}

.viewer-container span:hover {
    color: var(--colorC);
    cursor: pointer;
}

.viewer-container i {
    color: var(--colorText);
    font-size: .8em;
    margin-top: auto;
    margin-bottom: auto;
}

.viewer-container i:hover {
    color: var(--colorC);
    cursor: pointer;
}

/* .viewer-container span::after {
    content: 'x';
    margin-left: auto;
} */

.viewer-container .subscriber {
    color: var(--colorB);
}

#module-options .section {
    margin-bottom: 1rem;
}

.section-keyword div {
    display: flex;
    gap: .5em;
}

.section-keyword div svg {
    height: .7em;
    margin-left: 1em;
    margin-bottom: auto;
    fill: var(--colorText);
}

.section-keyword div svg:hover {
    fill: var(--colorC);
    cursor: pointer;
}

.stream-info {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
    padding: 0 2px;
}

.keyword-info::before {
    content: ' - ';
}

.keyword-info::after {
    content: ':';
}

.active_viewers {
    margin-left: auto;
}

.active_viewers::after {
    content: ':';
}

#streamer-name,
#winner-count,
#entry-count, #ban-count,
#keyword,
.stream-info .active {
    color: var(--colorB);
}

.entry-count, .ban-count {
    margin-right: auto;
    margin-left: .5em;
}

.chat-outer-container {
    display: flex;
    height: 100%;
    max-height: 550px;
    padding: 15px;
    background-color: var(--colorBG);
    border: solid 1px var(--colorSliders);
    border-radius: 4px;
    overflow: hidden;
    font-weight: 500;
    font-size: 16px;
    margin-top: .5rem;
}

/* Chat Messages */
.chat-container {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    gap: .5em;
    overflow-y: auto;
}

.message {
    line-height: 1.35;
    /* Adjust line height for messages */
}

.message span {
    vertical-align: middle;
    /* Align elements vertically */
}

.badges {
    height: .8em;
    /* Adjust badge height */
    margin: auto 0;
    margin-right: .15em;
    /* Adjust badge margins */
    vertical-align: baseline;
}

.message .username {
    color: var(--colorA);
    margin: auto 0;
    margin-right: .35em;
    line-height: 1rem;
}

.message .username::after {
    content: ':';
}

.message .content {
    margin: auto 0;
    word-break: break-word;
    /* Allow long words to break */
    flex: 1 1 100%;
    /* Allow the content to take up full width */
}

.message .content img {
    height: 1em;
    /* Adjust image height */
    margin-bottom: -2px;
    /* Adjust image margin */
}

/* Ensure the chat container scrolls to the bottom initially */
.chat-container::-webkit-scrollbar {
    width: 12px;
}

.chat-container::-webkit-scrollbar-track {
    background: #000b14;
}

.chat-container::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 10px;
    border: 3px solid #000b14;
}

/* Ensure the chat container scrolls to the bottom initially */
.chat-container::-webkit-scrollbar {
    width: 12px;
}

.chat-container::-webkit-scrollbar-track {
    background: #000b14;
}

.chat-container::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 10px;
    border: 3px solid #000b14;
}


.winner-display {
    display: flex;
    gap: .5em;
}

.winner-text::after {
    content: ':';
}

.winner-display svg {
    height: 1rem;
    fill: var(--colorText);
    padding-right: .25em;
    margin-top: -3px;
    margin-left: auto;
}

.winner-display svg:hover {
    fill: var(--colorC);
    cursor: pointer;
}

.winner-outer-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 550px;
    gap: .5em;
    margin-top: .5em;
    padding: 25px 15px;
    background-color: #000b14;
    border: solid 1px var(--colorSliders);
    border-radius: 4px;
    overflow: hidden;
    font-size: 15px;
}

.winner-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}


.winner-container::-webkit-scrollbar {
    display: none;
}

.winner-container ul {
    display: flex;
    flex-direction: column;
    gap: .55em;
    padding: 3px 6px;
}

.winner-container ul li {
    display: flex;
    gap: .75em;
    counter-increment: winner-counter;
}

.winner-container ul li:before {
    content: counter(winner-counter) ".";
}

.winner-container span {
    margin-top: auto;
    margin-bottom: auto;
}

.winner-container .list-winner {
    overflow: hidden;
    text-overflow: ellipsis;
}

.winner-container .list-time {
    margin-left: auto;
    font-size: .9em;
}

.winner-container span:hover {
    background-color: var(--colorBGInput);
    cursor: pointer;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    gap: .75rem;
    font-size: .9rem;
    font-weight: 300;
    line-height: 1.5;
}

.breadcrumbs span {
    font-weight: 400;
}

.breadcrumbs a,
.bradcrumbs a:visited {
    color: var(--colorText);
    text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs span:hover {
    color: var(--colorB);
}

.breadcrumbs a::after {
    content: "🢒";
    margin-left: .75em;
}

.breadcrumbs a:hover::after {
    color: var(--colorText);
}

#tr-giveaway_id::after {
    content: ' :';
}

input[type="text"] {
    flex: 1 1;
    width: 50%;
    padding: 10px 12px;
    background-color: var(--colorBGInput);
    border: none;
    border-radius: 4px;
    color: var(--colorB);
}

.select-bot {
    background-color: var(--colorBGInput);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 448'%3E%3Cpath d='M255.9 168c0-4.2-1.6-7.9-4.8-11.2-3.2-3.2-6.9-4.8-11.2-4.8H16c-4.2 0-7.9 1.6-11.2 4.8S0 163.8 0 168q0 6.6 4.8 11.4l112 112c3.1 3.1 6.8 4.6 11.2 4.6s8.2-1.5 11.4-4.6l112-112q4.5-4.8 4.5-11.4' style='fill:white'/%3E%3C/svg%3E");
    background-position: right 10px center;
    background-repeat: no-repeat;
    background-size: auto 50%;
    border-radius: 4px;
    border: none;
    color: var(--colorAltText);
    padding: 10px 30px 10px 10px;
    outline: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
}

.select-bot option {
    color: var(--colorBG);
}

/* Button Styles */

.checkbox-options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: 14px;
}

.checkboxes {
    display: none;
}

.checkbox-switch {
    position: relative;
    width: fit-content;
    padding: 8px 12px 4px 12px;
    background-color: var(--colorCheckBox);
    border-radius: 4px;
    z-index: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--colorAltText);
    font-weight: 600;
    transition: all 0.3s;
    user-select: none;
}

.checkbox-switch:hover {
    background-color: var(--colorC);
    box-shadow: 0px 0px 5px var(--colorC);
}

.checkboxes:checked+.checkbox-switch {
    background-color: var(--colorC);
    box-shadow: 0px 0px 5px var(--colorC);
}

.module-checkboxes:checked {
    background-color: var(--colorC);
    box-shadow: 0px 0px 5px var(--colorC);
}

.winner-chat {
    margin-left: auto;
}


/* Style for the checkboxes */
.module-check {
    display: none;
}

.module-check-switch {
    display: inline-block;
    cursor: pointer;
    line-height: 1;
    font-size: 14px;
    padding: 8px 10px 3px 10px;
    background-color: var(--colorBGInput);
    color: var(--colorText);
    border-radius: 4px;
    text-align: center;
    user-select: none;
    transition: background-color 0.3s, color 0.3s;
}

.module-check-switch:hover {
    background-color: var(--colorHoverCheckbox);
    color: var(--colorText);
}

/* Checked (selected) state */
.module-check:checked+.module-check-switch {
    background-color: var(--colorSelect);
    color: var(--colorText);
    /* Change text color when checked */
}

.button-options {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    font-size: 14px;
}

button {
    padding: 8px 12px;
    background-color: var(--colorCheckBox);
    border: none;
    border-radius: 4px;
    color: var(--colorAltText);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    min-width: 75px;
    white-space: nowrap;
}

button:hover {
    background-color: var(--colorC);
    box-shadow: 0px 0px 5px var(--colorC);
}

/* Range Sliders */


.range-options {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.range {
    display: flex;
}

.range-options span {
    color: var(--colorSliders);
    font-size: 16px;
    font-style: italic;
}

.range input {
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Added for Firefox */
    appearance: none;
    /* Standard */
    flex: 1;
    height: 4px;
    border-radius: 5px;
    background-color: var(--colorSliders);
    outline: none;
}

.range input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--colorB);
    cursor: pointer;
    /* Added for better UX */
}

.range input::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background-color: var(--colorB);
    cursor: pointer;
    /* Added for better UX */
}

.range span {
    position: absolute;
    margin-left: 14px;
    margin-top: -4px;
    width: 50px;
    height: 30px;
    background-color: var(--colorSliders);
    color: #fff;
    border-radius: 3px;
    text-align: center;
    line-height: 30px;
}

.range span:before {
    content: '';
    position: absolute;
    border-right: 9px solid transparent;
    border-left: 9px solid transparent;
    border-bottom: 12px solid var(--colorSliders);
    left: -10px;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.range-label {
    margin-left: auto;
}

/* Responsive Design */
@media (max-width: 1400px) {

    .module,
    .large-module {
        flex: 1 1 calc(50% - 75px);
        /* Adjust module width */
        min-width: calc(50% - 75px);
        height: calc(50% - 7.5px);
        /* Adjust module height */
    }

    .header {
        height: 40px;
        padding: 5px 25px;
    }

    .header-branding {
        display: none;
    }

    .header-right {
        margin: auto 0;
    }

    .keyword-info {
        display: none;
    }
}

@media (max-width: 769px) {

    .body {
        justify-content: unset;
    }

    .module,
    .large-module {
        flex: 1 1 calc(50% - 75px);
        /* Adjust module width */
        min-width: calc(50% - 75px);
        height: calc(50% - (45px / 4));
        /* Adjust module height */
    }

    .viewer-outer-container,
    .chat-outer-container,
    .winner-outer-container {
        max-height: 300px;
    }

    .winner-chat {
        margin-left: 0;
    }
    
    .header {
        padding-top: 2px;
        padding-bottom: 2px;
    }

    .draggable {
        padding-top: 0;
        padding-bottom: 0;
    }

    .breadcrumbs a {
        display: none;
    }

    .breadcrumbs a:last-of-type {
        display: none;
    }

}


@media (max-width: 450px) {

    .body {
        justify-content: unset;
    }

    .module,
    .large-module {
        flex: 1 1 100%;
        /* Adjust module width */
        min-width: 100%;
        height: calc(25% - (45px / 4));
        /* Adjust module height */
    }

    .breadcrumbs a {
        display: none;
    }

    .breadcrumbs a:last-of-type {
        display: flex;
    }

    .header-right {
        display: none;
    }

    .viewer-outer-container,
    .chat-outer-container,
    .winner-outer-container {
        max-height: 200px;
    }

    .winner-chat {
        margin-left: auto;
    }

    .footer-content span {
        font-size: smaller;
    }

    .copyright {
        display: none;
    }
}

/* Initial order of modules */
#module-entry {
    order: 1;
}

#module-options {
    order: 2;
    overflow: auto;
}

#module-options::-webkit-scrollbar {
    display: none;
}

#module-winners {
    order: 4;
}

#module-chat {
    order: 3;
}

.draggable {
    display: flex;
    align-items: center;
    cursor: move;
    padding: 5px;
}

.draggable.over {
    background-color: var(--colorB);
    border: 1px dashed var(--colorText);
}

.hide {
    display: none;
}