@font-face {
    font-family: "Comic";
    src: url("/static/css/fonts/Comic.ttf");
}

@font-face {
    font-family: "Comic Relief";
    src: url("/static/css/fonts/ComicRelief-Regular.ttf");
}


[data-bs-theme="our-theme"] {
    --our-night-sky: #081F39;
    --our-twilight: #223240;
    --our-apricot: #F2A25C;
    --our-pumpkin: #F2784B;
    --our-cranberry: #C55649;

    --our-night-sky-rgb: 8, 31, 57;
    --our-twilight-rgb: 34, 50, 64;
    --our-apricot-rgb: 242, 162, 92;
    --our-pumpkin-rgb: 242, 120, 75;
    --our-cranberry-rgb: 197, 86, 73;

    --our-border-radius: 15px;
    --our-border-width: 1px;
}

.background-primary {
    background: url('/static/media/background_upscale-small.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

body {
    font-family: "Comic Relief", system-ui;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings: "slnt" 0;
}

.comic {
    font-family: "Comic", system-ui;
}

.bold-heavy {
    font-weight: 800;
}

.bold-medium {
    font-weight: 600;
}

.thin {
    font-weight: 100;
}

.text-white {
    font-colour: #ffffff;
}

.btn {
    border-radius: var(--our-border-radius);
}

.btn-outline-primary {
    background-color: transparent !important;
    border: var(--our-border-width) solid var(--our-apricot) !important;
    color: var(--our-apricot) !important;
}

.btn-outline-primary:hover {
    border-color: var(--our-pumpkin) !important;
    color: var(--our-pumpkin) !important;
    background-color: rgba(var(--our-night-sky-rgb), 0.75) !important;
}

.btn-outline-primary:active {
    border-color: var(--our-cranberry) !important;
    color: var(--our-cranberry) !important;
    background-color: rgba(var(--our-night-sky-rgb), 0.75) !important;
}

.btn-primary {
    background-color: var(--our-apricot) !important;
    border: var(--our-border-width) solid var(--our-apricot) !important;
    color: var(--bs-white);
}

.btn-primary:hover {
    border-color: var(--our-pumpkin) !important;
    color: var(--bs-white) !important;
    background-color: var(--our-pumpkin) !important;
}

.btn-primary:active {
    border-color: var(--our-cranberry) !important;
    color: var(--bs-white) !important;
    background-color: var(--our-cranberry) !important;
}

.card {
    color: var(--our-apricot);
    background-color: rgba(var(--our-twilight-rgb), 0.75);
    border: var(--our-border-width) solid var(--our-apricot);
    border-radius: var(--our-border-radius);
}

textarea,
input[type="text"],
input[type="password"],
input[type="datetime"],
input[type="datetime-local"],
input[type="date"],
input[type="month"],
input[type="time"],
input[type="week"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="color"],
select,
.uneditable-input {
    border-color: var(--our-apricot);
    border-width: var(--our-border-width);
    border-radius: var(--our-border-radius);
    background-color: rgba(var(--our-twilight-rgb), 0.75);
    color: var(--our-apricot);
}

textarea:focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="datetime"]:focus,
input[type="datetime-local"]:focus,
input[type="date"]:focus,
input[type="month"]:focus,
input[type="time"]:focus,
input[type="week"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="color"]:focus,
select:focus,
.uneditable-input:focus {
    border-color: var(--our-pumpkin);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(var(--our-pumpkin-rgb), 0.25);
    background-color: rgba(var(--our-night-sky-rgb), 0.75);
    color: var(--our-pumpkin);
}

input::placeholder {
    color: var(--our-apricot) !important;
}

.message {
    padding: 5px 10px;
    margin-bottom: 5px;
    margin-top: 5px;
    border-radius: var(--our-border-radius);
}

.my-message {
    background-color: rgba(var(--our-twilight-rgb), 0.75);
    border: var(--our-border-width) solid var(--our-apricot);
    margin-left: 10%;
    color: #ffffff;
}

.other-message {
    background-color: rgba(var(--our-night-sky-rgb), 0.75);
    border: var(--our-border-width) solid var(--our-pumpkin);
    margin-right: 10%;
    color: #ffffff;
}

.system-message {
    background-color: rgba(var(--our-night-sky-rgb), 0.75);
    border: var(--our-border-width) solid var(--our-cranberry);
    text-align: center;
    color: #ffffff;
}

.message-sender, .message-time {
    font-family: "Comic", system-ui;
    margin-bottom: 5px;
    text-decoration: underline;
    font-weight: bold;
}

/* Гарантируем правильное поведение flex контейнера для чата */
.card-body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

/* Фиксируем высоту чата и включаем прокрутку */
#chat {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    height: 0; /* Это заставляет flexbox правильно распределять пространство */
}

/* Улучшаем скроллбар */
#chat::-webkit-scrollbar {
    width: 6px;
}

#chat::-webkit-scrollbar-track {
    background: rgba(var(--our-night-sky-rgb), 0.75);
    border-radius: 3px;
    border: 1px solid var(--our-apricot);
}

#chat::-webkit-scrollbar-thumb {
    background: var(--our-apricot);
    border-radius: 3px;
}

#chat::-webkit-scrollbar-thumb:hover {
    background: var(--our-pumpkin);
}