html{
    min-height: 100%;
}

body{
    min-height: 100vh;
    margin: 0;
    background-color: #B65900;
    color: #B65900;
    font-family: 'Courier New', Courier, monospace;
}
.page-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.chat-page {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}
.main{
    background-color: black;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.main-admin{
    background-color: black;
    min-height: fit-content;
    display: flex;
    flex-direction: column;
}
.custom-button{
    background-color: #B65900;
    min-width: 150px;
    font-weight: bold;
}
.chat-tools {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: .75rem;
}
.author-filter {
    position: relative;
}
.author-filter-panel {
    position: absolute;
    z-index: 1;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    padding: .75rem;
    background-color: #272727;
    border: 1px solid #B65900;
    text-align: left;
}
.author-filter-option {
    display: block;
    color: #FFA52E;
    font-weight: bold;
    white-space: nowrap;
}
.chat-composer {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .75rem;
    flex: 0 0 auto;
}
.chat-action {
    min-width: 0;
}
.chat-action .custom-button,
.chat-action a {
    display: block;
    width: 100%;
}
.chat-action a {
    text-decoration: none;
}
.chat-message-input {
    min-width: 0;
}
.documentation {
    max-width: 48rem;
    margin: 0 auto;
}
.documentation h2 {
    margin-top: 1.5rem;
    color: #FFA52E;
    font-size: 1.25rem;
}
.documentation p,
.documentation li {
    color: #FFA52E;
    font-weight: bold;
}
.documentation-link {
    color: #B65900;
    font-weight: bold;
    text-decoration: none;
    margin-bottom: 1rem;
}
.documentation-link:hover,
.documentation-link:focus {
    color: #B65900;
    text-decoration: underline;
}
h1{
    font-weight: bold;
}
.crew-selection {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem;
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
}
.crew-button {
    flex: 0 0 calc((100% - 2.25rem) / 4);
    min-width: 0;
    white-space: normal;
}

.messages{
    background-color: #272727;
    flex: 1 1 0;
    overflow-y: auto;
    padding: 1rem;
    min-height: 0;
}
.chat-input {
    background-color: #272727;
    border-color: black;
    font-weight: bold;
}
.chat-input:focus {
    background-color: #4F4F4F;
    border-color:cornflowerblue;
    font-weight: bold;
}

.chat-input-org{
    color: greenyellow;
}
.chat-input-org:focus{
    color: greenyellow;
}
.chat-input-posadka{
    color: #FFA52E;
}
.chat-input-posadka:focus{
    color: #FFA52E;
}

.message{
    display: flex;
    cursor: pointer;
}
.message .author{
    margin-right: 1rem;
}
.message .content{
    text-align: left;
    white-space: pre-wrap;
    font-weight: bold;
    overflow-wrap: anywhere;
}
.message .datetime{
    margin-left: auto;
    white-space: nowrap;
}
.message-status {
    margin-left: .5rem;
    min-width: 1.5rem;
    text-align: center;
}
.message-connection{
    color: green;
}
.message-org{
    color: greenyellow;
}
.message-posadka{
    color: #FFA52E;
}
.form{
    display: flex;
    align-items: center;
    flex-direction: column;
}
.textarea{
    background-color: #B65900;
    width: 300px;
}
.documentation-input {
    width: min(700px, 100%);
    color: #1d1d1d;
    background-color: #f0f0f0;
    font-family: monospace;
    text-align: left;
}
.upravit-cleny{
    margin-bottom: 0px;
    font-weight: bold;
}
.custom-label{
    font-weight: bold;
}
.admin-input {
    background-color: #272727;
    border-color: black;
    color: #FFA52E;
    width: 300px;
}
.admin-input:focus {
    background-color: #4F4F4F;
    border-color:cornflowerblue;
    color: #FFA52E;}
.link{
    color:#B65900;
    font-weight: bold;
}
.link:hover{
    color:#B65900;
    font-weight: bold;
    text-decoration: none;
}
.upozorneni-modal{
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgb(0,0,0); /* Fallback color */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}
.modal-content{
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    background-color: #B65900;
    border: 3px solid yellowgreen;
    border-radius: 3px;
    color: black;
    font-weight: bold;
}

/* --- BREAKPOINT --- */
@media (max-width: 550px) {
    body {
        padding: 0;
    }

    .main {
        padding: .75rem !important;
    }

    .chat-tools {
        gap: .5rem;
        margin-bottom: .5rem;
    }

    .chat-tools > button,
    .chat-tools > .author-filter {
        flex: 1 1 0;
        min-width: 0;
    }

    .chat-tools .custom-button {
        width: 100%;
        min-width: 0;
        padding-left: .25rem;
        padding-right: .25rem;
    }

    .chat-composer {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: .5rem;
    }

    .chat-message-input {
        grid-column: 1 / -1;
        order: -1;
        width: 100%;
        max-width: none;
        padding: 0;
    }

    .chat-action {
        width: 100%;
        max-width: none;
        padding: 0;
        display: block;
    }

    .chat-action .custom-button,
    .chat-action a {
        width: 100%;
    }

    .message {
        flex-wrap: wrap;        /* allow items to go to second row */
        align-items: flex-start;
    }

    .message .author {
        order: 0;               /* first on first row */
        margin-right: .5rem;
        font-size: small;
    }

    .message .datetime {
        order: 1;               /* second on first row, pushed to the right */
        margin-left: auto;
        font-size: small;
    }

    .message .content {
        order: 2;               /* whole second row */
        flex-basis: 100%;       /* take full width on second row */
        margin-top: .25rem;
    }
}

@media (max-width: 900px) {
    .page-body {
        padding: 0;
    }

    .main {
        width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    .crew-button {
        flex-basis: calc((100% - 1.5rem) / 3);
    }
}

@media (max-width: 550px) {
    .crew-button {
        flex-basis: calc((100% - .75rem) / 2);
    }

}