/* NexusOS — Segment 9: dialogs, message dialogs, infobars, app notifications,
   assistants/wizards. Semantic colors (info/warning/error/success) get matched
   bg + a left-edge accent so the message type reads at a glance. */

/* ── Generic dialog window ───────────────────────────────── */

dialog,
messagedialog {
    background-color: @base_bg;
    color: @text_primary;
}

dialog.background,
messagedialog.background {
    background-color: @base_bg;
}

dialog > box.dialog-vbox,
messagedialog > box.dialog-vbox {
    padding: 6px;
}

/* The titlebar on dialogs (when CSD) — already styled by Segment 3, but
   trim the bottom border so it reads as "part of the dialog" not "separate
   chrome". */
dialog > headerbar,
messagedialog > headerbar {
    background-color: @surface_bg_alt;
    border-bottom: 1px solid @border;
}

dialog > headerbar.flat,
messagedialog > headerbar.flat {
    background-color: transparent;
    border-bottom-color: transparent;
}

/* Action button row at the bottom of a dialog */
dialog .dialog-action-area,
messagedialog .dialog-action-area,
.dialog-action-box {
    background-color: @surface_bg;
    border-top: 1px solid @border;
    padding: 10px 12px;
}

dialog .dialog-action-area > button,
messagedialog .dialog-action-area > button,
.dialog-action-box > button {
    min-width: 84px;
}

/* Body / icon area of a message dialog */
messagedialog .dialog-vbox > box {
    padding: 18px 18px 8px 18px;
}

messagedialog .horizontal {
    padding: 8px;
}

messagedialog .titlebar:not(.flat) {
    background-color: @surface_bg_alt;
}

/* Title and secondary text in a message dialog */
messagedialog label.title {
    font-weight: 700;
    font-size: 1.1em;
    color: @text_primary;
}

messagedialog label {
    color: @text_primary;
}

messagedialog label.dim-label,
messagedialog .dim-label {
    color: @text_secondary;
}

/* ── About / file-chooser dialog tweaks ──────────────────── */

filechooser stack {
    background-color: @base_bg;
}

filechooser actionbar {
    background-color: @surface_bg;
    border-top: 1px solid @border;
}

/* Path bar inside the file chooser */
.path-bar button {
    border-radius: 0;
    border: none;
    border-right: 1px solid @border;
    background-color: transparent;
}

.path-bar button:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.path-bar button:last-child {
    border-right: none;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.path-bar button:checked {
    background-color: @active_bg;
    color: @active_fg;
}

.path-bar button.text-button:not(:only-child):not(:first-child) {
    padding-left: 8px;
}

/* ── Infobars ────────────────────────────────────────────── */

infobar {
    background-color: @surface_bg_alt;
    color: @text_primary;
    border: 1px solid @border;
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: inset 4px 0 0 0 @brand_green;     /* default = info accent */
    min-height: 36px;
}

infobar > revealer > box {
    padding: 0;
}

infobar label {
    color: @text_primary;
}

infobar button {
    /* Buttons inside infobars stay flat, with brand hover */
    background-color: transparent;
    border-color: transparent;
    color: @text_primary;
}

infobar button:hover {
    background-color: alpha(@text_primary, 0.10);
}

infobar button:focus {
    outline: 2px solid @focus_ring;
    outline-offset: -2px;
}

infobar button.text-button {
    font-weight: 500;
}

/* Semantic variants — left-edge accent + tinted background */

infobar.info {
    background-color: alpha(@info_color, 0.12);
    box-shadow: inset 4px 0 0 0 @info_color;
}

infobar.info label {
    color: @text_primary;
}

infobar.question {
    background-color: alpha(@brand_purple, 0.18);
    box-shadow: inset 4px 0 0 0 @brand_purple;
}

infobar.warning {
    background-color: alpha(@warning_color, 0.18);
    box-shadow: inset 4px 0 0 0 @warning_color;
}

infobar.warning label {
    color: @text_primary;
}

infobar.error {
    background-color: alpha(@error_color, 0.18);
    box-shadow: inset 4px 0 0 0 @error_color;
}

infobar.error label {
    color: @text_primary;
}

infobar.success {
    background-color: alpha(@success_color, 0.18);
    box-shadow: inset 4px 0 0 0 @success_color;
}

infobar.success label {
    color: @text_primary;
}

/* The close (X) button on an infobar */
infobar button.close {
    min-width: 22px;
    min-height: 22px;
    padding: 2px;
    border-radius: 999px;
    color: @text_secondary;
}

infobar button.close:hover {
    background-color: alpha(@text_primary, 0.15);
    color: @text_primary;
}

/* ── App notifications (overlay banners) ─────────────────── */

.app-notification,
.app-notification.frame {
    background-color: @overlay_bg;
    color: @text_primary;
    border: 1px solid @border_strong;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 8px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45),
                0 2px 4px  rgba(0, 0, 0, 0.30);
}

.app-notification button,
.app-notification.frame button {
    background-color: transparent;
    border-color: transparent;
    color: @brand_green_light;
}

.app-notification button:hover {
    background-color: @hover_bg;
    color: @brand_green;
}

.app-notification button.suggested-action {
    background-color: @brand_green;
    color: @text_on_accent;
    border-color: @brand_green_dark;
}

.app-notification button.destructive-action {
    background-color: @error_color;
    color: #ffffff;
}

/* ── Assistant / wizard ──────────────────────────────────── */

assistant {
    background-color: @base_bg;
    color: @text_primary;
}

assistant .sidebar {
    background-color: @surface_bg;
    border-right: 1px solid @border;
    padding: 6px;
}

assistant .sidebar label {
    padding: 6px 10px;
    color: @text_secondary;
    border-radius: 4px;
}

assistant .sidebar label.highlight {
    background-color: @selected_bg;
    color: @selected_fg;
    font-weight: 500;
}

assistant headerbar {
    background-color: @surface_bg_alt;
}

/* ── Frames & separators inside dialogs ──────────────────── */

frame > border,
.frame {
    border: 1px solid @border;
    border-radius: 6px;
    padding: 0;
}

/* Breathing room so group content doesn't sit flush against the
   frame border. XFCE settings dialogs indent frame content 12px on
   the left (the HIG sub-section indent), so the left padding is
   dropped to 0 and the right bumped to 12px to keep the gap even.
   Scoped to real GtkFrames — not the broad .frame class, which also
   lands on scrolledwindows. */
frame > border {
    padding: 6px 12px 6px 0;
}

frame > label,
.frame > label {
    color: @text_secondary;
    font-weight: 500;
    padding: 0 4px;
}

separator {
    background-color: @border;
    min-width: 1px;
    min-height: 1px;
}

separator.horizontal {
    min-height: 1px;
}

separator.vertical {
    min-width: 1px;
}

/* Dim label utility — used in lots of dialog body text */
.dim-label,
label.dim-label {
    color: @text_secondary;
    opacity: 1.0;            /* GTK's default also dims via opacity — we just recolor */
}
