/* AI Sand Timer Styles */
/* Sidebar layout inherited from shared-sidebar-layout.css */

/* Override sidebar width - reduced by 17% from 581px */
:root {
  --sidebar-width: 482px;
}

/* Main content layout inherited from shared-sidebar-layout.css */
/* Background inherited from shared-background-gradient.css */
.main-content.timer-section {
  justify-content: center;
  align-items: center;
  overflow: hidden; /* Prevent sand timer from going outside boundaries */
  position: relative;
}

.hourglass-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  /* Base dimensions - will be scaled by JavaScript */
  transform-origin: center center;
  /* Scale will be applied via JS: transform: translate(-50%, -50%) scale(var) */
  transform: translate(-50%, -50%);
}

.glass-wrapper {
  position: relative;
  width: 462px;
  height: 462px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Don't shrink - use transform scale instead */
}

.glass-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 30px rgba(131, 46, 197, 0.3));
  transition: filter 0.3s ease;
  position: relative;
  z-index: 5;
  opacity: 0.8;
}

.top-glass {
  margin-bottom: -51px;
  z-index: 2;
}

.top-glass .glass-image {
  transform: rotate(180deg);
}

.bottom-glass {
  margin-top: -35px;
  z-index: 1;
}

.sand-container {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.top-sand {
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% - 56px));
  width: 444.5px;
  height: 320.6px;
}

.bottom-sand {
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 52.5px));
  width: 444.5px;
  height: 320.6px;
}

#top-sand-canvas,
#bottom-sand-canvas {
  width: 100%;
  height: 100%;
}

.boundary-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 444.5px;
  height: 320.6px;
  pointer-events: none;
  z-index: 10;
}

.sand-container {
  overflow: visible;
}

.sand-stream-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 121.8px));
  width: 35px;
  height: 577.5px;
  z-index: 0;
}

#sand-stream-canvas {
  width: 100%;
  height: 100%;
}

/* Sidebar content styling */
.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ========== TIMER CARD (no box styling) ========== */
.card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 20px;
  border: none;
  width: 100%;
}

.timer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  padding: 24px;
  overflow: hidden;
}

.card-title {
  font-size: clamp(23px, 2.3vw, 36px); /* 30% larger */
  font-weight: 600;
  color: #000000;
  margin-bottom: 4px;
  text-align: center;
}

.timer-arc-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  transform: scale(1.06); /* decreased by 15% */
  transform-origin: center top;
}

.timer-arc {
  width: 100%;
  height: auto;
}

.timer-arc-bg {
  fill: none;
  stroke: rgba(156, 252, 236, 0.25);
  stroke-width: 18; /* 30% larger */
  stroke-linecap: round;
  transition: stroke 0.3s ease, opacity 0.3s ease;
}

.timer-arc-progress {
  fill: none;
  stroke: url(#arcGradient);
  stroke-width: 18; /* 30% larger */
  stroke-linecap: round;
  stroke-dasharray: 251;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.5s ease;
}

.timer-display-wrapper {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

.timer-display {
  font-size: 51.2px; /* Reduced by 20% from 64px */
  font-weight: 700;
  color: #7B5FC4;
  letter-spacing: 1px;
  cursor: pointer;
  transition: color 0.2s ease;
  display: block;
}

.timer-edit-input {
  display: none;
  font-size: 51.2px; /* Reduced by 20% from 64px - matches timer-display exactly */
  font-weight: 700;
  color: #7B5FC4;
  text-align: center;
  border: none;
  background: transparent;
  font-family: inherit;
  letter-spacing: 1px; /* Match timer-display letter-spacing */
  padding: 0;
  margin: 0;
  width: auto;
  min-width: 280px; /* Increased to accommodate HH:MM:SS format */
}

.timer-edit-input.editing {
  display: block;
}

.timer-edit-input:focus {
  outline: none;
}

/* Timer theme indicator - positioned along the arc */
.timer-theme-indicator {
  position: absolute;
  font-size: clamp(18px, 2.3vw, 31px); /* 30% larger */
  z-index: 10;
  transition: left 0.5s ease, top 0.5s ease;
  transform: translate(-50%, -50%);
  /* White circle with shadow */
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(31px, 3.25vw, 49px); /* 30% larger */
  height: clamp(31px, 3.25vw, 49px); /* 30% larger */
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timer-theme-indicator .indicator-image {
  width: 70%;
  height: 70%;
  object-fit: contain;
}

.timer-controls {
  display: flex;
  gap: 10px; /* 30% larger */
  margin-top: 14px; /* moved down by 10px */
}

.timer-btn {
  width: 57px; /* 30% larger */
  height: 57px; /* 30% larger */
  border: none;
  border-radius: 50%;
  background: #f5f5f5;
  color: #666666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.timer-btn:hover {
  background: #E8D5FF;
  color: #7B5FC4;
}

.timer-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.timer-btn svg {
  width: 29px; /* 30% larger */
  height: 29px; /* 30% larger */
}



/* Timer Running Animation */
.hourglass-container.running .glass-image {
  filter: drop-shadow(0 0 40px rgba(131, 46, 197, 0.5));
}

/* Timer Complete Animation */
.hourglass-container.complete .glass-image {
  animation: completeGlow 0.6s ease-in-out 2;
}

@keyframes completeGlow {
  0%, 100% {
    filter: drop-shadow(0 0 30px rgba(131, 46, 197, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 50px rgba(255, 199, 0, 0.6));
  }
}

/* Timer Flipping Animation */
.hourglass-container.flipping {
  /* Smooth transform transitions handled by JS */
  will-change: transform;
}

.hourglass-container.flipping .glass-image {
  filter: drop-shadow(0 0 35px rgba(131, 46, 197, 0.4));
}

/* Responsive sidebar text adjustments only - timer scaling handled by JavaScript */
@media (max-width: 1024px) {
  #time-remaining {
    font-size: 2.4rem; /* 20% smaller than 3rem */
  }
}

@media (max-width: 600px) {
  .time-inputs {
    flex-direction: column;
  }
  
  .control-buttons {
    flex-wrap: wrap;
  }
  
  .control-buttons button {
    min-width: calc(50% - 6px);
  }
  
  #time-remaining {
    font-size: 2rem; /* 20% smaller than 2.5rem */
  }
}
