@tailwind base;
@tailwind components;
@tailwind utilities;

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: schnebel-sans-me, sans-serif;
  background: #fff;
  color: #000;
}

.chart-controls {
  margin: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.time-range-filter {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.time-range-btn {
  padding: 8px 16px;
  border-radius: 4px;
  background: #f8f9fa;
  color: #666;
  text-decoration: none;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
}

.time-range-btn:hover {
  background: #e9ecef;
  color: #333;
}

.time-range-btn.active {
  background: #2196F3;
  color: white;
  border-color: #2196F3;
}

.chart-container {
  position: relative;
  width: calc(100% - 2rem);
  height: 300px;
  margin: 20px;
  background: white;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.chart {
  width: 100%;
  height: 100%;
  padding: 20px 40px 50px 60px;
  box-sizing: border-box;
}

.line {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-size;
  transition: all 0.3s ease;
}

.line.limit {
  stroke: #3b82f6;
  stroke-dasharray: none;
}

.line.used {
  stroke: #10b981;
}

.y-axis {
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 50px;
  width: 60px;
  border-right: 1px solid #e0e0e0;
}

.y-label {
  position: absolute;
  right: 8px;
  transform: translateY(50%);
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

.x-axis {
  position: absolute;
  bottom: 0;
  left: 60px;
  right: 40px;
  height: 50px;
  border-top: 1px solid #e0e0e0;
}

.x-label {
  position: absolute;
  transform: translateX(-50%);
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  bottom: 20px;
}

/* For screens between 600px and 1000px */
@media (min-width: 600px) and (max-width: 1000px) {
  .container {
    padding: 2em 4px;
  }
  
  /* For longer time ranges, hide every second label */
  .x-label.long-range:nth-child(even) {
    display: none;
  }
  
  .x-axis {
    height: 50px;
  }
  
  .chart {
    padding-bottom: 50px;
  }
}

/* For screens smaller than 600px */
@media (max-width: 600px) {
  /* For 24h view only, hide every second label */
  .x-label[data-time-range="24h"]:nth-child(even) {
    display: none;
  }

  /* For longer time ranges, hide two out of three labels */
  .x-label.long-range:nth-child(3n+1),
  .x-label.long-range:nth-child(3n+2) {
    display: none;
  }
  
  .x-axis {
    height: 50px;
  }
  
  .chart {
    padding-bottom: 50px;
  }

  /* Smooth SVG lines on mobile */
  .chart path.line {
    vector-effect: non-scaling-stroke;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 3;
  }
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2em 0;
}

.content {
  max-width: 62.5em;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 2.5em;
}

.illustration {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  aspect-ratio: attr(width) / attr(height);
  display: block;

}

.headline {
  font-size: 1.25em;
  line-height: 1.2em;
  font-weight: bold;
}

.big-number {
  font-size: 4em;
  font-weight: bold;
  margin-bottom: -0.5rem;
}

.mid-number {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: -0.25rem;
}

.subtext {
  font-size: 1.125em;
  margin-bottom: 1em;
}

.info-text {
  font-size: 1.125em;
  max-width: 25em;
  margin: 0 auto;
}

.chart-stats {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 1rem;
  margin: 1rem 20px 0;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 4px;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: #6c757d;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 500;
  color: #212529;
}

@media (min-width: 800px) {

  html,
  body {
    height: 100%;
  }

  .content {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 3em;
    padding: 0 2.5em;
  }

  .illustration,
  .text-block {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .text-block {
    margin-top: 0;
  }

  .info-text {
    max-width: 100%;
    margin: 0 auto;
  }

  @media (min-width: 1440px) and (min-height: 760px) {
    html {
      font-size: 19px;
    }

    .content {
      max-width: 75em;
      gap: 4em;
      padding: 0 3em;
    }

    .illustration,
    .text-block {
      flex: 0 0 50%;
      max-width: 50%;
    }

    .headline {
      font-size: 1.5em;
      margin-bottom: 1em;
    }

    .big-number {
      font-size: 6em;
    }

    .mid-number {
      font-size: 3em;
    }

    .subtext,
    .info-text {
      font-size: 1.125em;
    }

    .illustration {
      margin-bottom: 2.5em;
    }

    .info-text {
      padding-top: 2em;
    }
  }
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin: 1rem 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-color {
  width: 20px;
  height: 3px;
}

.legend-color.used {
  background-color: #10b981;
}

.legend-color.limit {
  background-color: #3b82f6;
}

.legend-label {
  font-size: 0.875rem;
  color: #666;
}

.stats-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  border-left: 1px solid #e0e0e0;
  padding-left: 1.5rem;
}

.stats-row {
  display: flex;
  gap: 2rem;
}

.stats-heading {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.5rem;
}

@media (max-width: 600px) {
  .chart-stats {
    text-align: left;
  }

  .stats-row {
    width: 100%;
    flex-direction: column;
    align-items: start;
    padding-left: 0;
    gap: 0.5rem;
  }

  .stat-item {
    gap: 0;
    align-items: start;
  }
}
