* {
    font-family: 'Segoe UI';
}

/* .devoutline {
    border: 1px solid black;
    color: white;
} */

body {
    width: 100vw;
    height: 100vh;

    margin: 0;
    overflow: hidden;

    background-color: #333F48;

    display: flex;
    flex-direction: row;

    align-items: center;
    justify-content: space-evenly;
}

#sidebar {
    width: 20%;
    height: 95%;

    background-color: #333F48;
    
    border: 1px solid black;

    display: flex;
    flex-direction: column;
    gap: 0.5rem;

    padding: 0 0.5rem 0 0.5rem;
    
    align-items: center;
}

#sidebar * {
    width: 90%;
}

#channelJoin {
    height: 32%;
}

#channel-list {
    height: 58%;
    
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.channel-item {
    padding: 6px 12px;
    color: #717C7D;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-family: 'Consolas', 'Courier New', monospace;
}

.channel-hash {
    color: #5B6770;
    margin-right: 5px;
}

.channel-item:hover {
    background-color: #25282A;
    color: #919D9D;
}

.channel-item.active-channel {
    background-color: #25282A;
    color: #00A3E0;
    font-weight: bold;
}

.channel-item.active-channel .channel-hash {
    color: #00A3E0;
}

#userProfile {
    height: 8%;
}

#channelContainer {
    width: 75%;
    height: 95%;

    background-color: #25282A;

    border: 1px solid #1D252D;
    border-radius: 4px;

    display: flex;
    flex-direction: column;
}

#chat-box {
    width: 100%;
    height: 95%;

    display: flex;
    flex-direction: column;

    overflow-y: auto;
    font-size: 14px;
    padding: 20px;;
}

#chat-box > * {
    font-family: monospace;
}

.chat-message {
    display: grid;
    grid-template-columns: 120px 1fr;

    gap: 15px;
    margin-bottom: 4px;
    line-height: 1.4;
    /* background-color: #131E29; */

    font-size: 14px;
}

.chat-username {
    text-align: right;
    color: #00A3E0;
    font-weight: bold;

    border-right: 1px solid #5B6770;
    padding-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-content {
    text-align: left;
    color: #BEC6C4;
    word-break: break-word;
}

.chat-continuation {
    text-align: right;
    color: #5B6770;
    border-right: 1px solid #5B6770;
    padding-right: 10px;
}

#message-form {
    width: 100%;
    height: 5%;

    display: flex;
    flex-direction: row;
}

#message-input {
    width: 90%;
    height: 100%;

    background-color: #505759;
    border: 2px solid #333F48;
    border-right: 0;
    
    color: #D2D6D6;
    padding: 0.75rem 1rem 0.75rem 1rem; 
    border-radius: 5px 0 0 5px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease-in-out;

}

#message-send {
    width: 10%;
    height: 100%;

    border: 0;
    border-radius: 0;

    color: white;
    background-color: #FFA400;
    font-weight: 900;

    border: 2px solid #333F48;
    border-left: 0;
    border-radius: 0 5px 5px 0;
}

#message-send:hover {
    background-color: #ED8B00;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    color: #D2D6D6;
    border-bottom: 1px solid #5B6770;
    margin-bottom: 10px;
}

.sidebar-add-btn {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    background-color: transparent;
    color: #717C7D;
    border: 1px dashed #5b6770;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}
.sidebar-add-btn:hover {
    color: #D2D6D6;
    border-color: #00A3E0;
    background-color: rgba(0, 163, 224, 0.1);
}

.icon-btn:hover { color: #00A3E0 }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, .7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.hidden { display: none !important;}

.modal-content {
    background-color: #505759;
    padding: 24px;
    border-radius: 8px;
    width: 400px;
    color: #D2D6D6;
}

.modal-content h2 { margin-top: 0; margin-bottom: 20px; }
.modal-content label { 
    display: block; 
    font-size: 12px; 
    font-weight: bold; 
    margin-bottom: 8px;
    color: #D2D6D6;
}

.input-group {
    display: flex;
    background-color: #25282A;
    border: 1px solid #5B6770;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 24px;
}

.input-group:focus-within { border-color: #00A3E0; }
.hash-prefix { color: #717C7D; margin-right: 8px; font-weight: bold;}

.input-group input {
    background: none;
    border: none;
    color: #D2D6D6;
    width: 100%;
    outline: none;
    font-family: monospace;
}

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.btn-secondary { 
    background: none; 
    border: none;
    color: #D2D6D6;
    cursor: pointer;
    padding: 10px 15px;
}
.btn-secondary:hover {text-decoration: underline;}
.btn-primary { 
    background-color: #FFA400; 
    color: #25282A;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}
.btn-primary:hover { background-color: #ED8B00;}

/* --- MODAL TABS --- */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #5B6770; 
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    color: #717C7D; 
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #BEC6C4; 
}

.tab-btn.active {
    color: #00A3E0; 
    border-bottom: 2px solid #00A3E0;
}


#join-error {
    color: #E40046;
    font-size: 12px;
    margin-top: -15px;
    margin-bottom: 15px;
    font-weight: bold;
}

#sidebar { width: 18%; }
#channelContainer { width: 58%; }

#members-sidebar {
    width: 18%;
    height: 95%;
    background-color: #333F48;
    border: 1px solid black;
    display: flex;
    flex-direction: column;
    padding: 0 0.5rem;
}

#member-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    font-family: 'Consolas', 'Courier New', monospace;
    border-radius: 0 4px 4px 0;
    font-size: 14px;
}

.member-item.online {
    color: #D2D6D6;
    border-left: 3px solid #2ecc71; 
    background-color: rgba(46, 204, 113, 0.05); 
}

.member-item.offline {
    color: #5B6770;
    border-left: 3px solid transparent; 
}

.member-role {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}


.member-role.owner {
    color: #FFA400;
    background-color: rgba(255, 164, 0, 0.1);
    border: 1px solid rgba(255, 164, 0, 0.2);
}


.member-role.moderator {
    color: #00A3E0;
    background-color: rgba(0, 163, 224, 0.1);
    border: 1px solid rgba(0, 163, 224, 0.2);
}