/* ============================================
   SELLICA CONNECT - ЧЁРНО-ФИОЛЕТОВАЯ ТЕМА
   Мягкие градиенты, плавные переходы
   ============================================ */

:root {
    /* Основные цвета - плавные фиолетовые оттенки */
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131f;
    --bg-tertiary: #1a1a2e;
    --bg-elevated: #1f1f35;

    /* Фиолетовые акценты - мягкие и приятные */
    --accent-primary: #7c3aed;
    --accent-hover: #8b5cf6;
    --accent-light: #a78bfa;
    --accent-glow: rgba(124, 58, 237, 0.15);

    /* Градиенты */
    --gradient-main: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #1f1f35 100%);
    --gradient-accent: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    --gradient-subtle: linear-gradient(180deg, rgba(124, 58, 237, 0.1) 0%, transparent 100%);

    /* Границы */
    --border-color: rgba(124, 58, 237, 0.1);
    --border-hover: rgba(124, 58, 237, 0.3);

    /* Текст */
    --text-primary: #e9e9f0;
    --text-secondary: #a8a8b8;
    --text-muted: #6b6b7b;

    /* Тени */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* ============================================
   ЭКРАН АВТОРИЗАЦИИ
   ============================================ */

.auth-screen {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--gradient-main);
    position: relative;
    overflow: hidden;
}

/* Фоновая анимация */
.auth-screen::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    top: -200px;
    left: -200px;
    animation: float 20s ease-in-out infinite;
}

.auth-screen::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -100px;
    right: -100px;
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(50px, 50px) scale(1.1); }
}

.auth-container {
    background: var(--bg-tertiary);
    backdrop-filter: blur(20px);
    padding: 48px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.auth-header h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 400;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.auth-tab.active {
    background: var(--gradient-accent);
    color: white;
    box-shadow: var(--shadow-glow);
}

.auth-tab:hover:not(.active) {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

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

.form-label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-button {
    width: 100%;
    padding: 14px;
    background: var(--gradient-accent);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-glow);
}

.form-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--accent-glow);
}

.form-button:active {
    transform: translateY(0);
}

.form-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
    color: #fecaca;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    border: 1px solid rgba(254, 202, 202, 0.2);
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   ОСНОВНОЙ КОНТЕЙНЕР
   ============================================ */

.app-container {
    display: none;
    height: 100vh;
    grid-template-columns: 320px 1fr 340px;
    background: var(--bg-primary);
}

.app-container.show {
    display: grid;
}

/* ============================================
   ЛЕВАЯ ПАНЕЛЬ (ЧАТЫ)
   ============================================ */

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

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gradient-subtle);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: white;
    position: relative;
    box-shadow: var(--shadow-glow);
}

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

.status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--bg-secondary);
}

.status-indicator.online {
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.status-indicator.offline {
    background: #6b7280;
}

.user-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.icon-button {
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-button:hover {
    background: var(--bg-elevated);
    color: var(--accent-light);
}

/* ============================================
   ПОИСК
   ============================================ */

.search-container {
    padding: 16px 20px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 18px 12px 44px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    position: absolute;
    left: 34px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ============================================
   ТАБЫ НАВИГАЦИИ
   ============================================ */

.nav-tabs {
    display: flex;
    gap: 6px;
    padding: 0 16px;
    margin-bottom: 16px;
}

.nav-tab {
    flex: 1;
    padding: 11px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.nav-tab.active {
    background: var(--gradient-accent);
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-tab:hover:not(.active) {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* ============================================
   СПИСОК ЧАТОВ
   ============================================ */

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

.chat-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.chat-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
}

.chat-item.active {
    background: var(--gradient-accent);
    box-shadow: var(--shadow-glow);
}

.chat-item.active .chat-item-name,
.chat-item.active .chat-item-message {
    color: white !important;
}

.chat-item-content {
    flex: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.chat-item-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-time {
    font-size: 12px;
    color: var(--text-muted);
}

.chat-item.active .chat-item-time {
    color: rgba(255, 255, 255, 0.8);
}

.chat-item-message {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   FAB КНОПКА
   ============================================ */

.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border: none;
    background: var(--gradient-accent);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transition: all 0.3s ease;
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px var(--accent-glow);
}

.fab:active {
    transform: scale(0.95);
}

@media (min-width: 769px) {
    .fab {
        position: absolute;
        z-index: 10;
    }
}

/* ============================================
   ЦЕНТРАЛЬНАЯ ПАНЕЛЬ (ЧАТ)
   ============================================ */

.chat-main {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    height: 100vh;
    max-height: 100vh;
}

.chat-header {
    padding: 18px 28px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    background: var(--gradient-subtle);
}

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

.chat-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.chat-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

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

/* ============================================
   СООБЩЕНИЯ
   ============================================ */

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    min-height: 0;
}

.message {
    display: flex;
    gap: 14px;
    margin-bottom: 18px;
}

.message.own {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.message-content {
    max-width: 65%;
}

.message.own .message-content {
    align-items: flex-end;
}

.message-author {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-light);
    margin-bottom: 6px;
}

.message.own .message-author {
    text-align: right;
}

.message-bubble {
    background: var(--bg-secondary);
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    word-wrap: break-word;
    border: 1px solid var(--border-color);
}

.message.own .message-bubble {
    background: var(--gradient-accent);
    color: white;
    border: none;
    box-shadow: var(--shadow-glow);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.message.own .message-time {
    text-align: right;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   ВВОД СООБЩЕНИЙ
   ============================================ */

.message-input-container {
    padding: 20px 28px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: flex-end;
    gap: 14px;
    background: var(--bg-secondary);
}

.attachment-button {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border-radius: 10px;
}

.attachment-button:hover:not(:disabled) {
    background: var(--bg-elevated);
    color: var(--accent-light);
}

.attachment-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.input-wrapper {
    flex: 1;
    background: var(--bg-elevated);
    border-radius: 24px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    resize: none;
    outline: none;
    font-family: inherit;
    max-height: 120px;
    padding-right: 44px;
}

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

.emoji-button {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 20px;
    border-radius: 8px;
}

.emoji-button:hover:not(:disabled) {
    background: var(--bg-elevated);
    color: var(--accent-light);
}

.send-button {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--gradient-accent);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.send-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--accent-glow);
}

.send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   СКРОЛЛБАРЫ
   ============================================ */

.chat-list::-webkit-scrollbar,
.messages-container::-webkit-scrollbar {
    width: 6px;
}

.chat-list::-webkit-scrollbar-track,
.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-list::-webkit-scrollbar-thumb,
.messages-container::-webkit-scrollbar-thumb {
    background: var(--accent-glow);
    border-radius: 10px;
}

.chat-list::-webkit-scrollbar-thumb:hover,
.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ============================================
   WELCOME SCREEN
   ============================================ */

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.welcome-icon {
    width: 120px;
    height: 120px;
    border-radius: 30px;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    box-shadow: var(--shadow-glow);
    color: white;
}

.welcome-screen h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.welcome-screen p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 400px;
}

/* ============================================
   ПРАВАЯ ПАНЕЛЬ (ИНФОРМАЦИЯ О ЧАТЕ)
   ============================================ */

.sidebar-right {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
}

.profile-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.profile-header {
    text-align: center;
    padding: 40px 24px;
    background: var(--gradient-subtle);
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.3;
    animation: float 15s ease-in-out infinite;
}

.avatar-xl {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: white;
    margin: 0 auto 20px;
    box-shadow: 0 8px 32px var(--accent-glow), var(--shadow-lg);
    border: 4px solid var(--bg-secondary);
    position: relative;
    z-index: 1;
}

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

.profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.profile-status {
    font-size: 15px;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-status.online {
    color: #10b981;
}

.profile-status.online::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 12px #10b981;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

.profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 24px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
}

.profile-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
}

.profile-action:hover {
    background: var(--gradient-accent);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-4px);
}

.profile-action svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.profile-section {
    padding: 24px;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.settings-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-card:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.setting-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 0 16px var(--accent-glow);
}

.setting-icon svg {
    color: white;
}

.setting-content {
    flex: 1;
    min-width: 0;
}

.setting-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.setting-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.setting-card:hover .setting-arrow {
    color: var(--accent-light);
    transform: translateX(4px);
}

/* Обновлённый toggle switch */
.toggle-switch {
    width: 48px;
    height: 26px;
    background: var(--bg-primary);
    border-radius: 13px;
    position: relative;
    transition: background 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

.toggle-switch.active {
    background: var(--gradient-accent);
    border-color: transparent;
    box-shadow: 0 0 12px var(--accent-glow);
}

.toggle-slider {
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(22px);
}

/* Старые стили настроек - оставляем для совместимости */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-item:hover {
    background: var(--gradient-accent);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateX(4px);
}

.setting-item svg {
    margin-right: 12px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.setting-item:hover svg {
    transform: scale(1.1);
}

.setting-item span {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-item:hover span {
    color: white;
}

.setting-item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-item-label {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.setting-item-description {
    font-size: 12px;
    color: var(--text-muted);
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--bg-primary);
    border-radius: 12px;
    position: relative;
    transition: background 0.3s ease;
    cursor: pointer;
}

.toggle-switch.active {
    background: var(--gradient-accent);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* Медиа файлы */
.media-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 14px;
}

.media-item {
    aspect-ratio: 1;
    background: var(--bg-elevated);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.media-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.media-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Мобильная кнопка закрытия инфо */
.mobile-close-info {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.mobile-close-info:hover {
    background: var(--accent-primary);
    color: white;
}

/* ============================================
   МОДАЛЬНЫЕ ОКНА
   ============================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-tertiary);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-content-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close-icon:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* ============================================
   КНОПКИ В МОДАЛЬНЫХ ОКНАХ
   ============================================ */

.create-type-button {
    width: 100%;
    padding: 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.create-type-button:hover {
    background: var(--gradient-accent);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
    transform: translateX(4px);
}

.create-type-button svg {
    flex-shrink: 0;
}

.modal-button {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-button.cancel {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-button.cancel:hover {
    background: var(--bg-secondary);
}

.modal-button.delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.modal-button.delete:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.logout-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
    transition: all 0.3s ease;
}

.logout-button:hover {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}

.save-button {
    width: 100%;
    padding: 14px;
    background: var(--gradient-accent);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-glow);
}

.save-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--accent-glow);
}

/* ============================================
   НАСТРОЙКИ
   ============================================ */

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.setting-row:hover {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
}

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

.setting-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.setting-value {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.setting-edit-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.setting-edit-btn:hover {
    background: var(--accent-primary);
    color: white;
}

.editable {
    cursor: pointer;
    position: relative;
}

.editable:hover::after {
    content: '✎';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    box-shadow: var(--shadow-glow);
}

/* ============================================
   ПОИСК ПОЛЬЗОВАТЕЛЕЙ
   ============================================ */

.search-results {
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.user-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.user-result-item:hover {
    background: var(--gradient-accent);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

.user-result-item .avatar {
    flex-shrink: 0;
}

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

.user-result-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-result-login {
    font-size: 13px;
    color: var(--text-secondary);
}

.user-result-item:hover .user-result-name,
.user-result-item:hover .user-result-login {
    color: white;
}

/* ============================================
   КОНТЕКСТНОЕ МЕНЮ
   ============================================ */

.context-menu {
    display: none;
    position: fixed;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    min-width: 200px;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 14px;
}

.context-menu-item:hover {
    background: var(--bg-elevated);
}

.context-menu-item[data-action="delete"] {
    color: #ef4444;
}

.context-menu-item[data-action="delete"]:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* ============================================
   CROP EDITOR
   ============================================ */

.crop-editor {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.crop-editor.show {
    display: flex;
}

.crop-container {
    max-width: 90%;
    max-height: 70vh;
    margin-bottom: 24px;
}

.crop-canvas {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
}

.crop-controls {
    display: flex;
    gap: 16px;
}

.crop-button {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.crop-button.cancel {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.crop-button.cancel:hover {
    background: var(--bg-secondary);
}

.crop-button:not(.cancel) {
    background: var(--gradient-accent);
    color: white;
    box-shadow: var(--shadow-glow);
}

.crop-button:not(.cancel):hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--accent-glow);
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ КЛАССЫ
   ============================================ */

.voice-button {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--gradient-accent);
    color: white;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.voice-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px var(--accent-glow);
}

.voice-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.mobile-back-button {
    display: none;
}

/* ============================================
   МОДАЛЬНОЕ ОКНО УВЕДОМЛЕНИЙ
   ============================================ */

.notifications-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.notification-option:hover {
    background: var(--gradient-accent);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px var(--accent-glow);
    transform: translateX(4px);
}

.notification-option svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.notification-option:hover svg {
    transform: scale(1.1);
}

/* Иконка отключенных уведомлений в списке чатов */
.chat-muted-icon {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
}

.chat-item.active .chat-muted-icon {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   МОДАЛЬНОЕ ОКНО МЕДИА
   ============================================ */

/* Вкладки медиа */
.media-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.media-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.media-tab:hover {
    background: rgba(124, 58, 237, 0.1);
    color: var(--text-primary);
}

.media-tab.active {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.media-tab svg {
    flex-shrink: 0;
}

/* Контент медиа */
.media-content {
    position: relative;
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
}

.media-section {
    display: none;
}

.media-section.active {
    display: block;
}

/* Сетка для фото/видео */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
}

.media-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.media-item-play svg {
    width: 24px;
    height: 24px;
    color: white;
    margin-left: 4px;
}

/* Список для документов/ссылок */
.media-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.media-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.media-list-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-hover);
    transform: translateX(4px);
}

.media-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--gradient-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.media-list-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

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

.media-list-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.media-list-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.media-list-link {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Пустое состояние */
.media-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-muted);
}

.media-empty svg {
    margin-bottom: 16px;
}

.media-empty p {
    font-size: 14px;
}

/* Скрытие пустого состояния когда есть контент */
.media-grid:not(:empty) + .media-empty,
.media-list:not(:empty) + .media-empty {
    display: none;
}

