/* Modern Minimal Design */

:root {
    --primary: #007aff;
    --primary-light: #0a84ff;
    --background: #111111;
    --surface: #1a1a1a;
    --surface-light: #242424;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #808080;
    --border: #2a2a2a;
    --error: #ff3b30;
    --success: #34c759;
}

:root[data-theme="light"] {
    --primary: #007aff;
    --primary-light: #0a84ff;
    --background: #ffffff;
    --surface: #f8f8f8;
    --surface-light: #f0f0f0;
    --text: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: #d8d8d8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: 'Geologica', 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
    font-family: inherit;
}

.air-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    font-weight: 600;
    line-height: 1;
    font-size: 18px;
}

.icon-img {
    width: 18px;
    height: 18px;
    display: block;
}

/* ========== ЭКРАН ЗАГРУЗКИ ========== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-card {
    width: auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
    backdrop-filter: none;
}

.loading-logo {
    width: 96px;
    height: 96px;
    border-radius: 0;
    object-fit: cover;
    box-shadow: none;
    animation: logo-pulse 1.5s ease-in-out infinite;
}

.loading-bar {
    display: none;
}

.loading-bar-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #007aff, #0aa0ff);
    transform-origin: left;
    animation: loading-progress 1.2s ease-in-out infinite;
}

@keyframes loading-progress {
    0% { transform: scaleX(0.05); opacity: 0.6; }
    50% { transform: scaleX(0.85); opacity: 1; }
    100% { transform: scaleX(0.05); opacity: 0.6; }
}

@keyframes logo-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.loading-text {
    display: none;
}

/* ========== АНИМАЦИИ ========== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animated {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ========== АВТОРИЗАЦИЯ ========== */

.auth-page {
    display: flex;
    height: 100vh;
}

.auth-bg {
    flex: 1;
    background: url('/static/bac/1.jpg') right bottom/cover no-repeat;
    position: relative;
}

.auth-bg::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to left, rgba(0,0,0,0) 50%, #111 100%);
    pointer-events: none;
    z-index: 1;
}

.auth-form-section {
    width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--background);
}

.auth-form-panel {
    width: 100%;
    max-width: 360px;
}

.auth-form-panel h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text);
    letter-spacing: -0.5px;
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.1s;
    transition: opacity 0.3s ease;
}

.floating-group {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 0;
    overflow: visible;
}

.floating-group.has-hint {
    margin-bottom: 34px;
}

.floating-group input {
    width: 100%;
    padding: 18px 14px 6px;
    background: #222;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text);
    font-size: 16px;
    transition: background 0.3s;
}

.floating-group input:focus {
    background: #333;
    outline: none;
}

.floating-group input::placeholder {
    color: transparent;
}

.floating-group label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0 2px;
    user-select: none;
}

.input-hint {
    position: absolute;
    left: 14px;
    top: calc(100% + 4px);
    font-size: 11px;
    color: var(--text-tertiary);
}

.floating-group input:focus + label,
.floating-group input:not(:placeholder-shown) + label {
    top: 4px;
    font-size: 11px;
    color: #fff;
    background: rgb(0, 122, 255);
    padding: 2px 10px;
    border-radius: 25px;
}

.auth-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    border: none;
    border-radius: 25px;
    color: rgb(255, 255, 255);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.auth-btn:hover {
    background: var(--primary-light);
}

.auth-link {
    margin-top: 12px;
    font-size: 14px;
    color: #aaa;
    text-align: center;
}

.auth-link a {
    color: var(--text);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.3s;
}

.auth-link a:hover {
    color: var(--primary);
}

.auth-error-message {
    color: #ff3b30;
    margin-top: 20px;
    padding: 12px 16px;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 10px;
    font-size: 13px;
    display: none;
    text-align: center;
}

.auth-error-message:not(:empty) {
    display: block;
}

/* ========== OTP ВВОД ========== */

.otp-container {
    animation: fadeInUp 0.6s ease forwards;
}

.otp-header {
    margin-bottom: 28px;
    text-align: center;
}

.otp-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.otp-timer {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.otp-timer span {
    font-weight: 700;
    color: var(--primary);
    font-family: 'Courier New', monospace;
}

.otp-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    justify-content: center;
}

.otp-input {
    width: 50px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
}

.otp-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
    font-size: 24px;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.otp-input:not(:placeholder-shown) {
    border-color: var(--primary);
    background: rgba(0, 122, 255, 0.08);
}

.otp-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#confirmBtn {
    width: 100%;
    margin-bottom: 20px;
}

.otp-footer {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

.otp-footer p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.resend-btn {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(0, 122, 255, 0.5);
    color: var(--primary);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.resend-btn:not(:disabled):hover {
    background: rgba(0, 122, 255, 0.1);
    border-color: var(--primary);
}

.resend-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-tertiary);
}

/* ========== СМЕНА ПАРОЛЯ ========== */

.password-change-section {
    padding: 20px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    text-align: center;
}

.password-change-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.password-step {
    min-width: 350px;
}

.password-step h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.step-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.floating-group {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 0;
    overflow: visible;
}

.floating-group.has-hint {
    margin-bottom: 34px;
}

.floating-group input {
    width: 100%;
    padding: 14px 12px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    transition: background 0.3s;
}

.floating-group input:focus {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    border-color: var(--primary);
}

.floating-group input::placeholder {
    color: transparent;
}

.floating-group label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 13px;
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0 2px;
    user-select: none;
}

.floating-group input:focus + label,
.floating-group input:not(:placeholder-shown) + label {
    top: 4px;
    font-size: 11px;
    color: #fff;
    background: rgb(0, 122, 255);
    padding: 2px 8px;
    border-radius: 20px;
}

.hidden {
    display: none !important;
}

/* ========== ПРИЛОЖЕНИЕ ========== */

.app-container {
    display: flex;
    height: 100vh;
}

.nav-panel {
    width: 90px;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.8) 0%, rgba(10, 10, 15, 0.9) 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.089);
    display: flex;
    flex-direction: column;
    padding: 8px 6px;
    gap: 8px;
    align-items: center;
    position: relative;
    --indicator-top: 106px;
}

.nav-logo {
    width: 76px;
    height: 76px;
    margin-bottom: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes jellypulse {
    0% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0.9);
    }
    100% {
        transform: scaleY(1);
    }
}

.nav-panel::before {
    content: '';
    position: absolute;
    left: 6px;
    width: 3px;
    height: 32px;
    background: var(--primary);
    border-radius: 4px;
    top: var(--indicator-top);
    transition: top 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.nav-item {
    width: 76px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    transition: color 200ms ease, background 200ms ease;
    border-radius: 8px;
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
}

/* Рисуем иконки через mask, чтобы точно использовать var(--primary) */

.nav-item:hover {
    color: var(--primary);
    background: rgba(0, 122, 255, 0.08);
}

.nav-item.active {
    color: var(--primary);
    background: rgba(0, 122, 255, 0.12);
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.nav-item:nth-child(1).active {
    color: var(--primary);
    background: rgba(0, 122, 255, 0.12);
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.nav-item:nth-child(2).active {
    color: var(--primary);
    background: rgba(0, 122, 255, 0.12);
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.nav-item:nth-child(3).active {
    color: var(--primary);
    background: rgba(0, 122, 255, 0.12);
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.nav-item:nth-child(4).active {
    color: var(--primary);
    background: rgba(0, 122, 255, 0.12);
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.nav-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.nav-item svg,
.nav-item img.nav-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    object-fit: contain;
    transition: filter 200ms ease;
    display: block;
}

.nav-item.active img.nav-icon {
    filter: brightness(0) saturate(100%) 
            invert(31%) sepia(97%) saturate(4461%) 
            hue-rotate(188deg) brightness(100%) contrast(101%);
    transition: filter 0.25s ease; /* плавная смена цвета */
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 200ms ease;
    text-align: center;
    line-height: 1;
}

.sidebar {
    width: 360px;
    background: rgba(20, 20, 20, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.search-box {
    padding: 12px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 40px 12px 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    transition: background 200ms ease, border-color 200ms ease;
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.search-btn-inside {
    position: absolute;
    right: 20px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 200ms ease;
    padding: 0;
}

.search-btn-inside:hover {
    color: var(--primary);
}

.search-btn-inside .air-icon {
    font-size: 18px;
}

.search-btn-inside .icon-img {
    width: 18px;
    height: 18px;
    opacity: 0.7;
    transition: opacity 200ms ease;
}

.search-btn-inside:hover .icon-img {
    opacity: 1;
}

.contacts-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    border-radius: 12px;
    transition: background 200ms ease;
    margin-bottom: 4px;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.contact-item.active {
    background: rgba(0, 122, 255, 0.12);
    position: relative;
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    background: var(--primary);
    position: relative;
}

.contact-avatar .friend-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-avatar .friend-badge .air-icon {
    font-size: 10px;
    color: white;
}

.contact-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.contact-message {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.contact-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* ========== ЧАТ ========== */

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background);
}

#chatContent {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    position: relative;
}

.chat-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #111111eb;
    border-bottom: 1px solid var(--border);
    z-index: 10;
    backdrop-filter: blur(5px);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.chat-header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    backdrop-filter: none;
}

.chat-header-text {
    padding-right: 2px;
}

.chat-header-actions {
    display: flex;
    align-items: center;
}

/* ========== LIGHT THEME OVERRIDES ========== */
[data-theme="light"] body {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .search-input {
    background-color: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .search-input::placeholder {
    color: #999999 !important;
}

[data-theme="light"] .search-btn-inside {
    color: #999999 !important;
}

[data-theme="light"] .search-btn-inside:hover {
    color: #007aff !important;
}

[data-theme="light"] .sidebar-header {
    border-bottom-color: #e5e5e5 !important;
}

[data-theme="light"] .nav-panel {
    background: #f2f4f8 !important;
    border-right: 1px solid #dfe3e8 !important;
}

[data-theme="light"] .nav-item {
    color: #5a6474 !important;
}

[data-theme="light"] .nav-item:hover {
    background: rgba(0, 122, 255, 0.08) !important;
    color: #0a84ff !important;
}

[data-theme="light"] .nav-item.active {
    background: rgba(0, 122, 255, 0.12) !important;
    border-color: rgba(0, 122, 255, 0.25) !important;
    color: #0a84ff !important;
}

[data-theme="light"] .nav-item img.nav-icon,
[data-theme="light"] .nav-item svg {
    filter: none !important;
}

[data-theme="dark"] .nav-item img.nav-icon,
[data-theme="dark"] .nav-item svg {
    filter: brightness(0) invert(1) !important;
}

/* Активные иконки бокового меню в цвет var(--primary) для всех вкладок */
.nav-panel .nav-item.active img.nav-icon,
[data-theme="light"] .nav-panel .nav-item.active img.nav-icon,
[data-theme="dark"] .nav-panel .nav-item.active img.nav-icon {
    /* Фильтр подобран под #007aff (var(--primary)) */
    filter: invert(25%) sepia(96%) saturate(4025%) hue-rotate(196deg) brightness(98%) contrast(101%) !important;
}

[data-theme="dark"] .search-btn-inside .icon-img,
[data-theme="dark"] .chat-header-action .icon-img,
[data-theme="dark"] .emoji-icon-img,
[data-theme="dark"] .modal-close .icon-img {
    filter: brightness(0) invert(1) !important;
}

[data-theme="light"] .search-btn-inside .icon-img,
[data-theme="light"] .chat-header-action .icon-img,
[data-theme="light"] .emoji-icon-img,
[data-theme="light"] .modal-close .icon-img {
    filter: none !important;
}

[data-theme="light"] .sidebar {
    background: #f7f8fa !important;
    border-right: 1px solid #e5e7eb !important;
}

[data-theme="light"] .contacts-list {
    background: #f7f8fa !important;
}

[data-theme="light"] .sidebar-header h3 {
    color: #1a1a1a !important;
}

[data-theme="light"] .contact-item {
    color: #1a1a1a !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    background-color: transparent !important;
}

[data-theme="light"] .contact-item:hover {
    background-color: rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .contact-item.active {
    background-color: rgba(0, 122, 255, 0.12) !important;
}

[data-theme="light"] .auth-page,
[data-theme="light"] .auth-form-section {
    background-color: #ffffff !important;
}

[data-theme="light"] .floating-group input {
    background-color: #f5f5f5 !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .floating-group input::placeholder {
    color: #999999 !important;
}

[data-theme="light"] .floating-group input:focus {
    background-color: #eeeeee !important;
    border-color: #007aff !important;
}

[data-theme="light"] .floating-group label {
    color: #666666 !important;
}

[data-theme="light"] .auth-btn {
    background-color: #007aff !important;
    color: #ffffff !important;
    border-color: #007aff !important;
}

[data-theme="light"] .auth-btn:hover {
    background-color: #0056cc !important;
}

[data-theme="light"] .settings-wrapper {
    background-color: #ffffff !important;
}

[data-theme="light"] .settings-header h1 {
    color: #1a1a1a !important;
}

[data-theme="light"] .settings-subtitle {
    color: #666666 !important;
}

[data-theme="light"] .section-header {
    border-bottom-color: #e5e5e5 !important;
}

[data-theme="light"] .section-title {
    color: #1a1a1a !important;
}

[data-theme="light"] .section-hint {
    color: #999999 !important;
}

[data-theme="light"] .profile-card {
    background-color: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .profile-card:hover {
    background-color: rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .profile-label {
    color: #1a1a1a !important;
}

[data-theme="light"] .profile-hint {
    color: #999999 !important;
}

[data-theme="light"] .info-item {
    background-color: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .info-item:hover {
    background-color: rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .info-label {
    color: #666666 !important;
}

[data-theme="light"] .info-value {
    color: #1a1a1a !important;
}

[data-theme="light"] .settings-item {
    background-color: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .settings-item:hover {
    background-color: rgba(0, 0, 0, 0.06) !important;
    border-color: rgba(0, 0, 0, 0.12) !important;
}

[data-theme="light"] .settings-item-label {
    color: #1a1a1a !important;
}

[data-theme="light"] .settings-item-hint {
    color: #999999 !important;
}

[data-theme="light"] .theme-card-preview {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .theme-card input[type="radio"]:checked + .theme-card-preview {
    border-color: #007aff !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15) !important;
}

[data-theme="light"] .theme-card-label {
    color: #666666 !important;
}

[data-theme="light"] .theme-card input[type="radio"]:checked ~ .theme-card-label {
    background-color: rgba(0, 122, 255, 0.1) !important;
    color: #007aff !important;
}

[data-theme="light"] .btn-icon-text {
    background-color: #007aff !important;
    color: #ffffff !important;
    border: 1px solid #ffffff5c !important;
    border-radius: 25px !important;
    padding: 14px 24px !important;
    font-size: 15px !important;
}

[data-theme="light"] .btn-icon-text:hover {
    background-color: #0056cc !important;
}

[data-theme="light"] .btn-logout {
    background-color: rgba(255, 59, 48, 0.1) !important;
    border-color: rgba(255, 59, 48, 0.2) !important;
    color: #ff3b30 !important;
}

[data-theme="light"] .btn-logout:hover {
    background-color: rgba(255, 59, 48, 0.15) !important;
    border-color: rgba(255, 59, 48, 0.3) !important;
}

[data-theme="light"] .toggle-slider {
    background-color: rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .toggle-switch input:checked + .toggle-slider {
    background-color: #007aff !important;
}

[data-theme="light"] .modal-content {
    background-color: #f8f8f8 !important;
    color: #1a1a1a !important;
    border-color: #d8d8d8 !important;
}

[data-theme="light"] .modal-header {
    border-bottom-color: #e5e5e5 !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .modal-close {
    color: #666666 !important;
}

[data-theme="light"] .modal-close:hover {
    color: #1a1a1a !important;
}

[data-theme="light"] .chat-area {
    background-color: #ffffff !important;
}

[data-theme="light"] .chat-header {
    border-bottom-color: #e5e5e5 !important;
    background: #f8f8f8 !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .chat-input-area {
    background: linear-gradient(to top, #f7f7f7 70%, rgba(247, 247, 247, 0)) !important;
}

[data-theme="light"] .chat-input-wrapper {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .chat-input-wrapper:focus-within {
    background: #ffffff !important;
    border-color: #007aff !important;
}

[data-theme="light"] .chat-input:empty:before {
    color: rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] .message-input-area {
    background-color: #f8f8f8 !important;
    border-top-color: #e5e5e5 !important;
}

[data-theme="light"] .msg-input {
    background-color: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    color: #1a1a1a !important;
}

[data-theme="light"] .msg-input::placeholder {
    color: #999999 !important;
}

[data-theme="light"] .send-btn {
    background-color: #007aff !important;
}

[data-theme="light"] .send-btn:hover {
    background-color: #0056cc !important;
}

[data-theme="light"] .message {
    color: #1a1a1a !important;
}

[data-theme="light"] .message.own {
    background-color: #007aff !important;
    color: #ffffff !important;
}

[data-theme="light"] .message.other {
    background-color: #e9eef5 !important;
}

[data-theme="light"] .message:not(.own) .message-bubble {
    background: #e9eef5 !important;
    color: #1a1a1a !important;
    border: 1px solid #d7deea !important;
}

[data-theme="light"] .message.own .message-bubble {
    background: #007aff !important;
    color: #ffffff !important;
}

[data-theme="light"] .message-time {
    color: #566074 !important;
}

[data-theme="light"] .stickers-menu {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
}

[data-theme="light"] .stickers-header {
    border-bottom: 1px solid #e5e7eb !important;
}

[data-theme="light"] .sticker-tab-btn {
    border-color: transparent !important;
}

[data-theme="light"] .sticker-tab-btn:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: #cfd6e2 !important;
}

[data-theme="light"] .sticker-tab-btn.active {
    border-color: #007aff !important;
}

.chat-header-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px;
    background: transparent;
    border: none;
    backdrop-filter: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
}

.chat-header-action:hover {
    color: var(--primary);
    background: rgba(0, 122, 255, 0.08);
}

.chat-header-action .icon-img {
    width: 20px;
    height: 20px;
}

.contact-info-icon {
    font-size: 20px;
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: var(--primary);
    flex-shrink: 0;
}

.chat-header-text h3 {
    font-size: 15px;
    font-weight: 600;
}

.chat-header-text p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 96px 24px 24px;
    padding-bottom: 180px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message {
    display: flex;
    flex-direction: column;
}

.message.own {
    align-items: flex-end;
}

.message-bubble {
    max-width: 85%;
    width: fit-content;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    position: relative;
    animation: messageAppear 0.3s ease forwards;
}

.message-bubble strong {
    font-weight: 700;
}

.message-bubble em {
    font-style: italic;
}

.message-bubble u {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}

@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== ЭФФЕКТЫ СООБЩЕНИЙ ========== */

@keyframes balloon-float {
    0% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
    100% { transform: translateY(-40px) scale(1); opacity: 0; }
}

@keyframes confetti-burst {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(0) rotate(360deg) translateY(50px); opacity: 0; }
}

@keyframes heart-float {
    0% { transform: translateY(0px) scale(1); opacity: 1; }
    100% { transform: translateY(-60px) scale(0.5); opacity: 0; }
}

@keyframes fire-pulse {
    0%, 100% { filter: brightness(1); transform: scale(1); }
    50% { filter: brightness(1.5); transform: scale(1.1); }
}

@keyframes laugh-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    75% { transform: rotate(2deg); }
}

.message-bubble.effect-balloon {
    animation: balloon-float 1.5s ease-out forwards, messageAppear 0.3s ease forwards;
}

.message-bubble.effect-confetti {
    animation: confetti-burst 1.2s ease-out forwards, messageAppear 0.3s ease forwards;
}

.message-bubble.effect-love {
    animation: heart-float 1.5s ease-out forwards, messageAppear 0.3s ease forwards;
}

.message-bubble.effect-fire {
    animation: fire-pulse 1s ease-in-out infinite, messageAppear 0.3s ease forwards;
}

.message-bubble.effect-laugh {
    animation: laugh-shake 0.5s ease-in-out 3, messageAppear 0.3s ease forwards;
}

.message.own .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.message:not(.own) .message-bubble {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

[data-theme="light"] .message:not(.own) .message-bubble {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .message.own .message-bubble {
    background: var(--primary);
    color: white;
}

.message-time {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
    padding: 0 12px;
}

.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    gap: 16px;
}

.empty-state .air-icon {
    font-size: 64px;
    opacity: 0.8;
}

.chat-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 24px 24px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: linear-gradient(to top, #111111 30%, rgba(17, 17, 17, 0) 100%);
    z-index: 10;
}



.emoji-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease, color 200ms ease;
    flex-shrink: 0;
    margin-right: 8px;
    align-self: flex-end;
    margin-bottom: 4px;
    padding: 0;
}

.emoji-icon-img {
    width: 24px;
    height: 24px;
    display: block;
}

.emoji-btn:hover {
    background: rgba(0, 122, 255, 0.15);
    color: #ffffff;
}

.chat-input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 0 4px;
    transition: background 200ms ease, border-color 200ms ease;
    backdrop-filter: blur(4px);
    position: relative;
}

.message-limit {
    position: absolute;
    right: 8px;
    bottom: 44px;
    font-size: 11px;
    font-weight: 600;
    color: var(--error);
    display: none;
    pointer-events: none;
}

.message-limit.visible {
    display: block;
}

.chat-input-wrapper:focus-within {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    outline: none;
    position: relative;
    overflow-y: hidden;
    font-family: inherit;
    line-height: 1.4;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
    min-height: 45px;
    max-height: 150px;
    height: auto;
}

.chat-input:empty:before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
}

.chat-input strong {
    font-weight: 700;
    color: var(--primary);
}

.chat-input em {
    font-style: italic;
    color: var(--primary);
}

.chat-input u {
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
    color: var(--primary);
}

.text-format-menu {
    position: fixed;
    background: rgba(32, 32, 32, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 5px;
    display: none;
    flex-direction: row;
    gap: 3px;
    z-index: 10000;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    width: auto;
    min-width: fit-content;
}

.format-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(0, 122, 255, 0.15);
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    transition: all 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

.format-btn:hover {
    background: rgba(0, 122, 255, 0.4);
    transform: translateY(-2px);
}

.format-btn.active {
    background: var(--primary);
    color: white;
}

.send-btn {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease;
    flex-shrink: 0;
    position: relative;
    align-self: flex-end;
    margin-bottom: 4px;
}

.send-btn:hover {
    background: var(--primary-light);
}

.send-btn .air-icon {
    font-size: 18px;
}

.send-btn .icon-img {
    width: 18px;
    height: 18px;
    filter: none !important;
}


/* ========== МОДАЛЬНОЕ ОКНО ========== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(25px);
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    background: rgb(20, 20, 20);
    border-radius: 24px;
    width: 90%;
    max-width: 520px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    cursor: pointer;
    color: var(--text-tertiary);
    font-size: 24px;
    padding: 8px;
    border-radius: 8px;
    transition: color 200ms ease, background 200ms ease;
}

.modal-close .icon-img {
    width: 18px;
    height: 18px;
}

.modal-close:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.modal-body {
    padding: 40px 28px;
    text-align: center;
}

.profile-modal-avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    font-weight: 600;
    color: white;
    margin: 0 auto 24px;
    background: var(--primary);
    background-size: cover !important;
    background-position: center !important;
}

.modal-body h2 {
    font-size: 26px;
    font-weight: 600;
    margin: 0 0 24px 0;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
}

.profile-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.profile-value {
    color: var(--text);
}

.btn-primary-modal {
    width: 100%;
    margin-top: 24px;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: 1px solid #ffffff5c;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 200ms ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary-modal:hover {
    background: var(--primary-light);
}

.btn-ghost-modal {
    width: 100%;
    margin-top: 10px;
    padding: 14px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 200ms ease, color 200ms ease, background 200ms ease;
}

.btn-ghost-modal:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 122, 255, 0.06);
}

/* ========== НАСТРОЙКИ ========== */

.settings-full {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

.settings-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.settings-header {
    margin-bottom: 8px;
}

.settings-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 8px 0;
}

.settings-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.section-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

/* Карточка профиля */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.profile-card {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    transition: background 200ms ease, border-color 200ms ease;
}

.profile-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.profile-avatar-display {
    flex-shrink: 0;
}

.settings-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat;
    position: relative;
}

.avatar-upload-btn {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: 1px solid #ffffff5c;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 200ms ease;
    white-space: nowrap;
    margin-top: 12px;
}

.avatar-upload-btn:hover {
    background: var(--primary-light);
}

.avatar-upload-btn input {
    display: none;
}

.profile-info {
    flex: 1;
}

.profile-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

/* Сетка информации */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.info-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: background 200ms ease, border-color 200ms ease;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.info-item-header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.info-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.info-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 4px 0;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin: 0;
    word-break: break-all;
}

/* Элемент настроек */
.settings-item {
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: background 200ms ease, border-color 200ms ease;
}

.settings-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.settings-item-content {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}

.settings-item-text {
    flex: 1;
}

.settings-item-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.settings-item-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 32px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(120, 120, 128, 0.32);
    border-radius: 32px;
    transition: background 0.3s ease;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 28px;
    width: 28px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Выбор темы */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.theme-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
}

.theme-card input[type="radio"] {
    display: none;
}

.theme-card-preview {
    width: 100%;
    height: 140px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: border-color 200ms ease, box-shadow 200ms ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.theme-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 200ms ease, color 200ms ease;
}

.theme-card input[type="radio"]:checked + .theme-card-preview {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.theme-card input[type="radio"]:checked ~ .theme-card-label {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
}

/* Кнопки с иконками */
.btn-icon-text {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    border: 1px solid #ffffff5c;
    border-radius: 25px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 200ms ease;
    white-space: nowrap;
}

.btn-icon-text:hover {
    background: var(--primary-light);
}

.btn-logout {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid rgba(255, 59, 48, 0.3);
    color: #ff3b30;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 200ms ease;
    margin-top: 8px;
}

.btn-logout:hover {
    background: rgba(255, 59, 48, 0.25);
    border-color: rgba(255, 59, 48, 0.5);
}

.settings-actions-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Скрытые старые элементы */
.btn-ghost {
    display: none;
}

.settings-avatar-wrapper {
    display: none;
}

.avatar-box {
    display: none;
}

.btn-upload-icon {
    display: none;
}

.settings-avatar-section {
    display: none;
}

.settings-actions {
    display: none;
}

.btn-upload {
    display: none;
}

.settings-info-section {
    display: none;
}

.settings-appearance-section {
    display: none;
}

.settings-notification-toggle {
    display: none;
}

.settings-hero {
    display: none;
}

.settings-hero-left {
    display: none;
}

.settings-hero-avatar {
    display: none;
}

.settings-hero-info h3 {
    display: none;
}

.settings-hero-info p {
    display: none;
}

.settings-card {
    display: none;
}

.upload-label {
    display: none;
}

.upload-label input {
    display: none;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== TOAST УВЕДОМЛЕНИЯ ========== */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    animation: slideIn 0.3s ease;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hiding {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast.success {
}

.toast.success .toast-icon {
    color: var(--success);
}

.toast.error {
}

.toast.error .toast-icon {
    color: var(--error);
}

.toast.info {
}

.toast.info .toast-icon {
    color: var(--primary);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .auth-page, .app-container {
        display: none !important;
    }
    
    .toast-container {
        bottom: 12px;
        right: 12px;
    }
    
    .toast {
        min-width: 280px;
        max-width: calc(100vw - 24px);
    }
}

.photo {
    background-size: contain !important;
    background-repeat: no-repeat !important;
}

/* ========== СТИКЕРЫ ========== */

.stickers-menu {
    --sticker-size: 92px;
    --sticker-gap: 8px;
    --grid-rows: 2;
    position: absolute;
    bottom: 80px;
    left: 24px;
    width: 320px;
    height: auto;
    max-height: none;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    z-index: 9999;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    box-sizing: border-box;
    animation: slideUpMenu 0.3s ease;
}

.stickers-menu.active {
    display: flex;
}

@keyframes slideUpMenu {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.stickers-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stickers-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.stickers-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 200ms ease, color 200ms ease;
    padding: 0;
}

.stickers-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.stickers-tabs {
    display: flex;
    gap: 4px;
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    overflow-y: hidden;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.sticker-tab-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 200ms ease, border-color 200ms ease;
    border: 1px solid transparent;
}

.sticker-tab-btn img,
.sticker-tab-btn video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.sticker-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 122, 255, 0.3);
}

.sticker-tab-btn.active {
    border: 1px solid var(--primary);
}

.stickers-grid {
    flex: 0 0 auto;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: var(--sticker-size);
    gap: var(--sticker-gap);
    height: calc((var(--grid-rows) * var(--sticker-size)) + ((var(--grid-rows) - 1) * var(--sticker-gap)) + 16px);
    box-sizing: border-box;
}

.sticker-item {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    transition: background 200ms ease;
    padding: 0;
}

.sticker-item video,
.sticker-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.sticker-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sticker-item.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Стикер в чате */
.message-bubble.sticker-message {
    background: transparent;
    border: none;
    padding: 0;
    width: 120px;
    height: 120px;
    max-width: 120px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.message.own .message-bubble.sticker-message,
.message:not(.own) .message-bubble.sticker-message {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
}

.message-bubble.sticker-message::before {
    display: none;
}

.message.sticker {
    margin-top: 4px;
    margin-bottom: 4px;
    width: 120px;
}

.message.own.sticker {
    align-items: flex-end;
    margin-left: auto;
}

.message:not(.own).sticker {
    align-items: flex-start;
    margin-right: auto;
}

.message-bubble.sticker-message .message-time {
    display: block !important;
    position: absolute;
    right: 4px;
    bottom: 4px;
    margin: 0;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1;
    text-align: center;
    color: var(--text);
    background: rgba(0, 0, 0, 0.33);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    border-radius: 10px;
    opacity: 1;
    visibility: visible;
    z-index: 2;
    pointer-events: none;
}

.message-bubble.sticker-message video,
.message-bubble.sticker-message img {
    width: 100%;
    height: 100%;
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
}

/* Gradient border effects */
.message-bubble::before,
.search-input::before,
.contact-item.active::before,
.btn-upload-icon::before,
.settings-avatar-large::before,
.info-field::before,
.settings-avatar-wrapper::before,
.send-btn::before,
.modal-content::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.35), rgba(200, 200, 200, 0.15), rgba(255, 255, 255, 0.25), rgba(120, 120, 120, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: add, add;
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.info-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.info-label {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-logout-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
