
/* =========================================================
   CARLITOS CHAT - COMPLETE STYLE.CSS
========================================================= */

/* ROOT */

:root {
    --background: #0b0b10;
    --background-secondary: #101016;
    --surface: #15151d;
    --surface-light: #1c1c26;
    --surface-2: #20202b;
    --surface-3: #292936;

    --primary: #dc143c;
    --primary-light: #f43f5e;
    --primary-dark: #a80f32;

    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;

    --text: #f5f5f7;
    --muted: #92929f;
    --muted-light: #c4c4cf;

    --border: rgba(255, 255, 255, 0.07);
    --border-light: rgba(255, 255, 255, 0.11);

    --shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
}

/* GLOBAL */

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #393944 transparent;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: var(--primary-light);
}

.d-none {
    display: none !important;
}

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

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

::-webkit-scrollbar-thumb {
    background: #393944;
    border-radius: 20px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555562;
}

/* =========================================================
   CHAT LAYOUT
========================================================= */

.chat-container {
    display: flex;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    background: var(--background);
}

/* SIDEBAR */

.sidebar {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    width: 340px;
    min-width: 300px;
    height: 100%;
    overflow: hidden;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

/* SIDEBAR HEADER */

.sidebar-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 76px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 5px 18px rgba(220, 20, 60, 0.25);
}

.brand-info h1,
.brand-info h2,
.brand-info h4,
.brand-info strong {
    margin: 0;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 800;
}

.brand-info small {
    display: block;
    margin-top: 3px;
    color: var(--muted-light) !important;
    font-size: 10px;
}

/* =========================================================
   NOTIFICATIONS
========================================================= */

.notification-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-light);
    color: var(--muted-light);
    font-size: 17px;
    transition: 0.2s ease;
}

.notification-btn:hover {
    border-color: rgba(220, 20, 60, 0.4);
    background: rgba(220, 20, 60, 0.12);
    color: var(--primary-light);
}

.notification-btn:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 3px;
}

#notificationBadge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid var(--surface);
    border-radius: 20px;
    background: var(--primary);
    color: #ffffff !important;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
}

/* BACKDROP */

.notification-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.notification-backdrop.d-none {
    display: none !important;
}

/* CENTERED NOTIFICATION PANEL */

.notification-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 9999;

    display: flex;
    flex-direction: column;

    width: 420px;
    max-width: calc(100vw - 30px);

    height: min(550px, calc(100dvh - 40px));
    max-height: calc(100dvh - 40px);
    min-height: 180px;

    overflow: hidden;

    border: 1px solid var(--border-light);
    border-radius: 17px;

    background: #181820;
    color: #ffffff;

    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6);

    transform: translate(-50%, -50%);
    animation: notificationAppear 0.22s ease;
}

.notification-panel.d-none {
    display: none !important;
}

/* CENTERED PANEL ANIMATION */

@keyframes notificationAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -47%) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* PANEL HEADER */

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
    min-height: 72px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--border);
    background: #181820;
}

.notification-heading {
    display: flex;
    flex: 1;
    min-width: 0;
}

.notification-title-row {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.notification-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 11px;
    background: rgba(220, 20, 60, 0.1);
    color: var(--primary-light);
    font-size: 17px;
}

.notification-panel-header h5 {
    margin: 0;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 800;
}

.notification-panel-header small {
    display: block;
    margin-top: 4px;
    color: var(--muted-light) !important;
    font-size: 10px;
}

.close-notification-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-light);
    color: var(--muted-light);
    font-size: 13px;
    transition: 0.2s ease;
}

.close-notification-btn:hover {
    border-color: rgba(220, 20, 60, 0.3);
    background: rgba(220, 20, 60, 0.12);
    color: #ffffff;
}

/* TOOLBAR */

.notification-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
    min-height: 50px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    background: #15151d;
}

.notification-toolbar > span {
    overflow: hidden;
    color: var(--muted-light) !important;
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mark-all-read-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
    padding: 7px 10px;
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 7px;
    background: rgba(220, 20, 60, 0.08);
    color: #ff536f !important;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    transition: 0.2s ease;
}

.mark-all-read-btn:hover {
    background: rgba(220, 20, 60, 0.18);
    color: #ff8094 !important;
}

/* NOTIFICATION LIST */

.notifications-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #181820;
    scrollbar-width: thin;
    scrollbar-color: #393944 transparent;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
    padding: 14px 16px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: #ffffff;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.045);
}

.notification-item.unread {
    background: rgba(220, 20, 60, 0.08);
}

.notification-item.unread:hover {
    background: rgba(220, 20, 60, 0.13);
}

/* NOTIFICATION AVATAR */

.notification-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    flex: 0 0 42px;
    overflow: hidden;
    border-radius: 50%;
    background: var(--surface-3);
    color: #ffffff;
}

.notification-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* NOTIFICATION CONTENT */

.notification-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    text-align: left;
}

.notification-content strong {
    display: block;
    width: 100%;
    margin-bottom: 4px;
    overflow: hidden;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-content span,
.notification-description {
    display: block;
    width: 100%;
    overflow-wrap: anywhere;
    color: #c0c0cc !important;
    font-size: 11px;
    line-height: 1.5;
    text-align: left;
}

.notification-time {
    display: block;
    margin-top: 6px;
    color: #92929f !important;
    font-size: 10px;
}

/* LOADING */

.notification-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 120px;
    padding: 20px;
    color: var(--muted-light) !important;
    font-size: 11px;
}

.notification-loading .spinner-border {
    width: 17px;
    height: 17px;
    color: var(--primary-light);
}

/* EMPTY STATE */

.notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    padding: 20px;
    text-align: center;
}

.notification-empty.d-none {
    display: none !important;
}

.notification-empty-icon {
    margin-bottom: 12px;
    color: var(--primary-light);
    font-size: 27px;
}

.notification-empty strong {
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 700;
}

.notification-empty small {
    margin-top: 5px;
    color: var(--muted-light) !important;
    font-size: 10px;
}

/* =========================================================
   SEARCH
========================================================= */

.sidebar-search {
    flex-shrink: 0;
    padding: 18px 18px 10px;
}

.sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
}

.sidebar-title h5 {
    margin: 0;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 800;
}

.sidebar-title span {
    color: var(--muted-light) !important;
    font-size: 10px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper > i {
    position: absolute;
    left: 13px;
    color: var(--muted-light);
    font-size: 14px;
    pointer-events: none;
}

.search-wrapper input {
    width: 100%;
    height: 41px;
    padding: 0 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    background: var(--background);
    color: #ffffff !important;
    font-size: 11px;
}

.search-wrapper input::placeholder {
    color: var(--muted-light);
}

.search-wrapper input:focus {
    border-color: rgba(220, 20, 60, 0.6);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.08);
}

#clearSearchBtn {
    position: absolute;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--muted-light);
}

#clearSearchBtn:hover {
    color: #ffffff;
    background: var(--surface-3);
}

.search-label {
    display: block;
    margin-top: 9px;
    color: var(--muted-light) !important;
    font-size: 10px;
}

/* =========================================================
   RECENT CHAT LIST
========================================================= */

.user-list {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    padding: 8px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    text-align: left;
    background: var(--surface);
}

.user-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 0;
    min-height: 68px;
    flex: 0 0 auto;
    margin: 0 0 5px;
    padding: 10px 11px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: #ffffff !important;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.user-item:last-child {
    margin-bottom: 0;
}

.user-item:hover {
    border-color: var(--border);
    background: rgba(255, 255, 255, 0.035);
}

.user-item.active {
    border-color: rgba(220, 20, 60, 0.32);
    background: rgba(220, 20, 60, 0.09);
}

/* AVATAR */

.user-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    max-width: 44px;
    flex: 0 0 44px;
    overflow: visible;
    border-radius: 50%;
    background-color: var(--surface-3);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 800;
}

.user-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar.has-image {
    color: transparent;
}

.user-avatar .online-dot {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 3;
    width: 11px;
    height: 11px;
    min-width: 11px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: #777;
    box-sizing: border-box;
}

.user-avatar .online-dot.online {
    background: var(--success);
}

/* USER DETAILS */

.user-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    text-align: left;
}

.user-details strong {
    display: block;
    width: 100%;
    overflow: hidden;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-align: left !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-details small {
    display: block;
    width: 100%;
    margin-top: 5px;
    overflow: hidden;
    color: #b0b0bd !important;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.4;
    text-align: left !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-time {
    flex-shrink: 0;
    margin-left: auto;
    color: #92929f !important;
    font-size: 9px;
    text-align: right;
    white-space: nowrap;
}

.unread-badge {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 20px;
    background: var(--primary);
    color: #ffffff !important;
    font-size: 9px;
    font-weight: 800;
    text-align: center;
}

/* =========================================================
   PROFILE SECTION
========================================================= */

.profile-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 76px;
    padding: 12px 15px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.12);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.profile-avatar {
    display: block;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: 2px solid rgba(220, 20, 60, 0.35);
    border-radius: 50%;
    background: var(--surface-3);
    object-fit: cover;
}

.profile-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.profile-details strong {
    overflow: hidden;
    color: #ffffff !important;
    font-size: 12px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-details small {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    color: var(--muted-light) !important;
    font-size: 10px;
}

.profile-details small::before {
    content: "";
    width: 7px;
    height: 7px;
    min-width: 7px;
    border-radius: 50%;
    background: #777;
}

.profile-details small.online {
    color: var(--success) !important;
}

.profile-details small.online::before {
    background: var(--success);
}

.profile-details small.offline::before {
    background: #777;
}

.profile-actions {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 7px;
}

.settings-btn,
.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-light);
    color: var(--muted-light);
    font-size: 14px;
    transition: 0.2s;
}

.settings-btn:hover {
    border-color: rgba(220, 20, 60, 0.35);
    background: rgba(220, 20, 60, 0.12);
    color: var(--primary-light);
}

.logout-btn:hover {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.12);
    color: #ff6677;
}

/* =========================================================
   MAIN CHAT
========================================================= */

.chat-main {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background:
        radial-gradient(circle at 50% 45%, rgba(220, 20, 60, 0.035), transparent 55%),
        var(--background);
}

.empty-chat {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.empty-chat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    height: 90px;
    margin-bottom: 22px;
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 28px;
    background: rgba(220, 20, 60, 0.08);
    color: var(--primary-light);
    font-size: 35px;
}

.empty-chat h3 {
    margin: 0 0 10px;
    color: #ffffff !important;
    font-size: 20px;
    font-weight: 800;
}

.empty-chat p {
    max-width: 320px;
    margin: 0;
    color: var(--muted-light) !important;
    font-size: 12px;
    line-height: 1.7;
}

/* CHAT PANEL */

.chat-panel {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

/* CHAT HEADER */

.chat-header {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 75px;
    padding: 13px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(21, 21, 29, 0.9);
}

.chat-avatar {
    display: block;
    width: 43px;
    height: 43px;
    min-width: 43px;
    border: 1px solid var(--border-light);
    border-radius: 50%;
    background: var(--surface-3);
    object-fit: cover;
}

.chat-user-info {
    flex: 1;
    min-width: 0;
}

.chat-user-info h5,
.chat-user-info strong {
    display: block;
    margin: 0;
    overflow: hidden;
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-user-info small {
    display: block;
    margin-top: 5px;
    color: var(--muted-light) !important;
    font-size: 10px;
}

.chat-user-info small.online {
    color: var(--success) !important;
}

.mobile-back-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-light);
    color: #ffffff;
    font-size: 17px;
}

/* =========================================================
   MESSAGES
========================================================= */

.chat-messages {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding: 24px 25px;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: transparent;
}

.empty-messages {
    margin: auto;
    padding: 25px;
    color: var(--muted-light) !important;
    font-size: 11px;
    text-align: center;
}

.message-wrapper {
    display: flex;
    width: 100%;
    margin-bottom: 13px;
}

.message-wrapper.sent {
    justify-content: flex-end;
}

.message-wrapper.received {
    justify-content: flex-start;
}

.message-bubble {
    position: relative;
    max-width: min(70%, 520px);
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface-light);
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.message-wrapper.received .message-bubble {
    border-top-left-radius: 4px;
    background: #20202b;
}

.message-wrapper.sent .message-bubble {
    border-color: rgba(220, 20, 60, 0.2);
    border-top-right-radius: 4px;
    background: linear-gradient(135deg, #bd1538, #8f102c);
    color: #ffffff !important;
}

.message-content {
    overflow-wrap: anywhere;
    color: inherit !important;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.message-time {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 9px;
    text-align: right;
}

.message-wrapper.received .message-time {
    color: var(--muted-light) !important;
}

/* MESSAGE INPUT */

.message-input-area {
    display: flex;
    align-items: flex-end;
    gap: 11px;
    padding: 17px 22px;
    border-top: 1px solid var(--border);
    background: rgba(21, 21, 29, 0.9);
}

#messageInput {
    flex: 1;
    min-width: 0;
    min-height: 45px;
    max-height: 130px;
    padding: 13px 15px;
    resize: none;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    outline: none;
    background: var(--background);
    color: #ffffff !important;
    font-size: 12px;
    line-height: 1.5;
}

#messageInput::placeholder {
    color: var(--muted-light);
}

#messageInput:focus {
    border-color: rgba(220, 20, 60, 0.6);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.07);
}

#messageInput:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

#sendMessageBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    min-width: 45px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #ffffff;
    font-size: 17px;
    transition: 0.2s;
}

#sendMessageBtn:hover:not(:disabled) {
    transform: translateY(-2px);
}

#sendMessageBtn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

/* =========================================================
   PROFILE SETTINGS MODAL
========================================================= */

.settings-modal {
    border: 1px solid var(--border-light) !important;
    border-radius: 18px !important;
    background: var(--surface) !important;
    color: #ffffff !important;
    box-shadow: var(--shadow);
}

.settings-modal .modal-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.settings-modal .modal-title {
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 800;
}

.settings-modal .modal-title i {
    color: var(--primary-light);
}

.settings-modal .btn-close {
    filter: invert(1);
    opacity: 0.75;
}

.settings-modal .btn-close:hover {
    opacity: 1;
}

.settings-modal .modal-body {
    padding: 24px;
    background: var(--surface);
    color: #ffffff;
}

.profile-upload-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 22px 18px;
    border: 1px dashed var(--border-light);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.02);
}

.profile-preview-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
}

.settings-avatar-preview {
    display: block;
    width: 100px;
    height: 100px;
    border: 3px solid rgba(220, 20, 60, 0.4);
    border-radius: 50%;
    background: var(--surface-3);
    object-fit: cover;
}

#settingsUsername {
    margin: 0;
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 800;
    text-align: center;
}

.profile-upload-section p {
    margin: 0;
    color: #c4c4cf !important;
    font-size: 12px;
    text-align: center;
}

#avatarFileInput {
    width: 100%;
    min-height: 43px;
    padding: 9px 10px;
    border: 1px solid var(--border-light);
    border-radius: 9px;
    background: var(--background);
    color: #ffffff !important;
    font-size: 11px;
}

#avatarFileInput::file-selector-button {
    margin: -3px 10px -3px -3px;
    padding: 7px 11px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

#avatarFileInput::file-selector-button:hover {
    background: var(--primary-dark);
}

#avatarFileInput:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.08);
}

.settings-modal .profile-upload-section .text-muted,
.profile-upload-section small {
    color: #a5a5b2 !important;
    font-size: 10px;
    line-height: 1.6;
    text-align: center;
}

#avatarUploadMessage {
    margin-top: 15px;
    border-radius: 9px;
    font-size: 11px;
    line-height: 1.6;
}

#avatarUploadMessage.alert-success {
    border: 1px solid rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.08);
    color: #4ade80 !important;
}

#avatarUploadMessage.alert-danger {
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.08);
    color: #ff8796 !important;
}

#avatarUploadMessage.alert-warning {
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: rgba(245, 158, 11, 0.08);
    color: #fbbf24 !important;
}

.settings-modal .modal-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.settings-modal .modal-footer .btn {
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
}

.settings-modal .modal-footer .btn-secondary {
    border: 1px solid var(--border-light);
    background: var(--surface-3);
    color: #ffffff !important;
}

.settings-modal .modal-footer .btn-secondary:hover {
    background: #373744;
}

.settings-modal .modal-footer .btn-primary {
    border: none;
    background: var(--primary);
    color: #ffffff !important;
}

.settings-modal .modal-footer .btn-primary:hover {
    background: var(--primary-dark);
}

.modal-backdrop.show {
    opacity: 0.75;
}

/* =========================================================
   LOGIN AND REGISTER
========================================================= */

.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 15% 20%, rgba(225, 29, 72, 0.13), transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(168, 15, 50, 0.12), transparent 35%),
        var(--background);
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 30px 18px;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 430px;
    padding: 42px 38px 30px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: 22px;
    background: rgba(18, 18, 25, 0.94);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(20px);
    animation: authCardAppear 0.5s ease;
}

.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--primary-light), transparent);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 65px;
    height: 65px;
    margin: 0 auto 22px;
    border: 1px solid rgba(225, 29, 72, 0.25);
    border-radius: 19px;
    background: linear-gradient(145deg, rgba(225, 29, 72, 0.2), rgba(168, 15, 50, 0.12));
    color: var(--primary-light);
    font-size: 29px;
}

.auth-title {
    margin: 0;
    color: #ffffff !important;
    font-size: 29px;
    font-weight: 900;
    letter-spacing: -1px;
    text-align: center;
}

.auth-title span {
    color: var(--primary-light) !important;
}

.auth-subtitle {
    margin: 10px 0 30px;
    color: var(--muted-light) !important;
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

.auth-form {
    width: 100%;
}

.auth-form .mb-3 {
    margin-bottom: 21px !important;
}

.auth-form .form-label {
    display: block;
    margin-bottom: 9px;
    color: var(--muted-light) !important;
    font-size: 12px;
    font-weight: 700;
}

.auth-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-group > i:first-child {
    position: absolute;
    left: 15px;
    z-index: 2;
    color: var(--muted-light);
    font-size: 16px;
    pointer-events: none;
}

.auth-input-group .form-control {
    width: 100%;
    height: 49px;
    padding: 0 45px;
    border: 1px solid var(--border-light);
    border-radius: 11px;
    outline: none;
    background: var(--background);
    color: #ffffff !important;
    font-size: 12px;
    box-shadow: none;
    transition: 0.2s;
}

.auth-input-group .form-control::placeholder {
    color: #92929f !important;
}

.auth-input-group .form-control:focus {
    border-color: var(--primary);
    background: var(--background);
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.1);
}

.password-toggle {
    position: absolute;
    right: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 7px;
    background: transparent;
    color: var(--muted-light);
    font-size: 16px;
}

.password-toggle:hover {
    background: var(--surface-3);
    color: #ffffff;
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 49px;
    margin-top: 10px;
    border: none;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 7px 20px rgba(225, 29, 72, 0.2);
    transition: 0.2s;
}

.auth-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(225, 29, 72, 0.3);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-message {
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.09);
    color: #ff8796 !important;
    font-size: 12px;
    line-height: 1.6;
}

.auth-message.success {
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.08);
    color: #4ade80 !important;
}

.auth-message.d-none {
    display: none !important;
}

.auth-footer {
    margin-top: 27px;
    color: var(--muted-light) !important;
    font-size: 12px;
    text-align: center;
}

.auth-footer a {
    margin-left: 4px;
    color: var(--primary-light) !important;
    font-weight: 700;
    text-decoration: none;
}

.auth-footer a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

.auth-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 27px;
    padding-top: 19px;
    border-top: 1px solid var(--border);
    color: var(--muted-light) !important;
    font-size: 10px;
}

.auth-bottom i {
    color: var(--success);
    font-size: 14px;
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes authCardAppear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {
    .sidebar {
        width: 300px;
        min-width: 280px;
    }

    .chat-messages {
        padding: 20px 17px;
    }

    .message-bubble {
        max-width: 80%;
    }
}

@media (max-width: 600px) {
    .sidebar {
        width: 100%;
        min-width: 0;
        border-right: none;
    }

    .chat-main {
        display: none;
        width: 100%;
        min-width: 0;
    }

    body.mobile-chat-open .sidebar {
        display: none;
    }

    body.mobile-chat-open .chat-main {
        display: flex;
    }

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

    .chat-header {
        min-height: 65px;
        gap: 10px;
        padding: 10px 13px;
    }

    .chat-messages {
        padding: 17px 13px;
    }

    .message-bubble {
        max-width: 85%;
    }

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

    #messageInput {
        min-height: 43px;
        padding: 11px 12px;
    }

    #sendMessageBtn {
        width: 43px;
        height: 43px;
        min-width: 43px;
    }

    .notification-panel {
        width: calc(100vw - 24px);
        max-width: 420px;
        height: min(500px, calc(100dvh - 30px));
        max-height: calc(100dvh - 30px);
    }

    .notification-panel-header {
        min-height: 65px;
        padding: 11px 13px;
    }

    .notification-toolbar {
        min-height: 45px;
        padding: 8px 12px;
    }

    .notification-item {
        padding: 12px;
    }

    .notification-avatar {
        width: 36px;
        height: 36px;
        min-width: 36px;
        flex-basis: 36px;
    }

    .settings-modal .modal-body {
        padding: 18px;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 20px 14px;
    }

    .auth-card {
        padding: 34px 23px 25px;
        border-radius: 18px;
    }

    .auth-logo {
        width: 58px;
        height: 58px;
        font-size: 25px;
    }

    .auth-title {
        font-size: 26px;
    }

    .auth-subtitle {
        margin-bottom: 25px;
        font-size: 12px;
    }

    .notification-panel-header {
        gap: 6px;
        padding: 12px;
    }

    .mark-all-read-btn {
        padding: 6px;
        font-size: 9px;
    }

    .notification-item {
        padding: 11px;
    }

    .settings-modal .modal-dialog {
        margin: 12px;
    }
}

@media (max-width: 360px) {
    .notification-title-row {
        gap: 7px;
    }

    .notification-header-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .mark-all-read-btn {
        padding: 6px;
        font-size: 9px;
    }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.message-receipt {
    display: block;
    width: 100%;
    margin-top: 4px;
    text-align: right;
    font-size: 10px;
    line-height: 1.3;
    color: #a1a1aa;
    font-weight: 400;
}

.message-receipt.delivered {
    color: #c4c4cc;
}

.message-receipt.seen {
    color: #60a5fa;
    font-weight: 600;
}