/* ============================================================
   SocialNet 1.3.36 — тёмная тема: всё читается.
   Подключается последним (functions.php). Найдено проверкой контраста
   всех страниц и окон в тёмной теме.
   ============================================================ */

/* Системные элементы: радио, галочки, календарь, поля чисел, прокрутка */
html.theme-dark { color-scheme: dark; }
html.theme-dark :where(input[type=number], input[type=url], input[type=tel], input[type=date], input[type=time], select) {
    background-color: #0f172a; color: var(--text); border-color: var(--border);
}

/* Белый текст на светло-фиолетовом (#818cf8) — контраст ниже нормы → насыщеннее */
html.theme-dark .friends-tabs a.active .badge,
html.theme-dark .sn-sess-badge,
html.theme-dark .gm-card-play,
html.theme-dark .gs-tag-new,
html.theme-dark .snct-track-play,
html.theme-dark .gc-down b,
html.theme-dark .gc-ava-edit,
html.theme-dark .chat-voice .cv-play,
html.theme-dark .sn-vrec-send,
html.theme-dark .tt-pad button.is-main,
html.theme-dark .sk-pad button:active { background: #6366f1; color: #fff; }
html.theme-dark .gf-tab.is-active,
html.theme-dark .gc-pill.is-primary { background: #6366f1; border-color: #6366f1; color: #fff; }
html.theme-dark .dialog-badge.is-muted { background: #475569; }

/* Тёмно-фиолетовые ссылки и кнопки (группы, профиль) */
html.theme-dark .group-page > p a,
html.theme-dark .groups-search-hint strong,
html.theme-dark .group-post-meta a,
html.theme-dark .group-comment-head a,
html.theme-dark .group-member-item > a,
html.theme-dark .videos-progress-percent,
html.theme-dark .profile-info .profile-stats-inline .stat-link strong,
html.theme-dark .widget-clickable-friends .mini-friend { color: #a5b4fc; }
html.theme-dark .group-post-edit,
html.theme-dark .group-post-edit-cancel,
html.theme-dark .group-comment-toggle,
html.theme-dark .group-comment-tools button,
html.theme-dark .group-create-close,
html.theme-dark .group-create-title::before { color: #c7d2fe; background: rgba(129, 140, 248, .16); }
html.theme-dark .group-request-name,
html.theme-dark .group-member-name { color: var(--text); }
html.theme-dark .group-privacy-switch button { color: #a5a1bd; }
html.theme-dark .group-request-reject,
html.theme-dark .group-comment-tools .group-comment-delete-btn,
html.theme-dark .profile-more-menu .is-danger { color: #f87171; }
html.theme-dark #group-create-message[style*="c0392b"] { color: #f87171 !important; }

/* Белые блоки */
html.theme-dark .group-upload-card { background: #1e293b; color: var(--text); border: 1px solid var(--border); }
html.theme-dark .group-upload-title { color: var(--text); }
html.theme-dark .group-upload-file,
html.theme-dark .group-file-preview .file-preview-label { background: rgba(129, 140, 248, .14); color: #c7d2fe; }
html.theme-dark .group-upload-percent { color: #a5b4fc; }
html.theme-dark .group-upload-cancel { background: rgba(239, 68, 68, .14); color: #fca5a5; border-color: rgba(248, 113, 113, .35); }
html.theme-dark .group-member-remove-btn { background: #334155; color: #cbd5e1; }
html.theme-dark .group-member-remove-btn:hover { background: rgba(239, 68, 68, .2); color: #fca5a5; }
html.theme-dark .group-file-select { background: rgba(129, 140, 248, .12); color: #c7d2fe; border-color: rgba(129, 140, 248, .3); }
html.theme-dark .group-privacy-switch button.active { background: rgba(129, 140, 248, .3); color: #eef2ff; }
html.theme-dark .groups-page .empty-state { background: rgba(30, 41, 59, .6); color: #94a3b8; }
html.theme-dark .comments-area .page-numbers { background: var(--card); color: var(--text); }
html.theme-dark .comments-area .page-numbers.current { background: #6366f1; color: #fff; }
html.theme-dark .profile-avatar-big img {
    border-color: #1e293b; background: #1e293b;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4), 0 0 0 6px rgba(129, 140, 248, .35);
}
html.theme-dark .sn-preview-actions .sn-preview-exit { background: rgba(15, 23, 42, .6); color: #fff; border-color: rgba(255, 255, 255, .25); }
html.theme-dark .flash.warning,
html.theme-dark .comment-awaiting { background: rgba(120, 53, 15, .35); color: #fde68a; border-color: rgba(245, 158, 11, .35); }
html.theme-dark .videos-hint { color: #cbd5e1; }
html.theme-dark .settings-pass-eye { color: var(--muted); }
html.theme-dark .coins-h-amt.is-minus { color: #f87171; }
html.theme-dark .coins-h-amt.is-plus { color: #4ade80; }
html.theme-dark .act-group-cover { background-color: #334155; }

/* Черновик голосового: тонкие столбики «волны» на широкой панели */
.sn-vrec-draft .cv-wave { justify-content: space-between; }
.sn-vrec-draft .cv-wave i { flex: 0 0 3px; }

/* Эти правила в старых стилях заданы с !important — перебиваем так же */
html.theme-dark .group-request-reject { background: rgba(239, 68, 68, .15) !important; color: #f87171 !important; }
html.theme-dark .group-comment-toggle,
html.theme-dark .group-post-edit-cancel { background: rgba(129, 140, 248, .16) !important; color: #c7d2fe !important; }
html.theme-dark .group-post-edit-cancel.group-post-file-del { color: #fca5a5 !important; }
html.theme-dark .profile-info .profile-stats-inline .stat-link strong { color: #a5b4fc !important; }
html.theme-dark .group-card .member-actions .btn:not(.btn-primary) { color: #c7d2fe; }
html.theme-dark .profile-back { background: rgba(30, 41, 59, .9); color: var(--text); }
html.theme-dark .profile-back:hover { background: #334155; }
html.theme-dark .chat-message.theirs .chat-voice .cv-speed,
html.theme-dark .sn-vrec-draft .chat-voice .cv-speed { color: #e2e8f0; }
