/* --------------------------------------------------------------------------
   IMPORTS & GLOBAL STYLES
   -------------------------------------------------------------------------- */
@import "colors.css";

/* --------------------------------------------------------------------------
   BASE CONTAINER
   -------------------------------------------------------------------------- */
window#waybar {
  /* Layout & Box Model */
  /* border: 1px solid @border-color; */
  /* border-bottom: none; */
  /* border-radius: 10px 10px 0 0; */
  
  /* Typography */
  font-family: "Iosevka Nerd Font Propo";
  font-size: 15px;
  
  /* Colors */
  background-color: transparent;
  /* color: @text-primary; */
  
  /* Effects & Transitions */
  /* transition-property: background-color; */
  /* transition-duration: 0.5s; */
}

/* Window States */
window#waybar.hidden {
  opacity: 0.2;
}

window#waybar.termite {
  background-color: #3F3F3F;
}

window#waybar.chromium {
  background-color: #000000;
  border: none;
}

/* --------------------------------------------------------------------------
   MODULE COMMON STYLES
   -------------------------------------------------------------------------- */
/* Common styling applied to all modules */
#mpd,
#custom-pomodoro,
#clock,
#battery,
#network,
#pulseaudio,
#pulseaudio-slider,
#custom-separator,
#custom-launcher,
#tray,
#taskbar,
#cpu,
#memory,
#temperature,
#scratchpad {
  padding: 0 10px;
  color: @text-primary;
  transition: color 0.3s ease, text-shadow 0.3s ease, background 0.3s ease, padding 0.3s ease;
}

/* --------------------------------------------------------------------------
   WORKSPACES
   -------------------------------------------------------------------------- */
#workspaces {
  font-size: 18px;
  background-color: transparent;
}

#workspaces button {
  padding: 0 6px;
  min-width: 20px;
  background-color: transparent;
  color: alpha(@accent, 0.5);
  border: none;
  border-radius: 0;
}

/* Workspace States */
#workspaces button.empty {
  color: @text-secondary;
}

#workspaces button.active.hosting-monitor {
  color: @accent;
  text-shadow: 0px 0px 8px @accent;
  animation: hover 0.8s 1;
}

#workspaces button.urgent {
  color: @attention;
  font-weight: 700;
  text-shadow: 0px 0px 8px @attention;
  transition: color 0.5s, box-shadow 0.5s, background 0.5s;
}

#workspaces button:hover {
  color: @foreground;
  background-color: transparent;
  text-shadow: 0px 0px 2px rgba(233, 99, 117, 1);
}

/* --------------------------------------------------------------------------
   TASKBAR
   -------------------------------------------------------------------------- */
#taskbar {
    padding-right: 0;
}

#taskbar button {
    padding: 0 5px;
    min-height: 20px;
    min-width: 20px;
}

#taskbar image {
    min-width: 20px;
    min-height: 20px;
}

#taskbar.empty {
    padding: 0;
}

/* --------------------------------------------------------------------------
   BATTERY
   -------------------------------------------------------------------------- */
#battery {
    padding-right: 0;
}

/* --------------------------------------------------------------------------
   CPU
   -------------------------------------------------------------------------- */
#cpu {
    font-size: 20px;
}

/* --------------------------------------------------------------------------
   MEMORY
   -------------------------------------------------------------------------- */
#memory {
    font-size: 20px;
    padding: 0;
}

/* --------------------------------------------------------------------------
   TEMPERATURE
   -------------------------------------------------------------------------- */
#temperature {
    font-size: 20px;
}

/* --------------------------------------------------------------------------
   SIDE PANEL GROUPS
   -------------------------------------------------------------------------- */
.modules-left, .modules-right {
  /* Layout & Box Model */
  border: 1px solid @border-color;
  border-radius: 15px;
   
  /* Colors */
  background-color: @bg-panel;
  /* color: @text-primary; */
  
  /* Effects & Transitions */
  /* transition-property: background-color; */
  /* transition-duration: 0.5s; */
}

.modules-center {
    background: 
        /* Top border gradient */
        linear-gradient(to right, 
            transparent 0%,
            @border-color 25%,
            @border-color 75%,
            transparent 100%
        ) 0 0 / 100% 1px no-repeat,
        
        /* Bottom border gradient */
        linear-gradient(to right, 
            transparent 0%,
            @border-color 25%,
            @border-color 75%,
            transparent 100%
        ) 0 100% / 100% 1px no-repeat,
        
        /* Main background */
        linear-gradient(to right, 
            alpha(#000000, 0) 0%, 
            alpha(@bg-panel, 1) 25%, 
            alpha(@bg-panel, 1) 75%, 
            alpha(#000000, 0) 100%
        );
    padding: 0 20px;
}

.modules-left {
}

.modules-right {
}

/* --------------------------------------------------------------------------
   AUDIO CONTROL MODULES
   -------------------------------------------------------------------------- */
#pulseaudio {
  padding-right: 0;
  border-right: none;
}

#pulseaudio-slider slider {
  min-height: 0px;
  min-width: 0px;
  opacity: 0;
  background-image: none;
  border: none;
  box-shadow: none;
}

#pulseaudio-slider trough {
  min-height: 10px;
  min-width: 25px;
  border-radius: 5px;
  background: alpha(@text-primary, 0.2);
}

#pulseaudio-slider highlight {
  min-width: 10px;
  border-radius: 5px;
  background: @text-primary;
}

/* --------------------------------------------------------------------------
   CUSTOM MODULES
   -------------------------------------------------------------------------- */
#custom-pomodoro {
  color: @text-secondary;
  border-radius: 0 0 10px 10px;
}

#custom-launcher {
    font-size: 23px;
}

/* --------------------------------------------------------------------------
   STATE-BASED STYLES
   -------------------------------------------------------------------------- */

/* TASKBAR STATES */
#taskbar button {
    transition: none;
}

#taskbar button.active {
    background: radial-gradient(circle, alpha(@text-primary, 1) 0%, alpha(@text-primary, 1) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0) 100%);
    transition: color 0.3s, box-shadow 0.3s, background 0.3s;
}

#taskbar button.active image {
    min-width: 24px;
    min-height: 24px;
    /* padding: 0 5px; */
}

/* POMODORO STATES */
#custom-pomodoro.work {
  color: @accent;
}

#custom-pomodoro.break {
  color: @success;
  text-shadow: 0px 0px 4px rgba(0, 255, 0, 1);
}

#custom-pomodoro.pause {
  color: @attention;
  text-shadow: 0px 0px 4px @attention;
}

/* MPD STATES */
#mpd {
  font-weight: 700;
  transition: color 2s, background 2s, border-color 2s;
}

#mpd.playing {
  color: @accent;
}

#mpd.stopped {
  color: transparent;
  background: transparent;
  border-color: transparent;
}

#mpd.paused {
  font-weight: normal;
  color: @text-secondary;
}

/* CPU && MEMORY STATES */
#cpu.s1, #memory.s1, #temperature.s1 {
  color: @text-primary;
  transition: color 0.3s, text-shadow 0.3s, background 0.3s;
}

#cpu.s2, #memory.s2 {
  color: @text-primary;
  text-shadow: 0px 0px 2px @text-primary;
  transition: color 0.3s, text-shadow 0.3s, background 0.3s;
}

#cpu.s3, #memory.s3 {
  color: @attention;
  text-shadow: 0px 0px 2px @attention;
  transition: color 0.3s, text-shadow 0.3s, background 0.3s;
}

#cpu.s4, #memory.s4, #temperature.warning {
  color: @warning;
  text-shadow: 0px 0px 2px @warning;
  transition: color 0.3s, text-shadow 0.3s, background 0.3s;
}

#cpu.s5, #memory.s5, #temperature.critical {
  color: @danger;
  text-shadow: 0px 0px 2px @danger;
  transition: color 0.3s, text-shadow 0.3s, background 0.3s;
}

/* --------------------------------------------------------------------------
   HOVER EFFECTS
   -------------------------------------------------------------------------- */
#mpd.playing:hover,
#mpd.paused:hover,
#clock:hover,
#battery:hover,
#network:hover,
#pulseaudio:hover,
#custom-pomodoro:hover,
#custom-launcher:hover,
#scratchpad:hover,
#tray:hover,
#taskbar:hover,
#cpu:hover,
#memory:hover
#temperature:hover {
  color: @accent;
  text-shadow: 0px 0px 8px @accent;
  transition: color 0.3s, box-shadow 0.3s, background 0.3s;
}

#pulseaudio-slider:hover highlight {
  background: @accent;
  box-shadow: 0px 0px 8px @accent;
  transition: color 0.3s, box-shadow 0.3s, background 0.3s;
}

/* --------------------------------------------------------------------------
   LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
#window,
#workspaces {
  margin: 0 0px;
}

.modules-left > widget:first-child > #workspaces {
  margin-left: 0;
}

.modules-right > widget:last-child > #workspaces {
  margin-right: 0;
}

/* --------------------------------------------------------------------------
   ANIMATIONS
   -------------------------------------------------------------------------- */
@keyframes hover {
    0% { color: @text-primary; }
    100% { color: @accent; }
}
