:root {
    --bg: #EBECF0;
    --white: #FFFFFF;
    --shadow-color: #BABECC;
    --text: #44475a;
    --primary: #5e5ce6;
    --danger: #ff3b30;
    --success: #34c759;

    --outset: -5px -5px 15px var(--white), 5px 5px 15px var(--shadow-color);
    --inset: inset 2px 2px 5px var(--shadow-color), inset -5px -5px 10px var(--white);
    --radius: 16px;
}

* {
    box-sizing: border-box;
    outline: none;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
}

.app-shell {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    height: 100vh;
}

/* HEADER */
.app-header {
    display: flex;
    /* justify-content: space-between; */
    align-items: center;
    padding: 10px 20px;
    margin-bottom: 20px;
    position: sticky;
}
.app-header img {
    height: 40px; /* Adjust based on your icon size */
    width: auto;
    margin-right: 12px;
}
.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 1px;
}

.badge {
    font-size: 10px;
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: middle;
}

.header-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
}

#status-dot {
    font-size: 8px;
    color: var(--success);
}

/* LAYOUT */
.view-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 25px;
    height: calc(100vh - 120px);
}

.setup-sidebar,
.room-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--outset);
}

/* NEUMORPHIC ELEMENTS */
input {
    border: none;
    background: var(--bg);
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: var(--inset);
    font-family: inherit;
    width: 100%;
}

.btn-pro {
    border: none;
    background: var(--bg);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: var(--outset);
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: 0.2s;
}

.btn-pro:active {
    box-shadow: var(--inset);
}

.btn-pro.primary {
    color: var(--primary);
}

.btn-pro.danger {
    color: var(--danger);
}

.btn-pro.large {
    padding: 25px;
    width: 100%;
    font-size: 18px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    box-shadow: var(--outset);
    cursor: pointer;
}

.btn-icon-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    box-shadow: var(--outset);
    cursor: pointer;
    font-size: 18px;
}

/* CHAT AREA */
.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-history {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    border-radius: 12px;
    box-shadow: var(--inset);
}

.chat-message {
    padding: 12px 18px;
    border-radius: 15px;
    max-width: 70%;
    position: relative;
    font-size: 14px;
    box-shadow: var(--outset);
}

.chat-message.sent {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    box-shadow: -4px 4px 10px rgba(94, 92, 230, 0.3);
}

.chat-message.received {
    align-self: flex-start;
    background: var(--bg);
}

/* LISTS (Friends/Members) */
.list-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 300px;
    padding: 5px;
}

.friend-item,
.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-radius: 12px;
    box-shadow: var(--outset);
    font-size: 13px;
    font-weight: 500;
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(235, 236, 240, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: var(--bg);
    padding: 40px;
    border-radius: 25px;
    box-shadow: var(--outset);
    text-align: center;
    width: 320px;
}

.modal-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

.full {
    width: 100%;
}


/* Ensure the input is accessible and stylable */
.input-wrapper-pro {
    flex-grow: 1;
    display: flex;
}

#chat-input {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 15px;
    background: var(--bg);
    box-shadow: var(--inset);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    /* -webkit-appearance: none; Fix for some electron builds */
}

#chat-input:focus {
    box-shadow: inset 1px 1px 3px var(--shadow-color), inset -2px -2px 5px var(--white);
}

/* Chat Input Area Row */
.chat-input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-top: 15px;
    background: var(--bg);
    border-top: 1px solid rgba(0,0,0,0.02);
}
/* Sender Label in Chat */
.msg-sender-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
    opacity: 0.6;
    letter-spacing: 0.5px;
}

/* Sent message label color adjustment (optional) */
.chat-message.sent .msg-sender-label {
    color: #ffffff;
    opacity: 0.9;
}

.chat-message.received .msg-sender-label {
    color: var(--primary);
}

.msg-text-content {
    word-wrap: break-word;
    line-height: 1.4;
}

/* Ensure history scrolls correctly */
.chat-history {
    display: flex;
    flex-direction: column;
    padding: 15px;
}