/*
 * 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.
 */

/* Custom color temperature slider styling */
#temperature-slider {
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, #f97316, #fde047, #60a5fa);
  border-radius: 0.5rem;
  outline: none;
}

#temperature-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2px solid #d1d5db;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#temperature-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2px solid #d1d5db;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Brightness slider styling */
#brightness-slider,
#overhead-brightness-slider {
  -webkit-appearance: none;
  appearance: none;
  background: #e5e7eb;
  border-radius: 0.5rem;
  outline: none;
}

#brightness-slider::-webkit-slider-thumb,
#overhead-brightness-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2px solid #d1d5db;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#brightness-slider::-moz-range-thumb,
#overhead-brightness-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 2px solid #d1d5db;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Heat Index Gradient Slider */
.heat-index-slider {
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(to right, 
    #86efac, /* Safe - green (below 80°F) */
    #fef3c7, /* Caution - light yellow */
    #fde047, /* Extreme Caution - yellow */
    #fb923c, /* Danger - orange */
    #ef4444  /* Extreme Danger - red */
  );
  border-radius: 0.5rem;
  outline: none;
  height: 12px;
}

.heat-index-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--thumb-border-color, #374151);
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.heat-index-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--thumb-border-color, #374151);
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Heat Index Risk Level Labels */
.heat-index-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
}

.heat-index-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.heat-index-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #d1d5db;
}

.heat-index-label.caution .heat-index-color-dot {
  background-color: #fef3c7;
}

.heat-index-label.extreme-caution .heat-index-color-dot {
  background-color: #fde047;
}

.heat-index-label.danger .heat-index-color-dot {
  background-color: #fb923c;
}

.heat-index-label.safe .heat-index-color-dot {
  background-color: #86efac;
}

.heat-index-label.extreme-danger .heat-index-color-dot {
  background-color: #ef4444;
}

/* Color picker styling */
#color-picker {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  height: 48px;
}

#color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 0.5rem;
}

#color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 0.5rem;
}

#color-picker::-moz-color-swatch {
  border: none;
  border-radius: 0.5rem;
}

/* Toggle switch styling */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 64px;
  height: 34px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  color: white;
  text-transform: uppercase;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.toggle-slider:after {
  content: "OFF";
  position: absolute;
  right: 8px;
  z-index: 1;
  transition: 0.4s;
}

input:checked + .toggle-slider {
  background-color: #3b82f6;
}

input:checked + .toggle-slider:before {
  transform: translateX(30px);
}

input:checked + .toggle-slider:after {
  content: "ON";
  left: 8px;
  right: auto;
}

.toggle-switch:disabled .toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-switch:disabled input:checked + .toggle-slider {
  background-color: #9ca3af;
}

/* Contribution Graph Styling */
.contribution-graph {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  width: 100%;
  overflow-x: auto;
  transform-origin: top left;
}

.contribution-graph-grid {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.contribution-graph-labels {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-right: 8px;
  padding-top: 0; /* Remove the extra padding that was causing misalignment */
}

.contribution-graph-label {
  font-size: 12px;
  color: #656d76;
  height: 15px;
  line-height: 15px;
  text-align: right;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: flex-end;

  &:nth-child(2n) {
    opacity: 0;
  }
}

.contribution-graph-squares {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  width: 100%;
}

.contribution-graph-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.contribution-graph-square {
  width: 15px;
  height: 15px;
  border-radius: 2px;
  border: 1px solid rgba(27, 31, 36, 0.04);
  cursor: pointer;
  transition: border-color 0.1s ease;
  flex: 1;
  aspect-ratio: 1;
}



.contribution-graph-square:hover {
  border-color: rgba(27, 31, 36, 0.3);
}

.contribution-graph-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 12px;
  color: #656d76;
}

.contribution-graph-legend-squares {
  display: flex;
  gap: 2px;
}

.contribution-graph-legend-square {
  width: 15px;
  height: 15px;
  border-radius: 2px;
  border: 1px solid rgba(27, 31, 36, 0.04);
  aspect-ratio: 1;
}



/* Month labels for the main contribution graph */
.contribution-graph-months {
  display: flex;
  margin-bottom: 8px;
  font-size: 12px;
  color: #656d76;
  margin-left: 38px; /* Align with the squares grid */
}

.contribution-graph-month {
  text-align: center;
  flex-shrink: 0; /* Prevent squishing */

  &:first-child {
    opacity: 0;
  }
}

/* Small Contribution Graph Styling for Dashboard Card */
.small-contribution-graph {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  font-size: 10px;
  width: 100%;
}

.small-contribution-graph-grid {
  display: flex;
  align-items: flex-start;
  gap: 2px;
}


.small-contribution-graph-squares {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  width: 100%;
}

.small-contribution-graph-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.small-contribution-graph-square {
  width: 90%;
  aspect-ratio: 10 / 14;
  border-radius:  50% 50% 45% 45% / 60% 60% 40% 40%;
  border: 1px solid rgba(27, 31, 36, 0.04);
  cursor: pointer;
  transition: border-color 0.1s ease;
  flex: 1;
}

.small-contribution-graph-square:hover {
  border-color: rgba(27, 31, 36, 0.3);
}
