/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */
 @import "/css/bulma.min.css";
 @import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@100..900&display=swap');

:root {
  /* Light theme (default) */
  --bulma-scheme-h: 220;  /* Blue hue */
  --bulma-scheme-s: 70%;  /* Saturation */
  --bulma-scheme-main-l: 98%;  /* Very light background */
  --bulma-scheme-main-bis-l: 96%;  /* Slightly darker for secondary elements */
  --bulma-scheme-main-ter-l: 94%;  /* Tertiary background */
  --bulma-background-l: 100%;  /* Background elements */
  --bulma-border-weak-l: 85%;  /* Weak borders */
  --bulma-border-l: 80%;  /* Standard borders */
  --bulma-text-weak-l: 30%;  /* Weak text */
  --bulma-text-l: 15%;  /* Standard text */
  --bulma-text-strong-l: 5%;  /* Strong text */
  
  /* Ensure light mode is active by default */
  --bulma-scheme-brightness: light;
  
  /* Box and component backgrounds */
  --bulma-box-background-color: hsl(var(--bulma-scheme-h), var(--bulma-scheme-s), 100%);
  --bulma-card-background-color: hsl(var(--bulma-scheme-h), var(--bulma-scheme-s), 100%);

  /* Sidebar specific */
  --sidebar-background: hsla(var(--bulma-scheme-h), var(--bulma-scheme-s), 96%, 0.9);

  --color-primary: hsl(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l));
  --color-text-weak: var(--bulma-text-weak);
  --color-success: #48c774;
  --color-warning: #ffdd57;
  --color-danger: #f14668;
  --color-unknown: #eeeeee;
  
  /* Grade colors */
  --color-grade-unknown: rgb(240,240,240);
  --color-grade-a: rgb(160,230,200);
  --color-grade-b: rgb(140,220,120);
  --color-grade-c: rgb(150,210,90);
  --color-grade-d: rgb(230,230,90);
  --color-grade-e: rgb(240,180,70);
  --color-grade-f: rgb(240,80,60);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Deep blue theme colors */
    --bulma-scheme-h: 220;  /* Blue hue */
    --bulma-scheme-s: 70%;  /* Saturation */
    --bulma-scheme-main-l: 5%;  /* Very dark blue for main background */
    --bulma-scheme-main-bis-l: 7%;  /* Slightly lighter for secondary elements */
    --bulma-scheme-main-ter-l: 9%;  /* Tertiary background */
    --bulma-background-l: 10%;  /* Background elements */
    --bulma-border-weak-l: 15%;  /* Weak borders */
    --bulma-border-l: 20%;  /* Standard borders */
    --bulma-text-weak-l: 70%;  /* Weak text */
    --bulma-text-l: 85%;  /* Standard text */
    --bulma-text-strong-l: 95%;  /* Strong text */
    
    /* Ensure dark mode is active */
    --bulma-scheme-brightness: dark;
    
    /* Box and component backgrounds */
    --bulma-box-background-color: hsl(var(--bulma-scheme-h), var(--bulma-scheme-s), 7%);
    --bulma-card-background-color: hsl(var(--bulma-scheme-h), var(--bulma-scheme-s), 7%);

  /* Sidebar specific */
  --sidebar-background: hsla(var(--bulma-scheme-h), var(--bulma-scheme-s), 4%, 0.9);
  }
}

html, body {
  font-family: 'Exo 2', sans-serif;
  scroll-behavior: smooth;
  min-height: 100vh;
  background-color: hsl(var(--bulma-scheme-h), var(--bulma-scheme-s), var(--bulma-scheme-main-l));
}

.breadcrumb.has-pipe-separator li+li::before {
  content: "|";
}

.is-on-top {
  z-index: 9000;
}

.is-admin {
  background-color: oklch(42.4% 0.199 265.638);
  color: white;
}

.is-guest {
  background-color: oklch(54.6% 0.245 262.881);
  color: white;
}



/*** Success Notification */

.notification-container, .alert-container, .error-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 1000;
  
  .notification {
    margin-bottom: 0;
    min-width: 300px;
    max-width: 600px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    
    .delete {
      margin-top: -0.5rem;
      margin-right: -0.5rem;
      flex-shrink: 0;
      padding-bottom: 0.2rem;
    }
  }
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/*** Simple tooltips */

.tooltip-trigger {
  display: inline-block;
  font-size: 0.8em;
  color: #666;
  cursor: help;
  margin-left: 2px;
  opacity: 0.7;
}

.tooltip-trigger:hover {
  opacity: 1;
}

/*** Sidebar */

.sidebar {
  background-color: var(--sidebar-background);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  width: 250px;
  padding: 20px;
  box-shadow: 2px 0 5px rgba(0,0,0,0.1);
  transition: transform 0.3s ease-in-out;
  z-index: 1000;
  transform: translateX(0);
  will-change: transform;
  backface-visibility: hidden;
}

.sidebar.is-collapsed {
  transform: translateX(-250px);
}

.sidebar-menu {
  margin-top: 20px;
}

.sidebar-item {
  padding: 10px 15px;
  margin: 5px 0;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.sidebar-item:hover {
  background-color: #e8e8e8;
  color: rgb(0, 31, 26);
}

.sidebar-item.is-active {
  background-color: hsl(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l)) !important;
  color: rgb(0, 31, 26);
}

.main-content {
  margin-left: 250px;
  padding: 20px;
  transition: margin-left 0.3s ease-in-out;
}

.main-content.is-expanded {
  margin-left: 0;
}

.sidebar-logo {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid #dbdbdb;
}

.hamburger-button {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  display: none;
  background: hsl(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l));
  border: none;
  color: white;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

@media screen and (max-width: 768px) {
  .sidebar {
      transform: translateX(-250px);
  }

  .sidebar[x-cloak] {
      display: none;
  }

  .sidebar.is-active {
      transform: translateX(0);
  }

  .main-content {
      margin-left: 0;
      padding-top: 70px;
  }

  .hamburger-button {
      display: block;
  }

  .overlay.is-active {
      display: block;
  }
}

/*** Web Monitors */

#web_monitors .item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.3rem 0;
  text-decoration: none;
  color: inherit;
}

#web_monitors .item .item-title {
  flex-grow: 2;
  min-width: 100px;
  text-overflow: ellipsis;
  overflow: hidden;
}

#web_monitors .item .item-title .uptime-info {
  font-size: 0.7rem;
  color: var(--bulma-text-weak);
}

#web_monitors .item .hourly-status-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  flex-grow: 1;
}

#web_monitors .item .hourly-status-container .uptime-info {
  padding-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--bulma-text-weak);
}

#web_monitors .item:hover {
  background-color: hsla(var(--bulma-primary-h), var(--bulma-primary-s), var(--bulma-primary-l), 0.2);
}
  
#web_monitors .item:not(:last-child) {
  border-bottom: 0.5px solid var(--bulma-text-weak);
}

#web_monitors .vibrate {
  border-radius: 50%;
  transform: scale(1);
  box-shadow: 0 0 0 black;
  animation: anim-vibrate 3s infinite;
  will-change: transform;
}
@keyframes anim-vibrate {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 0.6rem rgba(0, 0, 0, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

#web_monitors .hourly-status {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  align-items: center;
}

#web_monitors .status-bar {
  width: 4px;
  height: 12px;
  border-radius: 1px;
  margin-top: 4px;
  transition: all 0.2s ease-in-out;
  transform-origin: center;
  position: relative;
}

#web_monitors .status-bar:hover {
  height: 16px;
  margin-top: 0;
  transform: translateY(-4px);
}

#web_monitors .status-bar.unknown {
  background-color: var(--color-unknown);
}

#web_monitors .status-bar.up {
  background-color: var(--color-success);
}

#web_monitors .status-bar.down {
  background-color: var(--color-danger);
}

#web_monitors .status-bar.unknown:hover, .status-bar.up:hover, .status-bar.down:hover {
  opacity: 0.5;
}

.uptime-tooltip {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
}

.uptime-tooltip .info {
  padding-top: 0.2rem;
  font-size: 0.8rem;
}

/*** Uptime Informations in web monitor details */

#uptime-informations {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  gap: 5px;
}

@media screen and (max-width: 1024px) {
  #uptime-informations {
    flex-direction: column;
  }
}

/*** Performance Monitor */

.daily-performance-container {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
  flex-grow: 1;
  justify-content: end;
}

.daily-performance {
  display: flex;
  align-items: flex-end;
  height: 16px;
  gap: 2px;
}

.daily-performance-title {
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 0.2rem;
  color: var(--bulma-text-weak);
}

.performance-bar-container {
  width: 6px;
  height: 100%;
  background-color: #eee;
  position: relative;
}

.performance-bar {
  position: absolute;
  bottom: 0;
  width: 100%;
  background-color: #4CAF50;
  transition: height 0.3s ease;
}

.performance-tooltip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.performance-tooltip .info {
  padding-top: 0.1rem;
  font-size: 0.8rem;
}

.average-performance {
  text-align: center;
  font-size: 0.7rem;
  color: var(--bulma-text-weak);
}


.score-container {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-score {
  display: flex;
  justify-content: center;
  align-items: center;
}

.value-large {
  font-size: 36px;
  font-weight: bold;
}

.sub-scores {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.label {
  font-size: 14px;
  color: #666;
  margin-bottom: 5px;
}

.value-small {
  font-size: 18px;
  font-weight: bold;
}

.box.scores {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  gap: 5px;
}

.category-performance {
  --bulma-tag-h: 209;
  --bulma-tag-s: 100%;
  --bulma-tag-background-l: 20%;
  --bulma-tag-color-l: 100%;
}

.category-accessibility {
  --bulma-tag-h: 209;
  --bulma-tag-s: 100%;
  --bulma-tag-background-l: 35%;
  --bulma-tag-color-l: 100%;
}

.category-best-practices {
  --bulma-tag-h: 209;
  --bulma-tag-s: 100%;
  --bulma-tag-background-l: 50%;
  --bulma-tag-color-l: 100%;
}

.category-seo {
  --bulma-tag-h: 209;
  --bulma-tag-s: 100%;
  --bulma-tag-background-l: 65%;
  --bulma-tag-color-l: 100%;
}

@media screen and (max-width: 768px) {
  .box.scores {
    flex-direction: column;
    justify-content: center;
  }
}


/*** Carbon */

.has-text-grade-unknown {
  color: var(--color-grade-unknown);
}

.has-text-grade-a {
  color: var(--color-grade-a);
}

.has-text-grade-b {
  color: var(--color-grade-b);
} 

.has-text-grade-c {
  color: var(--color-grade-c);
}

.has-text-grade-d {
  color: var(--color-grade-d);
} 

.has-text-grade-e {
  color: var(--color-grade-e);
} 

.has-text-grade-f {
  color: var(--color-grade-f);
} 

.has-background-grade-unknown {
  background-color: var(--color-grade-unknown);
  font-weight: bold;
  color: black;
}

.has-background-grade-a {
  background-color: var(--color-grade-a);
  font-weight: bold;
  color: black;
}

.has-background-grade-b {
  background-color: var(--color-grade-b);
  font-weight: bold;
  color: black;
}

.has-background-grade-c {
  background-color: var(--color-grade-c);
  font-weight: bold;
  color: black;
}

.has-background-grade-d {
  background-color: var(--color-grade-d);
  font-weight: bold;
  color: black;
}

.has-background-grade-e {
  background-color: var(--color-grade-e);
  font-weight: bold;
  color: black;
}

.has-background-grade-f {
  background-color: var(--color-grade-f);
  font-weight: bold;
  color: white;
}

.daily-co2-container {
  display: flex;
  flex-direction: row;
  gap: 8px;
  flex-wrap: wrap;
  flex-grow: 1;
  justify-content: end;
  margin-right: 0.5rem;
}

.daily-co2-informations {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.daily-co2 {
  display: flex;
  align-items: flex-end;
  height: 16px;
  gap: 2px;
}

.daily-co2-title {
  font-size: 0.8rem;
  text-align: center;
  margin-bottom: 0.2rem;
  color: var(--bulma-text-weak);
}

.co2-bar-container {
  width: 6px;
  height: 100%;
  background-color: #eee;
  position: relative;
}

.co2-bar {
  position: absolute;
  bottom: 0;
  width: 100%;
  transition: height 0.3s ease;
}

.co2-tooltip {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.co2-tooltip .info {
  padding-top: 0.1rem;
  font-size: 0.8rem;
}

.average-co2 {
  text-align: center;
  font-size: 0.7rem;
  color: var(--bulma-text-weak);
}


/* Add print styles */
@media print {
  .sidebar, .hamburger-button, .overlay {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
  }
}

/* Slider styles */
.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e4e4e7;
  outline: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.slider.is-fullwidth {
  display: block;
  width: 100%;
}

.slider-labels {
  position: relative;
  width: 100%;
  height: 20px;
  margin-top: 8px;
}

.slider-labels span {
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bulma-link);
  border: none;
  cursor: pointer;
  margin-top: -4px; /* Vertical centering for webkit */
  box-shadow: 0 2px 4px hsla(var(--bulma-input-h), var(--bulma-input-s), calc(var(--bulma-input-border-l) + var(--bulma-input-border-l-delta)), 0.3);
}

.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bulma-link);
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px hsla(var(--bulma-input-h), var(--bulma-input-s), calc(var(--bulma-input-border-l) + var(--bulma-input-border-l-delta)), 0.3);
}

.slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  background: linear-gradient(
    to right,
    hsl(var(--bulma-input-h), var(--bulma-input-s), calc(var(--bulma-input-border-l) + var(--bulma-input-border-l-delta))) 0%,
    hsl(var(--bulma-input-h), var(--bulma-input-s), calc(var(--bulma-input-border-l) + var(--bulma-input-border-l-delta))) var(--value, 50%),
    #a4a4a7 var(--value, 50%),
    #a4a4a7 100%
  );
  border-radius: 4px;
}

.slider::-moz-range-track {
  width: 100%;
  height: 8px;
  background: linear-gradient(
    to right,
    hsl(var(--bulma-input-h), var(--bulma-input-s), calc(var(--bulma-input-border-l) + var(--bulma-input-border-l-delta))) 0%,
    hsl(var(--bulma-input-h), var(--bulma-input-s), var(--bulma-input-l)) var(--value, 50%),
    #a4a4a7 var(--value, 50%),
    #a4a4a7 100%
  );
  border-radius: 4px;
}

.slider.is-danger::-webkit-slider-thumb {
  background: var(--color-danger);
  box-shadow: 0 2px 4px rgba(241, 70, 104, 0.3);
}

.slider.is-danger::-moz-range-thumb {
  background: var(--color-danger);
  box-shadow: 0 2px 4px rgba(241, 70, 104, 0.3);
}

.slider.is-danger::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    var(--color-danger) 0%,
    var(--color-danger) var(--value, 50%),
    #a4a4a7 var(--value, 50%),
    #a4a4a7 100%
  );
}

.slider.is-danger::-moz-range-track {
  background: linear-gradient(
    to right,
    var(--color-danger) 0%,
    var(--color-danger) var(--value, 50%),
    #a4a4a7 var(--value, 50%),
    #a4a4a7 100%
  );
}

