/* Overlay Container - Always on top */
#zoofocus-overlay {
  position: fixed;
  z-index: 2147483647;
  pointer-events: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Widget - Expanded State */
#zoofocus-widget {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 280px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  overflow: hidden;
  transition: all 0.3s ease;
}

#zoofocus-widget.zoofocus-hidden {
  display: none;
}

/* Drag Handle */
.zoofocus-handle {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: linear-gradient(135deg, #8B6F47, #D4A574);
  color: white;
  cursor: move;
  user-select: none;
}

.zoofocus-logo {
  width: 24px;
  height: 24px;
  margin-right: 8px;
  border-radius: 4px;
}

.zoofocus-handle span {
  flex: 1;
  font-weight: 600;
  font-size: 14px;
}

.zoofocus-minimize,
.zoofocus-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  margin-left: 4px;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.zoofocus-minimize:hover,
.zoofocus-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Session Label */
.zoofocus-session-label {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #8B6F47;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 0 4px;
}

/* Timer Display */
.zoofocus-timer {
  font-size: 36px;
  font-weight: bold;
  text-align: center;
  padding: 4px 12px;
  font-family: 'Courier New', monospace;
  color: #333;
}

/* Bear Animation */
.zoofocus-animation {
  width: 180px;
  height: 180px;
  margin: 8px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 12px;
}

#zoofocus-bear {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#zoofocus-bear.working {
  animation: workingPulse 1.5s ease-in-out infinite;
}

@keyframes workingPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Progress Bar */
.zoofocus-progress-container {
  width: 90%;
  height: 6px;
  background: rgba(139, 111, 71, 0.2);
  border-radius: 3px;
  margin: 8px auto;
  overflow: hidden;
}

.zoofocus-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 3px;
  transition: width 1s linear;
  width: 0%;
  box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

.zoofocus-progress-bar.milestone-hit {
  animation: milestoneGlow 0.5s ease-in-out;
}

@keyframes milestoneGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(76, 175, 80, 0.5); }
  50% { box-shadow: 0 0 20px rgba(76, 175, 80, 1); }
}

/* Controls */
.zoofocus-controls {
  display: flex;
  gap: 6px;
  padding: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.zoofocus-controls button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.zoofocus-btn-start {
  background: #4CAF50;
  color: white;
}

.zoofocus-btn-pause {
  background: #FF9800;
  color: white;
}

.zoofocus-btn-pause:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.zoofocus-btn-reset {
  background: #757575;
  color: white;
}

.zoofocus-btn-skip {
  background: #F44336;
  color: white;
}

.zoofocus-controls button:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Level Display */
.zoofocus-level {
  text-align: center;
  padding: 4px 12px 12px;
  font-size: 11px;
  color: #666;
}

.zoofocus-level-number {
  font-weight: 700;
  color: #8B6F47;
  margin-bottom: 2px;
  font-size: 12px;
}

.zoofocus-sessions {
  font-size: 10px;
  color: #999;
}

.zoofocus-level-progress {
  width: 90%;
  height: 4px;
  background: rgba(139, 111, 71, 0.2);
  border-radius: 2px;
  margin: 6px auto 0;
  overflow: hidden;
}

.zoofocus-level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8B6F47, #D4A574);
  border-radius: 2px;
  transition: width 0.5s ease;
  width: 0%;
}

/* Minimized State */
#zoofocus-widget-mini {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(139, 111, 71, 0.95);
  border-radius: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.3s;
}

#zoofocus-widget-mini.zoofocus-hidden {
  display: none;
}

#zoofocus-widget-mini:hover {
  transform: scale(1.05);
  background: rgba(139, 111, 71, 1);
}

.zoofocus-mini-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.zoofocus-mini-timer {
  font-family: 'Courier New', monospace;
  font-weight: bold;
  color: white;
  font-size: 16px;
}

.zoofocus-expand {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.zoofocus-expand:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Toast Notifications */
.zoofocus-toast {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s ease;
  z-index: 2147483647;
  pointer-events: none;
  max-width: 250px;
}

.zoofocus-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Subtle Celebration Overlay - Bottom Right */
.zoofocus-celebration-overlay {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2147483646;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.zoofocus-celebration-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.zoofocus-celebration-content {
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid #D4A574;
  padding: 20px 30px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(139, 111, 71, 0.3);
  animation: celebrationSlideIn 0.3s ease-out;
}

.zoofocus-celebration-bear {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 12px;
}

.zoofocus-celebration-text {
  font-size: 20px;
  font-weight: 700;
  color: #8B6F47;
  margin-bottom: 8px;
}

.zoofocus-celebration-message {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

@keyframes celebrationSlideIn {
  0% {
    transform: translateX(100px);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}


/* Subtle Confetti Effect */
.zoofocus-confetti {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #FFD700;
  opacity: 0.6;
  animation: confettiFall 2s linear;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-50px) rotate(0deg);
    opacity: 0.6;
  }
  100% {
    transform: translateY(200px) rotate(360deg);
    opacity: 0;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .zoofocus-celebration-overlay {
    bottom: 10px;
    right: 10px;
  }
  
  .zoofocus-celebration-bear {
    width: 100px;
    height: 100px;
  }
  
  .zoofocus-celebration-text {
    font-size: 18px;
  }
  
  .zoofocus-celebration-message {
    font-size: 12px;
  }
  
  .zoofocus-celebration-content {
    padding: 15px 20px;
  }
}

/* Pulsing timer effect */
.zoofocus-timer.pulsing {
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
