/*
  Breathing Mode Widget Stylesheet
  ===============================
  This stylesheet is isolated using the "br-" prefix to avoid conflict with your website styles.
*/

:root {
  --br-bg-color: #000000;
  --br-text-primary: rgba(255, 255, 255, 0.9);
  --br-text-secondary: rgba(255, 255, 255, 0.5);
  --br-text-muted: rgba(255, 255, 255, 0.3);
  --br-accent-box: #ffffff;
  --br-accent-478-inhale: #ffffff;
  --br-accent-478-hold: #f26700;
  --br-accent-478-exhale: #5cbdf5;
  --br-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Modal Core Wrapper */
.br-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: transparent;
  pointer-events: none;
  font-family: var(--br-font-sans);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.br-modal.br-active {
  pointer-events: auto;
  opacity: 1;
}

/* Fullscreen Overlay background */
.br-overlay {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--br-bg-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Canvas backgrounds */
#br-starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#br-particle-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

/* Top Global Session Timer */
.br-global-timer {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  font-weight: 400;
  color: var(--br-text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1.5px;
  z-index: 10;
  user-select: none;
}

/* ==========================================================================
   1. MENU CARD (Glassmorphism design)
   ========================================================================== */
.br-menu-card {
  position: relative;
  z-index: 10;
  width: 90%;
  max-width: 696px;
  background: rgba(18, 18, 20, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px 30px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
  transform: scale(0.95);
  opacity: 0;
}

.br-modal.br-active .br-menu-card {
  transform: scale(1);
  opacity: 1;
}

.br-menu-title {
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 30%, #a5a5a5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.br-menu-subtitle {
  font-size: 15px;
  color: var(--br-text-secondary);
  line-height: 1.5;
  margin-bottom: 30px;
  max-width: 440px;
}

.br-menu-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

/* Breathing Mode Buttons */
.br-menu-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 18px 24px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
}

.br-menu-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.br-menu-btn:active {
  transform: translateY(0);
}

.br-btn-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.br-btn-name {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
}

.br-btn-pattern {
  font-size: 12px;
  font-weight: 700;
  color: var(--br-text-secondary);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.br-btn-desc {
  font-size: 13px;
  color: var(--br-text-secondary);
  line-height: 1.5;
}

/* Close/Exit Menu Button */
.br-menu-close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--br-text-secondary);
  padding: 10px 30px;
  font-size: 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.br-menu-close-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   2. SESSION CONTAINERS & GEOMETRY
   ========================================================================== */
.br-session-container {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Box Breathing Container */
#br-container-box {
  width: 440px;
  height: 440px;
}

.br-square-box {
  position: absolute;
  box-sizing: border-box;
  width: 442px;
  height: 442px;
  top: -1px;
  left: -1px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
}

.br-box-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  user-select: none;
}

.br-box-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.7), 0 0 28px rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.br-box-tail {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}
#br-box-tail0 { opacity: 0.75; transform: translate(-50%, -50%) scale(0.85); }
#br-box-tail1 { opacity: 0.55; transform: translate(-50%, -50%) scale(0.7); }
#br-box-tail2 { opacity: 0.40; transform: translate(-50%, -50%) scale(0.55); }
#br-box-tail3 { opacity: 0.25; transform: translate(-50%, -50%) scale(0.4); }
#br-box-tail4 { opacity: 0.10; transform: translate(-50%, -50%) scale(0.25); }


/* 4-7-8 Breathing (Circular Layout) */
#br-container-478 {
  width: 440px;
  height: 440px;
}

.br-circle-box {
  position: absolute;
  box-sizing: border-box;
  width: 442px;
  height: 442px;
  top: -1px;
  left: -1px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
}

.br-circle-static-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  opacity: 0.6;
  transition: opacity 0.8s ease;
}

.br-circle-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  user-select: none;
}

.br-circle-label-text {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 3px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  margin-bottom: 8px;
}

.br-circle-label-seconds {
  font-size: 48px;
  font-weight: 100;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.br-circle-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.7), 0 0 28px rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.br-circle-tail {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}


/* 5-5 Breathing (Vertical track Layout) */
#br-container-55 {
  width: 600px;
  height: 440px;
}

.br-track-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(-50%);
  border-radius: 1px;
}

.br-track-label-left {
  position: absolute;
  right: 50%;
  margin-right: 80px;
  display: flex;
  align-items: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.85);
  font-size: 26px;
  font-weight: 300;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  text-align: right;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
}

.br-track-label-right {
  position: absolute;
  left: 50%;
  margin-left: 80px;
  display: flex;
  align-items: center;
  height: 100%;
  color: rgba(255, 255, 255, 0.85);
  font-size: 64px;
  font-weight: 100;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  user-select: none;
  pointer-events: none;
}

.br-track-bar {
  position: absolute;
  left: 50%;
  width: 30px;
  height: 4px;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.7), 0 0 28px rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  z-index: 2;
}

.br-track-tail {
  position: absolute;
  left: 50%;
  width: 30px;
  height: 4px;
  border-radius: 2px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
}
#br-track-tail0 { opacity: 0.75; transform: translate(-50%, -50%) scaleX(0.85); }
#br-track-tail1 { opacity: 0.55; transform: translate(-50%, -50%) scaleX(0.7); }
#br-track-tail2 { opacity: 0.40; transform: translate(-50%, -50%) scaleX(0.55); }
#br-track-tail3 { opacity: 0.25; transform: translate(-50%, -50%) scaleX(0.4); }
#br-track-tail4 { opacity: 0.10; transform: translate(-50%, -50%) scaleX(0.25); }


/* ==========================================================================
   3. BOTTOM CONTROLS & PANEL
   ========================================================================== */
.br-controls-panel {
  position: absolute;
  bottom: 50px;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  z-index: 10;
  padding: 0 24px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Top Right Action Buttons (Fullscreen & Close) */
.br-top-controls {
  position: fixed;
  top: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 100;
}

.br-fullscreen-btn,
.br-close-btn {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.7);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  padding: 0;
}

.br-fullscreen-btn:hover,
.br-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: scale(1.05);
}

.br-controls-panel.br-hidden {
  opacity: 0 !important;
  pointer-events: none;
}

/* Exit Active Session Button */
.br-exit-btn {
  font-family: var(--br-font-sans);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 30px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: all 0.25s ease;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.br-exit-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Glass settings box */
.br-settings-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Mute button */
.br-mute-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: all 0.2s ease;
  outline: none;
}

.br-mute-btn:hover {
  color: #ffffff;
  transform: scale(1.15);
}

/* Slider speed styling */
.br-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--br-text-secondary);
}

.br-slider-label {
  pointer-events: none;
  user-select: none;
  font-weight: 500;
  letter-spacing: 0.3px;
}

#br-speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

#br-speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  transition: transform 0.1s;
}

#br-speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

/* Stars toggle button */
.br-star-btn {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
  padding: 0;
  outline: none;
}

.br-star-btn:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.br-star-indicator {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  transition: opacity 0.2s, transform 0.2s;
}

.br-star-btn.br-off .br-star-indicator {
  opacity: 0;
  transform: scale(0);
}

/* ==========================================================================
   4. UTILS & SCREEN ADAPTABILITY
   ========================================================================== */
.br-fade-out {
  animation: br-fadeOutAnim 0.6s ease-in-out forwards !important;
}

@keyframes br-fadeOutAnim {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Responsiveness */
@media (max-width: 640px) {
  .br-menu-card {
    padding: 30px 20px;
  }
  .br-menu-title {
    font-size: 26px;
  }
  .br-menu-subtitle {
    font-size: 13px;
    margin-bottom: 20px;
  }
  .br-menu-btn {
    padding: 14px 18px;
  }
  .br-btn-name {
    font-size: 15px;
  }
  .br-btn-desc {
    font-size: 12px;
  }

  /* Scale down the widgets on smaller devices */
  #br-container-box {
    transform: scale(0.7);
  }
  #br-container-478 {
    transform: scale(0.7);
  }
  #br-container-55 {
    transform: scale(0.6);
  }
  
  .br-controls-panel {
    bottom: 30px;
    flex-direction: column;
    gap: 12px;
  }
  
  .br-top-controls {
    top: 20px;
    right: 20px;
    gap: 10px;
  }
  
  .br-fullscreen-btn,
  .br-close-btn {
    width: 38px;
    height: 38px;
  }
  .br-settings-box {
    padding: 6px 16px;
  }
}
