:root {
    --bg-main: #0e1621;
    --bg-sidebar: #17212b;
    --bg-header: #17212b;
    --bg-hover: #202b36;
    --bg-active: #2b5278;

    --text-main: #ffffff;
    --text-muted: #7f91a4;
    --text-link: #64b5ef;

    --primary: #5288c1;
    --primary-hover: #4679ae;

    --bubble-in: #182533;
    --bubble-out: #2b5278;

    --border-color: #0e1621;

    --danger: #ef4444;
    --success: #10b981;

    --search-bg: #242f3d;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    display: flex;
    overflow: hidden;
}

.app-container {
    width: 100%;
    height: 100%;
    height: 100dvh;
    display: flex;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    height: 100dvh;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

#login-screen {
    justify-content: center;
    align-items: center;
    background-color: var(--bg-main);
}

.login-box {
    background: var(--bg-sidebar);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo-wrapper {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
}

.login-box h1 {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 10px;
}

.login-box p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-main);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-main);
    font-size: 16px;
    transition: border-color 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.login-box button {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    text-transform: uppercase;
}

.login-box button:hover {
    background: var(--primary-hover);
}

.error-msg {
    color: var(--danger);
    margin-top: 15px;
    font-size: 14px;
    min-height: 20px;
}

#chat-screen {
    display: none;
    width: 100%;
    height: 100%;
}

#chat-screen.active {
    display: flex;
}

.sidebar {
    width: 350px;
    min-width: 350px;
    background-color: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    position: relative;
}

.sidebar-header {
    height: 56px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}

.menu-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--search-bg);
    border-radius: 22px;
    padding: 6px 12px;
    height: 36px;
}

.search-icon {
    color: var(--text-muted);
    margin-right: 8px;
}

#search-input {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    width: 100%;
    outline: none;
}

#search-input::placeholder {
    color: var(--text-muted);
}

.sidebar-controls {
    background: var(--bg-sidebar);
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    text-transform: uppercase;
}

.user-status-controls h2 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.status-select {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    padding: 0;
}

.status-select option {
    background: var(--bg-sidebar);
    color: var(--text-main);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.icon-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s;
    text-align: left;
}

.icon-btn svg {
    color: var(--text-muted);
}

.icon-btn:hover {
    background-color: var(--bg-hover);
}

.contact-list {
    flex: 1;
    overflow-y: auto;
}

.contact-list::-webkit-scrollbar {
    width: 6px;
}

.contact-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.contact-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.contact-item:hover {
    background-color: var(--bg-hover);
}

.contact-item.active {
    background-color: var(--bg-active);
}

.contact-info {
    flex: 1;
    overflow: hidden;
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.contact-name {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-time {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.contact-item.active .contact-time {
    color: rgba(255, 255, 255, 0.7);
}

.contact-last-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.contact-last-msg {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.contact-item.active .contact-last-msg {
    color: #fff;
}

.unread-badge {
    background-color: var(--primary);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    text-align: center;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-item.active .unread-badge {
    background-color: #ffffff;
    color: var(--bg-active);
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
    position: relative;
}

.chat-header {
    height: 56px;
    background-color: var(--bg-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
}

.chat-back-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 4px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.chat-back-btn:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header-info .avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.chat-header-text h3 {
    font-size: 16px;
    font-weight: 500;
}

.status-text {
    font-size: 13px;
    color: var(--text-muted);
}

.chat-header-actions {
    display: flex;
    gap: 10px;
}

.chat-header-actions .icon-btn {
    padding: 8px;
    border-radius: 50%;
    color: var(--text-muted);
    transition: background-color 0.2s;
}

.chat-header-actions .icon-btn:hover {
    background-color: var(--bg-hover);
}

.chat-header-actions .icon-btn svg {
    color: var(--text-muted);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--bg-main);
    display: flex;
    flex-direction: column;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    color: #fff;
    margin: auto;
    background: rgba(30, 44, 58, 0.8);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    max-width: max-content;
}

.message {
    max-width: 75%;
    padding: 8px 12px;
    border-radius: 12px;
    position: relative;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.incoming {
    align-self: flex-start;
    background-color: var(--bubble-in);
    border-bottom-left-radius: 4px;
}

.message.outgoing {
    align-self: flex-end;
    background-color: var(--bubble-out);
    border-bottom-right-radius: 4px;
}

.message.system-msg {
    align-self: center;
    background-color: rgba(23, 33, 43, 0.7);
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    border-radius: 12px;
    max-width: 90%;
    text-align: center;
    padding: 6px 12px;
    margin: 4px 0;
}

.message:not(.system-msg) {
    cursor: pointer;
}

.message-text {
    word-break: break-word;
    white-space: pre-wrap;
}

.message-quote {
    border-left: 3px solid var(--primary);
    background: rgba(0, 0, 0, 0.18);
    padding: 4px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 13.5px;
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
}

.message.outgoing .message-quote {
    border-left-color: #ffffff;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.8);
}

.message-line {
    white-space: pre-wrap;
    word-break: break-word;
}

.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    float: right;
    margin-left: 8px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    user-select: none;
    line-height: 1;
}

.message.outgoing .message-time {
    color: rgba(255, 255, 255, 0.6);
}

.message-check {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.message-status-icon {
    display: inline-block;
    color: var(--text-link);
}

.chat-input-area {
    background-color: var(--bg-sidebar);
    padding: 8px 16px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
}

#message-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    padding: 8px 0;
    resize: none;
    line-height: 1.4;
    max-height: 140px;
    min-height: 22px;
    overflow-y: auto;
}

#message-input::placeholder {
    color: var(--text-muted);
}

.send-btn {
    background: var(--bg-main);
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: color 0.2s, background-color 0.2s;
}

.send-btn:hover {
    color: var(--primary-hover);
    background-color: var(--bg-hover);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-sidebar);
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-content h3 {
    margin-bottom: 20px;
    font-weight: 500;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    background: var(--bg-main);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-main);
    margin-bottom: 15px;
    outline: none;
}

.modal-content input:focus {
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.modal-actions button {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
}

.close-modal-btn {
    background: transparent;
    color: var(--text-link);
}

.close-modal-btn:hover {
    background: var(--bg-hover);
}

.modal-actions button:not(.close-modal-btn) {
    background: var(--text-link);
    color: white;
}

.modal-actions button:not(.close-modal-btn):hover {
    background: var(--primary-hover);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hidden {
    display: none !important;
}

.notifications-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
}

.toast {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 250px;
    animation: slideIn 0.3s ease forwards;
}

.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.toast-text {
    margin-bottom: 12px;
    font-size: 14px;
}

.toast-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.toast-btn {
    background: var(--bg-main);
    color: var(--text-link);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.toast-btn:hover {
    background: var(--bg-hover);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes shake {
    0% {
        transform: translate(1px, 1px) rotate(0deg);
    }

    10% {
        transform: translate(-1px, -2px) rotate(-1deg);
    }

    20% {
        transform: translate(-3px, 0px) rotate(1deg);
    }

    30% {
        transform: translate(3px, 2px) rotate(0deg);
    }

    40% {
        transform: translate(1px, -1px) rotate(1deg);
    }

    50% {
        transform: translate(-1px, 2px) rotate(-1deg);
    }

    60% {
        transform: translate(-3px, 1px) rotate(0deg);
    }

    70% {
        transform: translate(3px, 1px) rotate(-1deg);
    }

    80% {
        transform: translate(-1px, -1px) rotate(1deg);
    }

    90% {
        transform: translate(1px, 2px) rotate(0deg);
    }

    100% {
        transform: translate(1px, -2px) rotate(-1deg);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.group-header {
    padding: 10px 16px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-item:hover {
    background: var(--primary-hover);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer-menu {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--bg-sidebar);
    z-index: 3000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.drawer-menu.active {
    transform: translateX(0);
}

.drawer-header {
    background: var(--bg-sidebar);
    padding: 20px 20px 15px;
    border-bottom: 1px solid var(--border-color);
}

.user-profile-drawer {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-profile-drawer .avatar {
    width: 54px;
    height: 54px;
    font-size: 20px;
}

.user-info-drawer h2 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 2px;
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s;
}

.drawer-item svg {
    color: var(--text-muted);
}

.drawer-item:hover {
    background-color: var(--bg-hover);
}

.tic-tac-toe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 5px;
    background-color: var(--border-color);
    padding: 5px;
    border-radius: 8px;
    margin: 0 auto;
    width: 250px;
    height: 250px;
}

.tic-tac-toe-board .cell {
    background-color: var(--bg-sidebar);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.tic-tac-toe-board .cell:hover {
    background-color: var(--bg-hover);
}

.tic-tac-toe-board .cell.x {
    color: var(--primary);
}

.tic-tac-toe-board .cell.o {
    color: var(--danger);
}

.xstatus-badge {
    display: inline-block;
    font-size: 13px;
    margin-left: 6px;
    color: var(--primary);
    font-weight: normal;
}

.contact-item.active .xstatus-badge {
    color: #fff;
    opacity: 0.8;
}

.status-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
    transition: border-color 0.2s;
}

.contact-item:hover .status-dot {
    border-color: var(--bg-hover);
}

.contact-item.active .status-dot {
    border-color: var(--bg-active);
}

.status-dot.online {
    background-color: var(--success);
}

.status-dot.away {
    background-color: #fbbf24;
}

.profile-modal-content {
    background-color: var(--bg-main);
    padding: 0;
    width: 320px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}

.profile-close-btn:hover {
    color: #fff;
}

.profile-header-area {
    padding: 30px 20px 15px;
    text-align: center;
    background-color: var(--bg-sidebar);
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    background-size: cover;
    background-position: center;
    background-color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
}

.profile-modal-name {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 500;
}

.profile-modal-status {
    font-size: 13px;
    color: var(--text-link);
}

.profile-actions-area {
    background-color: var(--bg-sidebar);
    padding: 0 20px 20px;
    display: flex;
    justify-content: center;
    border-bottom: 10px solid var(--bg-main);
}

.profile-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 12px;
    padding: 12px;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 70px;
    cursor: pointer;
    transition: background 0.2s;
}

.profile-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.profile-action-btn svg {
    margin-bottom: 6px;
}

.profile-action-btn span {
    font-size: 12px;
}

.profile-info-section {
    padding: 10px 0;
}

.profile-info-row {
    padding: 12px 20px;
    display: flex;
    flex-direction: column;
}

.profile-info-row.clickable-row {
    cursor: pointer;
    transition: background 0.2s;
}

.profile-info-row.clickable-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.profile-info-value {
    font-size: 15px;
    margin-bottom: 4px;
}

.profile-info-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

.profile-link-text {
    color: var(--text-link);
    font-size: 14px;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-hover);
    border-radius: 20px;
    transition: .3s;
}
.switch .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: .3s;
}
.switch input:checked + .slider {
    background-color: var(--primary);
}
.switch input:checked + .slider:before {
    transform: translateX(20px);
}

.settings-screen {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 350px;
    background: var(--bg-sidebar);
    z-index: 3100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.settings-screen.active {
    transform: translateX(0);
}

.settings-header {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.settings-back-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.settings-back-btn:hover {
    background-color: var(--bg-hover);
}

.settings-header-title {
    font-size: 20px;
    font-weight: 500;
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.settings-page {
    display: none;
    animation: settingsSlideIn 0.25s ease forwards;
}

.settings-page.active {
    display: block;
}

@keyframes settingsSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.settings-profile-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-bottom: 6px solid var(--bg-main);
}

.settings-profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 22px;
    color: white;
    text-transform: uppercase;
    flex-shrink: 0;
}

.settings-profile-name {
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 3px;
}

.settings-profile-email {
    font-size: 14px;
    color: var(--text-muted);
}

.settings-section {
    padding: 8px 0;
    border-bottom: 6px solid var(--bg-main);
}

.settings-section:last-child {
    border-bottom: none;
}

.settings-section-title {
    padding: 12px 20px 6px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-link);
}

.settings-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background-color 0.15s;
    user-select: none;
}

.settings-item:hover {
    background-color: var(--bg-hover);
}

.settings-item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.settings-item span {
    font-size: 15px;
    font-weight: 400;
}

.settings-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
}

.settings-toggle-row span {
    font-size: 15px;
}

.settings-hint {
    padding: 0 20px 12px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.settings-version {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    body {
        height: 100vh;
        height: 100dvh;
    }

    .app-container {
        height: 100vh;
        height: 100dvh;
    }

    #chat-screen {
        position: relative;
        overflow: hidden;
        height: 100vh;
        height: 100dvh;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        height: 100%;
        border-right: none;
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .chat-area {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
        transform: translateX(100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #chat-screen.chat-open .chat-area {
        transform: translateX(0);
    }

    #chat-screen.chat-open .sidebar {
        transform: translateX(-25%);
    }

    .chat-back-btn {
        display: flex;
    }

    .chat-header {
        padding: 0 10px;
    }

    .chat-header-info {
        gap: 10px;
        flex: 1;
        min-width: 0;
    }

    .chat-header-text {
        min-width: 0;
    }

    .chat-header-text h3 {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .messages-container {
        padding: 12px;
    }

    .message {
        max-width: 85%;
    }

    .chat-input-area {
        padding: 8px 12px;
        gap: 8px;
    }

    #message-input {
        font-size: 16px;
    }

    .settings-screen {
        width: 100%;
        max-width: 100%;
    }

    .drawer-menu {
        width: 85%;
        max-width: 320px;
    }

    .login-box {
        margin: 16px;
        padding: 24px;
        max-width: calc(100% - 32px);
    }

    .modal-content {
        width: calc(100% - 32px);
        margin: 16px;
        padding: 20px;
    }

    .profile-modal-content {
        width: calc(100% - 32px);
        max-width: 340px;
    }
}