/* ashyterm/data/styles/window.css
 * Main window styles for Ashy Terminal
 */

/* Theme selector checkbuttons */
.themeselector {
    margin: 9px;
}

.themeselector checkbutton {
    padding: 1px;
    min-height: 44px;
    min-width: 44px;
    background-clip: content-box;
    border-radius: 9999px;
    box-shadow: inset 0 0 0 1px @borders;
}

.themeselector checkbutton:checked {
    box-shadow: inset 0 0 0 2px @accent_bg_color;
}

.themeselector checkbutton.follow {
    background-image: linear-gradient(to bottom right, #fff 49.99%, #202020 50.01%);
}

.themeselector checkbutton.light {
    background-color: #fff;
}

.themeselector checkbutton.dark {
    background-color: #202020;
}

.themeselector checkbutton.terminal {
    background: linear-gradient(45deg, #000 50%, #fff 50%);
}

.themeselector checkbutton radio {
    -gtk-icon-source: none;
    border: none;
    background: none;
    box-shadow: none;
    min-width: 12px;
    min-height: 12px;
    transform: translate(27px, 14px);
    padding: 2px;
}

.themeselector checkbutton radio:checked {
    -gtk-icon-source: -gtk-icontheme("object-select-symbolic");
    background-color: @accent_bg_color;
    color: @accent_fg_color;
}

/* Header bar styles */
headerbar.main-header-bar {
    min-height: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

.main-header-bar box {
    margin: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
}

/* Drop target highlight */
.drop-target {
    background-color: alpha(@theme_selected_bg_color, 0.5);
}

/* Sessions tree styling */
.sessions-tree .card {
    margin: 2px 4px;
    padding: 6px;
    border-radius: 6px;
}

.sessions-tree .card:hover {
    background-color: @theme_bg_color;
}

.sessions-tree row:selected .card {
    background-color: @accent_bg_color;
    color: @accent_fg_color;
}

/* Paned and popover separators */
paned separator {
    background: var(--view-bg-color);
}

popover.menu separator {
    background-color: color-mix(in srgb, var(--headerbar-border-color) var(--border-opacity), transparent);
}

/* Tab bar scrollbar */
#scrolled_tab_bar scrollbar trough {
    margin: 0px;
}

#scrolled_tab_bar button {
    min-width: 24px;
    margin-right: 8px;
    margin: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
}

/* Custom tab button styling */
.custom-tab-button {
    padding-left: 12px;
    padding-right: 0px;
    border-radius: 10px;
    padding-top: 2px;
    padding-bottom: 2px;
}

.custom-tab-button.active {
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.custom-tab-button:hover {
    background: color-mix(in srgb, currentColor 7%, transparent);
}

/* Tab bell animation */
@keyframes tab-bell-flash {
    0% {
        background: @warning_bg_color;
    }

    50% {
        background: transparent;
    }

    100% {
        background: @warning_bg_color;
    }
}

.custom-tab-button.tab-bell {
    animation: tab-bell-flash 0.5s ease-in-out 2;
}

/* Sidebar toolbar view */
.sidebar-toolbar-view {
    /* Background and borders removed for dynamic theming inheritance */
    min-width: 350px;
}

.sidebar-toolbar-view button {
    min-width: 32px;
    min-height: 32px;
    padding: 6px;
    margin: 2px;
    border-radius: 6px;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    background: transparent;
}

.sidebar-toolbar-view button:hover {
    background-color: alpha(@accent_bg_color, 0.12);
    transform: scale(1.02);
    box-shadow: 0 1px 3px alpha(@accent_bg_color, 0.2);
}

.sidebar-toolbar-view button:active {
    background-color: alpha(@accent_bg_color, 0.18);
    transform: scale(0.98);
    transition-duration: 100ms;
}

.sidebar-toolbar-view button.destructive:hover {
    background-color: alpha(@destructive_color, 0.12);
    box-shadow: 0 1px 3px alpha(@destructive_color, 0.2);
}

.sidebar-toolbar-view button.destructive:active {
    background-color: alpha(@destructive_color, 0.18);
}

/* Sidebar search */
.sidebar-search {
    padding: 8px 12px 12px 12px;
    /* background: @window_bg_color; removed */
}

.sidebar-search entry {
    border-radius: 6px;
}

.sidebar-session-tree viewport {
    background: transparent;
}

.sidebar-session-tree listview {
    background: transparent;
}

.sidebar-session-tree row {
    padding: 4px 12px;
    margin: 1px 8px;
    border-radius: 4px;
    transition: background-color 150ms ease;
}

.sidebar-session-tree row:hover {
    background-color: alpha(currentColor, 0.08);
}

.sidebar-session-tree row:selected {
    background-color: alpha(currentColor, 0.12);
}

.sidebar-session-tree row:selected:hover {
    background-color: alpha(currentColor, 0.15);
}

/* Sidebar toggle button styling - hover only, no active background */
.sidebar-toggle-button:active,
.sidebar-toggle-button:checked {
    background: transparent;
}

/* Sidebar popover overrides for a perfectly flat, borderless look */
popover.sidebar-popover>contents {
    padding: 0;
    background: var(--sidebar-bg-color, @view_bg_color);
    color: @window_fg_color;
}

popover.sidebar-popover>arrow {
    background: var(--sidebar-bg-color, @view_bg_color);
}

/* Sidebar container - simple box layout */
.sidebar-container {
    min-width: 350px;
    background: var(--sidebar-bg-color, @view_bg_color);
}

/* Sidebar toolbar */
.sidebar-toolbar {
    background: var(--sidebar-bg-color, @view_bg_color);
    padding-top: 2px;
}

.sidebar-toolbar button {
    min-width: 32px;
    min-height: 32px;
    padding: 6px;
    margin: 2px;
    border-radius: 4px;
    transition: background-color 150ms ease;
    border: none;
    background: transparent;
}

.sidebar-toolbar button:hover {
    background-color: alpha(currentColor, 0.1);
}

.sidebar-toolbar button:active {
    background-color: alpha(currentColor, 0.15);
}

.sidebar-toolbar button.destructive:hover {
    background-color: alpha(@destructive_color, 0.1);
}

.sidebar-toolbar button.destructive:active {
    background-color: alpha(@destructive_color, 0.15);
}

/* Sidebar popover specific styles */
/* Sidebar popover specific styles - Removed redundant overrides */

/* Flipped icon utility */
.flipped-icon {
    transform: scaleX(-1);
}

/* Dialog action bar styling for consistent theming */
window.ashyterm-dialog actionbar {
    background: none;
    background-color: @headerbar_bg_color;
}

window.ashyterm-dialog actionbar>revealer>box {
    background: none;
    background-color: @headerbar_bg_color;
}


.inline-context-menu .title-3 {
    font-size: 1em;
}

.inline-context-menu button {
    border-radius: 6px;
    margin: 1px 0;
    min-height: 32px;
}

.inline-context-menu button:hover {
    background-color: alpha(currentColor, 0.08);
}

.inline-context-menu button:active {
    background-color: alpha(currentColor, 0.12);
}

.inline-context-menu button.destructive-action {
    color: @destructive_color;
}

.inline-context-menu button.destructive-action:hover {
    background-color: alpha(@destructive_color, 0.08);
}

.inline-context-menu button.destructive-action:active {
    background-color: alpha(@destructive_color, 0.12);
}

/* Command toolbar styles */
.command-toolbar {
    background: @headerbar_bg_color;
    padding: 4px 12px;
    min-height: 32px;
}

.toolbar-command-button {
    padding: 4px 10px;
    border-radius: 6px;
    min-height: 24px;
}

.toolbar-command-button:hover {
    background-color: alpha(currentColor, 0.08);
}

.toolbar-command-button:active {
    background-color: alpha(currentColor, 0.12);
}

/* Broadcast mode active indicator */
.broadcast-active headerbar {
    background-color: mix(@warning_bg_color, @headerbar_bg_color, 0.25);
    box-shadow: inset 0 -3px 0 0 @warning_bg_color;
}