/*
 * Breeze Light color theme
 * Based on KDE Breeze's GTK 4 light palette.
 * Only color properties — layout is left to libadwaita.
 */

/* Foreground / text */
@define-color theme_fg_color_protonplus_breeze #232629;
@define-color theme_text_color_protonplus_breeze #232629;

/* Backgrounds */
@define-color theme_bg_color_protonplus_breeze #eff0f1;
@define-color theme_base_color_protonplus_breeze #fcfcfc;
@define-color content_view_bg_protonplus_breeze #fcfcfc;

/* Selection / accent */
@define-color theme_selected_bg_color_protonplus_breeze #3daee9;
@define-color theme_selected_fg_color_protonplus_breeze #000000;
@define-color accent_color_protonplus_breeze #006fa6;
@define-color theme_hovering_selected_bg_color_protonplus_breeze #3daee9;
@define-color theme_view_hover_decoration_color_protonplus_breeze #3daee9;
@define-color theme_view_active_decoration_color_protonplus_breeze #3daee9;

/* Insensitive */
@define-color insensitive_bg_color_protonplus_breeze #eff0f1;
@define-color insensitive_fg_color_protonplus_breeze rgba(35, 38, 41, 0.45);
@define-color insensitive_base_color_protonplus_breeze rgba(35, 38, 41, 0.45);
@define-color insensitive_base_fg_color_protonplus_breeze #fcfcfc;
@define-color insensitive_selected_bg_color_protonplus_breeze rgba(61, 174, 233, 0.45);
@define-color insensitive_selected_fg_color_protonplus_breeze rgba(35, 38, 41, 0.45);

/* Unfocused / backdrop */
@define-color theme_unfocused_fg_color_protonplus_breeze #232629;
@define-color theme_unfocused_text_color_protonplus_breeze #232629;
@define-color theme_unfocused_bg_color_protonplus_breeze #eff0f1;
@define-color theme_unfocused_base_color_protonplus_breeze #fcfcfc;
@define-color theme_unfocused_selected_bg_color_alt_protonplus_breeze #3daee9;
@define-color theme_unfocused_selected_bg_color_protonplus_breeze rgba(61, 174, 233, 0.5);
@define-color theme_unfocused_selected_fg_color_protonplus_breeze #ffffff;
@define-color theme_unfocused_view_text_color_protonplus_breeze rgba(35, 38, 41, 0.45);
@define-color theme_unfocused_view_bg_color_protonplus_breeze #f5f6f7;
@define-color insensitive_unfocused_selected_bg_color_protonplus_breeze rgba(61, 174, 233, 0.45);
@define-color insensitive_unfocused_fg_color_protonplus_breeze rgba(35, 38, 41, 0.45);
@define-color insensitive_unfocused_bg_color_protonplus_breeze #eff0f1;
@define-color insensitive_unfocused_selected_fg_color_protonplus_breeze rgba(35, 38, 41, 0.45);

/* Borders */
@define-color borders_protonplus_breeze #c4c7c9;
@define-color unfocused_borders_protonplus_breeze #c4c7c9;
@define-color insensitive_borders_protonplus_breeze rgba(35, 38, 41, 0.25);
@define-color unfocused_insensitive_borders_protonplus_breeze rgba(35, 38, 41, 0.25);

/* Buttons */
@define-color theme_button_background_normal_protonplus_breeze #eff0f1;
@define-color theme_button_decoration_hover_protonplus_breeze #3daee9;
@define-color theme_button_decoration_focus_protonplus_breeze #3daee9;
@define-color theme_button_foreground_normal_protonplus_breeze #232629;
@define-color theme_button_foreground_active_protonplus_breeze #232629;
@define-color theme_button_background_insensitive_protonplus_breeze rgba(239, 240, 241, 0.65);
@define-color theme_button_decoration_hover_insensitive_protonplus_breeze rgba(61, 174, 233, 0.45);
@define-color theme_button_decoration_focus_insensitive_protonplus_breeze rgba(61, 174, 233, 0.45);
@define-color theme_button_foreground_insensitive_protonplus_breeze rgba(35, 38, 41, 0.45);
@define-color theme_button_foreground_active_insensitive_protonplus_breeze rgba(35, 38, 41, 0.45);
@define-color theme_button_background_backdrop_protonplus_breeze #eff0f1;
@define-color theme_button_decoration_hover_backdrop_protonplus_breeze #3daee9;
@define-color theme_button_decoration_focus_backdrop_protonplus_breeze #3daee9;
@define-color theme_button_foreground_backdrop_protonplus_breeze #232629;
@define-color theme_button_foreground_active_backdrop_protonplus_breeze #232629;
@define-color theme_button_background_backdrop_insensitive_protonplus_breeze rgba(239, 240, 241, 0.65);
@define-color theme_button_decoration_hover_backdrop_insensitive_protonplus_breeze rgba(61, 174, 233, 0.45);
@define-color theme_button_decoration_focus_backdrop_insensitive_protonplus_breeze rgba(61, 174, 233, 0.45);
@define-color theme_button_foreground_backdrop_insensitive_protonplus_breeze rgba(35, 38, 41, 0.45);
@define-color theme_button_foreground_active_backdrop_insensitive_protonplus_breeze rgba(35, 38, 41, 0.45);

/* Status colors */
@define-color warning_color_protonplus_breeze #f67400;
@define-color error_color_protonplus_breeze #da4453;
@define-color success_color_protonplus_breeze #27ae60;

/* Links, titlebar, and tooltips */
@define-color link_color_protonplus_breeze #1d99f3;
@define-color link_visited_color_protonplus_breeze #9b59b6;
@define-color theme_titlebar_background_protonplus_breeze #eff0f1;
@define-color theme_titlebar_foreground_protonplus_breeze #232629;
@define-color theme_titlebar_background_light_protonplus_breeze #fcfcfc;
@define-color theme_titlebar_foreground_backdrop_protonplus_breeze #6b6e70;
@define-color theme_titlebar_background_backdrop_protonplus_breeze #e0e3e5;
@define-color theme_titlebar_foreground_insensitive_protonplus_breeze rgba(35, 38, 41, 0.45);
@define-color theme_titlebar_foreground_insensitive_backdrop_protonplus_breeze rgba(35, 38, 41, 0.35);
@define-color tooltip_text_protonplus_breeze #fcfcfc;
@define-color tooltip_background_protonplus_breeze #232629;
@define-color tooltip_border_protonplus_breeze #535659;

/* libadwaita color overrides */
@define-color accent_bg_color @theme_selected_bg_color_protonplus_breeze;
@define-color accent_fg_color @theme_selected_fg_color_protonplus_breeze;
@define-color accent_color @accent_color_protonplus_breeze;
@define-color window_bg_color @theme_bg_color_protonplus_breeze;
@define-color window_fg_color @theme_fg_color_protonplus_breeze;
@define-color view_bg_color @theme_base_color_protonplus_breeze;
@define-color view_fg_color @theme_text_color_protonplus_breeze;
@define-color headerbar_bg_color @theme_titlebar_background_protonplus_breeze;
@define-color headerbar_fg_color @theme_titlebar_foreground_protonplus_breeze;
@define-color headerbar_border_color @borders_protonplus_breeze;
@define-color headerbar_backdrop_color @theme_titlebar_background_backdrop_protonplus_breeze;
@define-color headerbar_shade_color rgba(0, 0, 0, 0.12);
@define-color headerbar_darker_shade_color rgba(0, 0, 0, 0.25);
@define-color sidebar_bg_color @theme_button_background_normal_protonplus_breeze;
@define-color sidebar_fg_color @theme_fg_color_protonplus_breeze;
@define-color sidebar_backdrop_color #e0e3e5;
@define-color sidebar_shade_color rgba(0, 0, 0, 0.12);
@define-color sidebar_border_color rgba(0, 0, 0, 0.18);
@define-color secondary_sidebar_bg_color #e0e3e5;
@define-color secondary_sidebar_fg_color @theme_fg_color_protonplus_breeze;
@define-color secondary_sidebar_backdrop_color @theme_bg_color_protonplus_breeze;
@define-color secondary_sidebar_shade_color rgba(0, 0, 0, 0.12);
@define-color secondary_sidebar_border_color rgba(0, 0, 0, 0.18);
@define-color card_bg_color rgba(255, 255, 255, 0.65);
@define-color card_fg_color @theme_fg_color_protonplus_breeze;
@define-color card_shade_color rgba(0, 0, 0, 0.12);
@define-color dialog_bg_color @theme_base_color_protonplus_breeze;
@define-color dialog_fg_color @theme_fg_color_protonplus_breeze;
@define-color popover_bg_color @theme_base_color_protonplus_breeze;
@define-color popover_fg_color @theme_fg_color_protonplus_breeze;
@define-color popover_shade_color rgba(0, 0, 0, 0.16);
@define-color thumbnail_bg_color #e0e3e5;
@define-color thumbnail_fg_color @theme_fg_color_protonplus_breeze;
@define-color shade_color rgba(0, 0, 0, 0.12);
@define-color scrollbar_outline_color rgba(0, 0, 0, 0.3);
@define-color destructive_bg_color @error_color_protonplus_breeze;
@define-color destructive_fg_color white;
@define-color destructive_color @error_color_protonplus_breeze;
@define-color success_bg_color @success_color_protonplus_breeze;
@define-color success_fg_color black;
@define-color success_color @success_color_protonplus_breeze;
@define-color warning_bg_color @warning_color_protonplus_breeze;
@define-color warning_fg_color black;
@define-color warning_color @warning_color_protonplus_breeze;
@define-color error_bg_color @error_color_protonplus_breeze;
@define-color error_fg_color white;
@define-color error_color @error_color_protonplus_breeze;

/* Keep libadwaita's CSS custom properties in sync with the Breeze palette. */
* {
  --accent-bg-color: @theme_selected_bg_color_protonplus_breeze;
  --accent-fg-color: @theme_selected_fg_color_protonplus_breeze;
  --accent-color: @accent_color_protonplus_breeze;
  --window-bg-color: @theme_bg_color_protonplus_breeze;
  --window-fg-color: @theme_fg_color_protonplus_breeze;
  --view-bg-color: @theme_base_color_protonplus_breeze;
  --view-fg-color: @theme_text_color_protonplus_breeze;
  --headerbar-bg-color: @theme_titlebar_background_protonplus_breeze;
  --headerbar-fg-color: @theme_titlebar_foreground_protonplus_breeze;
  --headerbar-border-color: @borders_protonplus_breeze;
  --headerbar-backdrop-color: @theme_titlebar_background_backdrop_protonplus_breeze;
  --headerbar-shade-color: rgba(0, 0, 0, 0.12);
  --headerbar-darker-shade-color: rgba(0, 0, 0, 0.25);
  --sidebar-bg-color: @theme_button_background_normal_protonplus_breeze;
  --sidebar-fg-color: @theme_fg_color_protonplus_breeze;
  --sidebar-backdrop-color: #e0e3e5;
  --sidebar-border-color: rgba(0, 0, 0, 0.18);
  --sidebar-shade-color: rgba(0, 0, 0, 0.12);
  --secondary-sidebar-bg-color: #e0e3e5;
  --secondary-sidebar-fg-color: @theme_fg_color_protonplus_breeze;
  --secondary-sidebar-backdrop-color: @theme_bg_color_protonplus_breeze;
  --secondary-sidebar-border-color: rgba(0, 0, 0, 0.18);
  --secondary-sidebar-shade-color: rgba(0, 0, 0, 0.12);
  --card-bg-color: rgba(255, 255, 255, 0.65);
  --card-fg-color: @theme_fg_color_protonplus_breeze;
  --card-shade-color: rgba(0, 0, 0, 0.12);
  --dialog-bg-color: @theme_base_color_protonplus_breeze;
  --dialog-fg-color: @theme_fg_color_protonplus_breeze;
  --popover-bg-color: @theme_base_color_protonplus_breeze;
  --popover-fg-color: @theme_fg_color_protonplus_breeze;
  --popover-shade-color: rgba(0, 0, 0, 0.16);
  --thumbnail-bg-color: #e0e3e5;
  --thumbnail-fg-color: @theme_fg_color_protonplus_breeze;
  --shade-color: rgba(0, 0, 0, 0.12);
  --scrollbar-outline-color: rgba(0, 0, 0, 0.3);
  --destructive-bg-color: @error_color_protonplus_breeze;
  --destructive-fg-color: #ffffff;
  --destructive-color: @error_color_protonplus_breeze;
  --success-bg-color: @success_color_protonplus_breeze;
  --success-fg-color: #000000;
  --success-color: @success_color_protonplus_breeze;
  --warning-bg-color: @warning_color_protonplus_breeze;
  --warning-fg-color: #000000;
  --warning-color: @warning_color_protonplus_breeze;
  --error-bg-color: @error_color_protonplus_breeze;
  --error-fg-color: #ffffff;
  --error-color: @error_color_protonplus_breeze;
}

/* GTK standard color aliases */
@define-color theme_fg_color @theme_fg_color_protonplus_breeze;
@define-color theme_text_color @theme_text_color_protonplus_breeze;
@define-color theme_bg_color @theme_bg_color_protonplus_breeze;
@define-color theme_base_color @theme_base_color_protonplus_breeze;
@define-color theme_selected_bg_color @theme_selected_bg_color_protonplus_breeze;
@define-color theme_selected_fg_color @theme_selected_fg_color_protonplus_breeze;
@define-color insensitive_bg_color @insensitive_bg_color_protonplus_breeze;
@define-color insensitive_fg_color @insensitive_fg_color_protonplus_breeze;
@define-color insensitive_base_color @insensitive_base_color_protonplus_breeze;
@define-color theme_unfocused_fg_color @theme_unfocused_fg_color_protonplus_breeze;
@define-color theme_unfocused_text_color @theme_unfocused_text_color_protonplus_breeze;
@define-color theme_unfocused_bg_color @theme_unfocused_bg_color_protonplus_breeze;
@define-color theme_unfocused_base_color @theme_unfocused_base_color_protonplus_breeze;
@define-color theme_unfocused_selected_bg_color @theme_unfocused_selected_bg_color_protonplus_breeze;
@define-color theme_unfocused_selected_fg_color @theme_unfocused_selected_fg_color_protonplus_breeze;
@define-color unfocused_insensitive_color @insensitive_unfocused_bg_color_protonplus_breeze;
@define-color borders @borders_protonplus_breeze;
@define-color unfocused_borders @unfocused_borders_protonplus_breeze;
@define-color content_view_bg @content_view_bg_protonplus_breeze;
@define-color text_view_bg @content_view_bg_protonplus_breeze;

/* Breeze-style controls */
.tools-release-row-input-box {
  border-radius: 3px;
}

button {
  border-radius: 3px;
  outline: 1px solid @borders_protonplus_breeze;
  outline-offset: -1px;
  background: @theme_button_background_normal_protonplus_breeze;
  color: @theme_button_foreground_normal_protonplus_breeze;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125);
  text-shadow: none;
  -gtk-icon-shadow: none;
  font-weight: normal;
}

button:hover,
button:focus {
  outline-color: @theme_button_decoration_hover_protonplus_breeze;
}

button:active {
  box-shadow: none;
  background: alpha(@theme_button_decoration_hover_protonplus_breeze, 0.333);
}

button:checked {
  background: alpha(@theme_button_foreground_normal_protonplus_breeze, 0.125);
  box-shadow: none;
}

button:disabled {
  box-shadow: none;
  color: @theme_button_foreground_insensitive_protonplus_breeze;
  outline-color: @insensitive_borders_protonplus_breeze;
  background: @theme_button_background_insensitive_protonplus_breeze;
}

button.suggested-action,
button.flat.suggested-action {
  background-color: alpha(@theme_button_decoration_focus_protonplus_breeze, 0.2);
  outline-color: mix(@theme_button_decoration_focus_protonplus_breeze,
    mix(@theme_button_background_normal_protonplus_breeze, @theme_button_foreground_normal_protonplus_breeze, 0.333), 0.5);
}

button.destructive-action,
button.flat.destructive-action {
  background-color: alpha(@error_color_protonplus_breeze, 0.2);
  outline-color: mix(@error_color_protonplus_breeze,
    mix(@theme_button_background_normal_protonplus_breeze, @theme_button_foreground_normal_protonplus_breeze, 0.333), 0.5);
}

button.suggested-action:hover { background-color: alpha(@theme_button_decoration_focus_protonplus_breeze, 0.35); }
button.destructive-action:hover { background-color: alpha(@error_color_protonplus_breeze, 0.35); }
button.circular { border-radius: 9999px; }

button.flat,
headerbar button:not(.suggested-action):not(.destructive-action) {
  outline-color: transparent;
  background: transparent;
  box-shadow: none;
}

button.controller-focus,
menubutton.controller-focus > button {
  color: @theme_selected_fg_color_protonplus_breeze;
  background: @theme_selected_bg_color_protonplus_breeze;
  outline: 2px solid @theme_selected_bg_color_protonplus_breeze;
  outline-offset: 1px;
  box-shadow: 0 0 0 2px rgba(61, 174, 233, 0.3);
}

button.flat:checked,
headerbar button:not(.suggested-action):not(.destructive-action):checked {
  outline-color: mix(@theme_button_background_normal_protonplus_breeze, @theme_button_foreground_normal_protonplus_breeze, 0.3);
  background-color: alpha(@theme_button_foreground_normal_protonplus_breeze, 0.125);
}

headerbar button:not(.suggested-action):not(.destructive-action) {
  color: @theme_titlebar_foreground_protonplus_breeze;
}

headerbar button:not(.suggested-action):not(.destructive-action):hover {
  outline-color: @theme_button_decoration_hover_protonplus_breeze;
  background-color: alpha(@theme_button_foreground_normal_protonplus_breeze, 0.08);
}

headerbar button:not(.suggested-action):not(.destructive-action):backdrop {
  color: @theme_titlebar_foreground_backdrop_protonplus_breeze;
}

headerbar stackswitcher button:not(.suggested-action):not(.destructive-action):not(:checked) {
  outline-color: alpha(@borders_protonplus_breeze, 0.6);
  background-color: alpha(@theme_button_foreground_normal_protonplus_breeze, 0.06);
}

headerbar .linked button {
  color: @theme_button_foreground_normal_protonplus_breeze;
  outline-color: @borders_protonplus_breeze;
  background: @theme_button_background_normal_protonplus_breeze;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.125);
}

spinbutton:not(.vertical) button,
spinbutton:not(.vertical) button:disabled {
  background: transparent;
  outline-color: transparent;
  box-shadow: none;
}

spinbutton:not(.vertical) button:hover { color: @theme_view_hover_decoration_color_protonplus_breeze; }
spinbutton:not(.vertical) button:active { background: alpha(@theme_button_decoration_hover_protonplus_breeze, 0.333); }

check,
radio {
  background-color: @theme_base_color_protonplus_breeze;
  outline: 1px solid alpha(@theme_button_foreground_normal_protonplus_breeze, 0.333);
  outline-offset: -1px;
  -gtk-icon-shadow: none;
}

check { border-radius: 3px; }
radio { border-radius: 50%; }
check:hover, radio:hover, check:focus, radio:focus { outline-color: @theme_button_decoration_hover_protonplus_breeze; }
check:checked, check:indeterminate, radio:checked, radio:indeterminate {
  outline-color: @theme_button_decoration_hover_protonplus_breeze;
  background-color: alpha(@theme_button_decoration_hover_protonplus_breeze, 0.333);
}

switch {
  outline: 1px solid alpha(@theme_button_foreground_normal_protonplus_breeze, 0.222);
  outline-offset: -1px;
  border-radius: 12px;
  background-color: alpha(@theme_button_foreground_normal_protonplus_breeze, 0.05);
  color: transparent;
}

switch:checked {
  background: alpha(@theme_button_decoration_hover_protonplus_breeze, 0.333);
  outline-color: @theme_button_decoration_hover_protonplus_breeze;
}

switch slider {
  outline: 1px solid @borders_protonplus_breeze;
  outline-offset: -1px;
  border-radius: 12px;
  background: @theme_button_background_normal_protonplus_breeze;
  box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.125);
}
