.root {
    -fx-base: #ffffff;
    -fx-text-base-color: #000000;
}

/* Sidebar buttons */
.sidebar-btn {
    -fx-background-color: transparent;
    -fx-text-fill: black;
    -fx-font-size: 14px;
    -fx-pref-width: 230;
    -fx-alignment: CENTER_LEFT;
    -fx-padding: 8 0 8 16;
}
.sidebar-btn:hover {
    -fx-background-color: #e6e6e6;
    -fx-cursor: hand;
}

/* Telegram-style toggle switch */
.telegram-toggle {
    -fx-background-color: #aaa;
    -fx-background-radius: 15;
    -fx-padding: 2;
    -fx-pref-width: 40;
    -fx-pref-height: 20;
    -fx-alignment: center-left;
    -fx-cursor: hand;
}
.telegram-toggle.on {
    -fx-background-color: #4fa8f0;
}
.toggle-thumb {
    -fx-background-color: white;
    -fx-background-radius: 50%;
    -fx-pref-width: 16;
    -fx-pref-height: 16;
    -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 3, 0, 0, 1);
}

/* Separator */
.thin-separator {
    -fx-background-color: transparent;
    -fx-padding: 0;
}
.thin-separator .line {
    -fx-border-color: #ccc;
    -fx-border-width: 0.5px;
}

/* Theme background & text */
#sidebarRoot {
    -fx-background-color: white;
}
.button, .label {
    -fx-text-fill: black;
}

/* SplitPane divider */
.split-pane:horizontal > .split-pane-divider {
    -fx-background-color: transparent;
    -fx-border-color: #cccccc;
    -fx-border-width: 0 1px 0 1px;
    -fx-padding: 0 0 0 0.5px;
}

.placeholder-label {
    -fx-text-fill: #2e3948;              /* text color */
    -fx-font-size: 13px;
    -fx-font-weight: bold;
    -fx-background-color: #f1f1f1;    /* bubble background */
    -fx-padding: 8 10 8 10;         /* top/right/bottom/left spacing */
    -fx-background-radius: 20;        /* rounded corners */
}

/* ===== Chat page (light) ===== */
.chat-root { -fx-background-color: #ffffff; }

/* Header bar */
.chat-header {
    -fx-background-color: #ffffff;
    -fx-border-color: #e6e6e6;
    -fx-border-width: 0 0 1 0;
}
.chat-title  { -fx-text-fill: #0f141a; -fx-font-size: 14px; -fx-font-weight: bold; }
.chat-status { -fx-text-fill: #7e8a97; -fx-font-size: 12px; }

/* Icon-only buttons */
.icon-btn {
    -fx-background-color: transparent;
    -fx-padding: 6 8 6 8;
    -fx-cursor: hand;
}
.icon-btn:hover {
    -fx-background-color: rgba(0,0,0,0.05);
    -fx-background-radius: 6;
}

/* Messages area */
.chat-scroll { -fx-background-color: transparent; }

/* Input bar */
.chat-input-bar {
    -fx-background-color: #f5f5f5;
    -fx-border-color: #e6e6e6;
    -fx-border-width: 1 0 0 0;
}

/* Send button (telegram-ish blue) */
.send-btn {
    -fx-background-color: #2ca4ff;
    -fx-background-radius: 18;
    -fx-padding: 8 12 8 12;
    -fx-cursor: hand;
}
.send-btn:hover { -fx-background-color: #1996f3; }

/* Active/empty states (matches controller’s styleClass) */
.send-btn.send-empty {
    -fx-opacity: 0.5; /* look inactive */
}
.send-btn.send-ready {
    -fx-opacity: 1.0; /* fully active */
}
.send-btn:disabled {
    -fx-opacity: 0.4;
    -fx-cursor: default;
}

/* Input bubble */
.msg-input {
    -fx-background-color: white;
    -fx-background-radius: 18;
    -fx-padding: 6 12 6 12;
    -fx-text-fill: #0f141a;
    -fx-prompt-text-fill: #9aa6b2;
    -fx-border-color: transparent;

    -fx-control-inner-background: white;
    -fx-focus-color: transparent;
    -fx-faint-focus-color: transparent;
}
.msg-input .scroll-pane {
    -fx-vbar-policy: never;
    -fx-hbar-policy: never;
    -fx-background-color: transparent;
}
.msg-input .scroll-pane .corner {
    -fx-background-color: transparent;
}

/* Context menu */
.context-menu {
    -fx-background-color: white;
    -fx-background-radius: 6;
    -fx-padding: 4;
    -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.2), 8, 0, 0, 2);
}

.menu-item {
    -fx-font-size: 13px;
    -fx-text-fill: #0f141a;
    -fx-padding: 6 12;
}

.menu-item:focused {
    -fx-background-color: #e6e6e6;
    -fx-background-radius: 4;
}


/* ===== Search panel (light) ===== */
.chat-search-pane { -fx-background-color: #f5f5f5; }
.chat-search-bar { -fx-background-color: transparent; -fx-padding: 8 10; }
.search-placeholder { -fx-text-fill: #7e8a97; -fx-font-size: 13px; }

/* ===== Global search bar ===== */
.global-search {
    -fx-background-color: #f5f5f5;
    -fx-background-radius: 15;
    -fx-text-fill: #0f141a;
    -fx-prompt-text-fill: #9aa6b2;
}

/* ===== Chat list ===== */
.chat-list { -fx-background-color: #ffffff; }
.chat-list .label { -fx-text-fill: #0f141a; }

/* ===== Sidebar / Left Pane ===== */
.sidebar-pane {
    -fx-background-color: #ffffff;
}

.sidebar-topbar {
    -fx-background-color: transparent;
}

.menu-btn {
    -fx-background-color: transparent;
    -fx-cursor: hand;
}

.global-search-pane {
    -fx-background-color: #f5f5f5;
    -fx-background-radius: 15;
    -fx-text-fill: #0f141a;
    -fx-prompt-text-fill: #7e8a97;
    -fx-border-color: transparent;
}

/* Chat list */
.chat-list {
    -fx-background-color: transparent;
}

.chat-scroll {
    -fx-background-color: transparent;
}

/* ===== Search Panel ===== */
.chat-search-pane {
    -fx-background-color: #f5f5f5;
}

.search-label {
    -fx-text-fill: #7e8a97;
    -fx-font-size: 11px;
    -fx-padding: 10 0 5 10;
}

.search-separator {
    -fx-background-color: #e6e6e6;
}

.search-scope-bar {
    -fx-padding: 8 10;
    -fx-border-color: #e6e6e6;
    -fx-border-width: 0 0 1 0;
}

.search-scope {
    -fx-text-fill: #7e8a97;
    -fx-font-size: 11px;
}

.close-btn {
    -fx-background-color: transparent;
    -fx-cursor: hand;
}

/* ===== Right Chat Panel ===== */
.chat-display {
    -fx-background-color: #fafafa;
}

/* ===== Overlay ===== */
.overlay {
    -fx-background-color: rgba(0,0,0,0.3);
}

/* Chat item container */
.chat-item {
    -fx-background-color: #ffffff;
    -fx-padding: 10;
    -fx-border-color: #ddd;
    -fx-border-width: 0 0 1 0;
}

.chat-item:hover {
    -fx-background-color: #f5f5f5;
    -fx-cursor: hand;
}

/* Chat details */
.chat-name {
    -fx-font-size: 14;
    -fx-font-weight: bold;
    -fx-text-fill: #0f141a;
}

.chat-last-message {
    -fx-text-fill: #7e8a97;
    -fx-font-size: 12;
}

/* Time + unread */
.chat-time {
    -fx-font-size: 11;
    -fx-text-fill: #7e8a97;
}

/* Unread counter (same for both modes) */
.unread-count {
    -fx-background-color: #2196f3; /* blue bubble */
    -fx-text-fill: white !important;          /* always white */
    -fx-font-size: 10px;
    -fx-padding: 3 6;
    -fx-background-radius: 10;
    -fx-font-weight: bold;
}

/* === Global Search List === */
.global-search-list .list-cell {
    -fx-padding: 8 10;
    -fx-background-color: transparent;
    -fx-border-color: #ddd;   /* light divider */
    -fx-border-width: 0 0 0.5 0;
    -fx-alignment: CENTER_LEFT;
}

.global-search-list .list-cell:hover {
    -fx-background-color: rgba(0, 0, 0, 0.05); /* light hover */
}

.global-search-title {
    -fx-font-size: 14px;
    -fx-font-weight: bold;
    -fx-text-fill: black;
}

.global-search-subtitle {
    -fx-font-size: 12px;
    -fx-text-fill: #666; /* gray for light mode */
}

/* Avatar placeholder (if no image) */
.global-search-avatar {
    -fx-background-radius: 50%;
    -fx-background-color: #bbb;
    -fx-min-width: 36;
    -fx-min-height: 36;
}

/* Global search panel */
.global-search-pane {
    -fx-background-color: -fx-base;
}

.search-header {
    -fx-padding: 8 12;
    -fx-background-color: transparent;
    -fx-border-color: #ddd;
    -fx-border-width: 0 0 1 0;
}

.search-header-label {
    -fx-font-size: 13px;
    -fx-font-weight: bold;
    -fx-text-fill: -fx-text-base-color;
}

.no-results-label {
    -fx-font-size: 12px;
    -fx-text-fill: gray;
}

.close-btn {
    -fx-background-color: transparent;
    -fx-cursor: hand;
    -fx-font-size: 14px;
}

/* ===== Global Search Result Panel ===== */
.search-results-container {
    -fx-background-color: -fx-base;
    -fx-padding: 8;
    -fx-spacing: 6;
    -fx-border-color: transparent transparent #ddd transparent;
    -fx-border-width: 0 0 1 0;
}

.search-results-title {
    -fx-font-weight: bold;
    -fx-font-size: 13px;
    -fx-text-fill: -fx-text-base-color;
}

.search-result-item {
    -fx-background-color: transparent;
    -fx-padding: 6 10;
    -fx-spacing: 8;
}

.search-result-item:hover {
    -fx-background-color: rgba(0,0,0,0.05);
}

/* Avatar always square, not squeezed */
.search-result-avatar {
    -fx-fit-width: 40;
    -fx-fit-height: 40;
    -fx-preserve-ratio: true;
}

/* Close button */
.search-close-btn {
    -fx-background-color: transparent;
    -fx-text-fill: -fx-text-base-color;
    -fx-font-size: 14px;
    -fx-cursor: hand;
}
