/* ============================================
   CHAT SIDEBAR & SETTINGS PANEL STYLES
   ============================================ */

/* =====================
   LIGHT THEME (Default)
   ===================== */

/* Chat Sidebar Container */
.chat-sidebar-container {
    width: 320px;
    position: fixed;
    right: -320px;
    top: 0;
    bottom: 0;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15);
}

.chat-sidebar-open .chat-sidebar-container {
    right: 0;
}

.chat-sidebar {
    height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e0e0e0;
}

/* Tabs */
.chat-sidebar .nav-tabs {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0;
    border-bottom: none;
    display: flex;
}

.chat-sidebar .nav-tabs .nav-item {
    flex: 1;
    margin: 0;
}

.chat-sidebar .nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    padding: 18px 15px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    font-size: 14px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    background: transparent;
}

.chat-sidebar .nav-tabs .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.chat-sidebar .nav-tabs .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-bottom: 3px solid #fff;
}

.chat-sidebar .nav-tabs .nav-link .material-icons {
    font-size: 20px;
}

.chat-sidebar .nav-tabs .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 50%;
}

/* Tab Content */
.chat-sidebar .tab-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-sidebar .tab-pane {
    height: 100%;
    display: none;
    flex-direction: column;
}

.chat-sidebar .tab-pane.active {
    display: flex;
}

/* Chat List */
.chat-sidebar-chat {
    background: #f8f9fa;
}

.chat-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.chat-sidebar-chat-users {
    height: 100%;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #eeeeee;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.chat-header .list-heading {
    font-size: 14px;
    font-weight: 600;
    color: #1a1f2e;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User List */
.media-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.media-list .media {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #ffffff;
    transition: all 0.3s;
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.media-list .media:hover {
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transform: translateX(-3px);
    border-color: #667eea;
}

.media-object {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Status Dot - Always Visible */
.status-dot {
    position: absolute;
    bottom: 8px;
    left: 38px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    z-index: 2;
}

.status-dot.online { background: #2dce89; }
.status-dot.busy { background: #f5365c; }
.status-dot.away { background: #fb8c00; }
.status-dot.offline { background: #c3c4c7; }

/* Message Counter - Right Side */
.message-counter {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: auto;
    padding: 2px;
}

.media-body {
    flex: 1;
    min-width: 0;
}

.media-heading {
    font-size: 14px;
    font-weight: 600;
    color: #1a1f2e;
    margin: 0 0 4px;
}

.media-heading-sub {
    font-size: 12px;
    color: #677788;
    margin: 0;
}

.media-heading-small {
    font-size: 11px;
    color: #adb5bd;
    margin: 4px 0 0;
}

/* Settings Panel */
.chat-sidebar-settings {
    background: #f8f9fa;
}

.chat-sidebar-settings-list {
    padding: 15px;
    height: 100%;
    overflow-y: auto;
}

.chat-sidebar-settings .chat-header {
    background: transparent;
    padding: 10px 0;
    border-bottom: none;
    margin-bottom: 10px;
}

.chat-sidebar-settings .chat-header .list-heading {
    font-size: 13px;
    color: #677788;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.settings-list {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 18px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.3s;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item:hover {
    background: #f8f9fa;
}

.setting-text {
    font-size: 14px;
    color: #1a1f2e;
    font-weight: 500;
}

/* Custom Select */
.setting-set select {
    padding: 8px 30px 8px 12px;
    border-radius: 8px;
    border: 1px solid #e4e7ed;
    background: #f8f9fa;
    color: #1a1f2e;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23677788' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.setting-set select:hover {
    border-color: #667eea;
}

.setting-set select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Disabled Settings */
.setting-item.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.setting-item.disabled .setting-set select {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

/* Switch Toggle */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #c3c4c7;
    transition: 0.3s;
    border-radius: 24px;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

/* Visual Only Labels */
.setting-item.visual-only {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.setting-item.visual-only .setting-text {
    font-size: 13px;
    color: #677788;
}

.visual-toggle-group {
    display: flex;
    gap: 8px;
    width: 100%;
}

.visual-toggle-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e4e7ed;
    background: #ffffff;
    border-radius: 8px;
    font-size: 12px;
    color: #677788;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.visual-toggle-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.visual-toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #ffffff;
}


/* =====================
   DARK THEME
   ===================== */

.dark-theme .chat-sidebar-container {
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

.dark-theme .chat-sidebar {
    background: #1e222b;
    border-left: 1px solid #2d3038;
}

/* Dark Tabs */
.dark-theme .chat-sidebar .nav-tabs {
    background: linear-gradient(135deg, #2d3038 0%, #1e222b 100%);
}

.dark-theme .chat-sidebar .nav-tabs .nav-link {
    color: rgba(255, 255, 255, 0.5);
}

.dark-theme .chat-sidebar .nav-tabs .nav-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.dark-theme .chat-sidebar .nav-tabs .nav-link.active {
    color: #ffffff;
    background: rgba(102, 126, 234, 0.3);
    border-bottom: 3px solid #667eea;
}

/* Dark Chat List */
.dark-theme .chat-sidebar-chat {
    background: #1a1f2e;
}

.dark-theme .chat-header {
    background: #1e222b;
    border-bottom: 1px solid #2d3038;
}

.dark-theme .chat-header .list-heading {
    color: #e0e0e0;
}

/* Dark User List */
.dark-theme .media-list .media {
    background: #1e222b;
    border: 1px solid #2d3038;
}

.dark-theme .media-list .media:hover {
    background: #252a35;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border-color: #667eea;
}

.dark-theme .media-object {
    border: 2px solid #2d3038;
}

.dark-theme .status-dot {
    border-color: #1e222b;
}

.dark-theme .media-heading {
    color: #e0e0e0;
}

.dark-theme .media-heading-sub {
    color: #8b92a5;
}

.dark-theme .media-heading-small {
    color: #677788;
}

/* Dark Settings Panel */
.dark-theme .chat-sidebar-settings {
    background: #1a1f2e;
}

.dark-theme .chat-sidebar-settings .chat-header .list-heading {
    color: #8b92a5;
}

.dark-theme .settings-list {
    background: #1e222b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.dark-theme .setting-item {
    border-bottom: 1px solid #2d3038;
}

.dark-theme .setting-item:hover {
    background: #252a35;
}

.dark-theme .setting-text {
    color: #e0e0e0;
}

/* Dark Select */
.dark-theme .setting-set select {
    background: #252a35;
    border-color: #2d3038;
    color: #e0e0e0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b92a5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.dark-theme .setting-set select:hover {
    border-color: #667eea;
}

.dark-theme .setting-set select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Dark Switch */
.dark-theme .switch .slider {
    background-color: #2d3038;
}

.dark-theme .switch .slider:before {
    background-color: #1a1f2e;
}

.dark-theme .switch input:checked + .slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Dark Visual Toggle */
.dark-theme .visual-toggle-btn {
    background: #252a35;
    border-color: #2d3038;
    color: #8b92a5;
}

.dark-theme .visual-toggle-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.dark-theme .visual-toggle-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #ffffff;
}

/* Disabled Dark */
.dark-theme .setting-item.disabled .setting-set select {
    background: #252a35;
    color: #677788;
}
