/* ===== Dark Theme Root ===== */
.root {
    -fx-background-color: #0f1c26;  /* overall dark base */
    -fx-text-fill: #e8f1f8;
}

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

/* Telegram-style toggle switch */
.telegram-toggle {
    -fx-background-color: #555;
    -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: #2e3948; /* Telegram's subtle dark line */
    -fx-border-width: 0.5px;
}

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

/* Thin Telegram-like SplitPane divider (dark) */
.split-pane:horizontal > .split-pane-divider {
    -fx-background-color: transparent; /* no big solid block */
    -fx-border-color: #cccccc; /* the visible thin line */
    -fx-border-width: 0 1px 0 1px; /* 1px vertical line */
    -fx-padding: 0 0 0 0.5px; /* big invisible hitbox for the mouse */
}

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

/* ===== Chat page (dark) ===== */
.chat-root { -fx-background-color: #0f1c26; }

/* Header bar */
.chat-header {
    -fx-background-color: #0f1c26;
    -fx-border-color: #2e3948;
    -fx-border-width: 0 0 1 0;
}
.chat-title  { -fx-text-fill: #e8f1f8; -fx-font-size: 14px; -fx-font-weight: bold; }
.chat-status { -fx-text-fill: #8ea1b2; -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(255,255,255,0.06);
    -fx-background-radius: 6;
}

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

/* Input bar */
.chat-input-bar {
    -fx-background-color: #15222d;
    -fx-border-color: #2e3948;
    -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: #1b2b39;   /* dark bluish background */
    -fx-control-inner-background: #1b2b39;
    -fx-text-fill: #e8f1f8;
    -fx-prompt-text-fill: #8ea1b2;
    -fx-background-radius: 18;
    -fx-padding: 6 12 6 12;
    -fx-border-color: transparent;
    -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: #1b2735;
    -fx-background-radius: 6;
    -fx-padding: 4;
    -fx-effect: dropshadow(gaussian, rgba(0,0,0,0.4), 8, 0, 0, 2);
}

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

.menu-item:focused {
    -fx-background-color: rgba(255,255,255,0.08);
    -fx-background-radius: 4;
}


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

/* ===== Global search bar ===== */
.global-search-pane {
    -fx-background-color: #1b2b39;
    -fx-background-radius: 15;
    -fx-text-fill: #e8f1f8;
    -fx-prompt-text-fill: #8ea1b2;
}

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

/* ===== Sidebar / Left Pane ===== */
.sidebar-pane {
    -fx-background-color: #1b2735; /* Telegram dark */
}

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

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

.global-search {
    -fx-background-color: #2a3a4a;
    -fx-background-radius: 15;
    -fx-text-fill: #e8f1f8;
    -fx-prompt-text-fill: #8ea1b2;
    -fx-border-color: transparent;
}

/* Chat list */
.chat-list {
    -fx-background-color: #0f1c26;
}

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

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

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

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

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

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

.close-btn {
    -fx-background-color: transparent;
    -fx-cursor: hand;
    -fx-text-fill: #e8f1f8;
}

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

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

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

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

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

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

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

/* 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 (Dark) === */
.global-search-list {
    -fx-background-color: #1b2735;              /* uniform dark background */
    -fx-control-inner-background: #1b2735;
    -fx-control-inner-background-alt: #1b2735;  /* disable stripes */
}

.global-search-list .virtual-flow,
.global-search-list .clipped-container,
.global-search-list .sheet {
    -fx-background-color: #1b2735;              /* internal containers same */
}

.global-search-list .list-cell {
    -fx-padding: 8 10;
    -fx-background-color: #1b2735;              /* solid dark rows */
    -fx-border-color: #2e3948;                  /* subtle divider */
    -fx-border-width: 0 0 0.5 0;
    -fx-alignment: CENTER_LEFT;
    -fx-text-fill: #e8f1f8;                     /* light text */
}

.global-search-list .list-cell:hover {
    -fx-background-color: rgba(255, 255, 255, 0.08); /* lighter on hover */
}

.global-search-list .list-cell:selected {
    -fx-background-color: #2a3a4a;              /* darker blue-gray on select */
}

/* Titles & subtitles */
.global-search-title {
    -fx-font-size: 14px;
    -fx-font-weight: bold;
    -fx-text-fill: #e8f1f8;
}
.global-search-subtitle {
    -fx-font-size: 12px;
    -fx-text-fill: #8ea1b2;                     /* muted gray-blue */
}

/* Search header */
.search-header {
    -fx-padding: 8 12;
    -fx-background-color: #1b2735;
    -fx-border-color: #2e3948;
    -fx-border-width: 0 0 1 0;
}
.search-header-label {
    -fx-font-size: 13px;
    -fx-font-weight: bold;
    -fx-text-fill: #e8f1f8;
}

/* No results */
.no-results-label {
    -fx-font-size: 12px;
    -fx-text-fill: #8ea1b2;
}

/* Avatar placeholders */
.global-search-avatar {
    -fx-background-radius: 50%;
    -fx-background-color: #444;
    -fx-min-width: 36;
    -fx-min-height: 36;
}

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