/************************************************************
1. Base & Reset
************************************************************/
*,
*::before,
*::after {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

:root {
  /* Color Variables */
  --primary: #4A8CFF;
  --primary-dark: #3B6EDB;
  --primary-light: #6BA1FF;
  --background: #0A0A0B;
  --surface: #121316;
  --text: #E9ECEF;
  --text-secondary: #ADB5BD;
  --success: #40C057;
  --success-dark: #2B9943;
  --error: #FA5252;
  --error-dark: #E03131;
}

body {
  font-family: 'Segoe UI', 'Roboto', system-ui, sans-serif;
  background: linear-gradient(to bottom right, var(--background), #131620);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  transition: all 0.4s ease;
}

/************************************************************
2. Header & Navigation
************************************************************/
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 4;
  background: rgba(30, 30, 34, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.header-title {
  font-size: 24px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(74, 140, 255, 0.3);
}

.nav-links {
  display: flex;
  gap: 24px;
  position: relative;
}

.nav-link {
  font-size: 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  padding: 6px 12px;
  border-radius: 8px;
  position: relative;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(74, 140, 255, 0.1);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(74, 140, 255, 0.15);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), transparent);
}

/************************************************************
3. Countdown Timer
************************************************************/
.countdown-timer {
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.days-count {
  background: rgba(74, 140, 255, 0.1);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: 12px;
  font-weight: 600;
  min-width: 80px;
  text-align: center;
  border: 1px solid rgba(74, 140, 255, 0.2);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.days-count:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(74, 140, 255, 0.3);
}

.countdown-tooltip {
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 12px;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 5;
  font-size: 14px;
  pointer-events: none;
  max-width: 300px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.countdown-timer:hover .countdown-tooltip,
.countdown-timer.active .countdown-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.countdown-timer.active .countdown-tooltip {
  background: rgba(255, 255, 255, 0.2);
}

/************************************************************
4. Glass Pane (Single-Person)
************************************************************/
.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0 2rem;
  box-sizing: border-box;
  position: relative;
  z-index: 2;
  transition: all 0.4s ease;
  flex-wrap: nowrap;
}

.side {
  width: 100%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-sizing: border-box;
  position: relative;
  min-height: 480px;
  z-index: 2;
  margin-bottom: 2rem;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.4s ease, box-shadow 0.4s ease, width 0.4s ease;
}

/* The main frosted glass effect is on ::before */
.side::before {
  content: '';
  position: absolute;
  z-index: -2;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.4s ease;
}

/* Greenish tinted overlay for "Working" state */
.side::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom right, #40C057, #2B9943);
  backdrop-filter: saturate(180%) blur(12px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* When .working is applied, fade in the subtle green tint (0.02) */
.side.working::after {
  opacity: 0.02;
}

/* Additional subtle green overlay on ::before when .working */
.side.working::before {
  background: linear-gradient(
    to bottom right,
    rgba(64, 192, 87, 0.15),
    rgba(64, 192, 87, 0.05)
  );
  border: 1px solid rgba(64, 192, 87, 0.2);
}

.side:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

/* Panel content fade animations */
.panel-content.fade-out {
  animation: fadeOut 0.4s forwards;
}
.panel-content.fade-in {
  animation: fadeIn 0.4s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
    visibility: visible;
  }
  to {
    opacity: 1;
    visibility: visible;
  }
}

/* Chart container */
.chart-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2rem;
  box-sizing: border-box;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: saturate(180%) blur(12px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  
}
.chart-container.visible {
  display: flex;
}
.chart-canvas {
  width: 100%;
  max-height: 80%;
}

/* Chart Info (below the chart) */
.chart-info {
  margin-top: 10px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  width: 100%;
}

/************************************************************
5. Status & Text
************************************************************/
.player h2 {
  color: var(--primary);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  font-weight: 500;
  text-align: center;
}

.status {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.status.working {
  color: var(--success);
}
.status.working::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(64, 192, 87, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(64, 192, 87, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(64, 192, 87, 0);
  }
}

.hours {
  font-size: 3rem;
  font-weight: 500;
  margin-bottom: 1rem;
  text-align: center;
  background: linear-gradient(135deg, var(--text), #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.additional-info {
  font-size: 0.9rem;
  color: #ffffff;
  font-style: italic;
  margin-top: 0.5rem;
  opacity: 0;
  visibility: hidden;
  text-align: center;
  transition: opacity 2s ease, visibility 2s ease;
}
.additional-info.visible {
  opacity: 0.7;
  visibility: visible;
}

/************************************************************
6. Evaluation Bar
************************************************************/
.evaluation-container {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  height: 30px;
  width: 50%;
  background-color: #2a2a2a;
  border-radius: 15px;
  overflow: hidden;
  display: flex;
  align-items: center;
  z-index: 2;
  transition: all 0.4s ease;
}

.evaluation-bar {
  height: 100%;
  background-color: #ffffff;
  transition: width 0.5s ease;
}

.eval-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: 500;
  font-size: 1rem;
  color: #4a8cff;
}

/************************************************************
7. Chart Toggle Button
************************************************************/
.chart-toggle-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(74, 140, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
  z-index: 10; /* above the side content */
}

.chart-toggle-button:hover {
  background: rgba(74, 140, 255, 0.3);
  transform: rotate(90deg);
}

.chart-toggle-button svg {
  fill: var(--text-secondary);
  width: 20px;
  height: 20px;
}

/************************************************************
8. Responsive
************************************************************/
@media (max-width: 768px) {
  /* 2. Modify .chart-container to remove absolute positioning and center its content */
  .chart-container {
    position: relative; /* Remove absolute positioning */
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    padding: 1rem; /* Optional: adjust padding as needed */
    max-height: 400px; /* Limit the maximum height */
    width: 100%; /* Adjust width to fit within the pane */
    display: none; /* Keep it hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Center content vertically and horizontally */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: saturate(180%) blur(12px);
    border-radius: 16px; /* Optional: adjust border radius */
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: fadeIn 0.4s forwards;
    box-sizing: border-box;
  }

  .chart-container.visible {
    display: flex; /* Make it visible when toggled */
  }
  .container {
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
  }
  .side {
    width: 98%;
    margin-bottom: 15px;
    padding: 0.1rem;
    min-height: 75vh;
    border-radius: 16px;
  }
  .evaluation-container {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    height: 30px;
    width: 80%;
    background-color: #2a2a2a;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    align-items: center;
    z-index: 2;
    transition: all 0.4s ease;
  }
  .eval-value {
    font-size: 1rem;
  }
  .header {
    padding: 10px 15px;
  }
  .header-title {
    font-size: 20px;
  }
  .nav-links {
    gap: 12px;
  }
  .nav-link {
    font-size: 13px;
    padding: 4px 6px;
  }
  .countdown-timer {
    font-size: 12px;
    margin-top: 5px;
  }
  .hours {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }
  .button-label {
    font-size: 0.9rem;
  }
  .chart-toggle-button {
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
  }
  .chart-toggle-button svg {
    width: 16px;
    height: 16px;
  }

}
