/* Visual Variables & Core Reset */
:root {
  --color-bg: #09090b;
  --color-card: #141419;
  --color-card-hover: #1c1c24;
  --color-border: #22222a;
  --color-primary: #ff5722;
  --color-primary-rgb: 255, 87, 34;
  --color-accent: #fe5f1b;
  --color-neon: #39ff14;
  --color-text: #f3f4f6;
  --color-muted: #9ca3af;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--color-primary-rgb), 0.5);
}

/* Custom transitions and styling */
body {
  background-color: #060608;
  color: var(--color-text);
  overflow-x: hidden;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* Card glass effect */
.glass-panel {
  background: rgba(20, 20, 25, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-transition {
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Pop/Pulse effect for reactions */
@keyframes reactionPulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

.reaction-pop {
  animation: reactionPulse 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Calendar Month Day Custom Styles */
.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calendar-day:hover:not(.day-empty) {
  background-color: var(--color-border);
}

.calendar-day.day-selected {
  background-color: var(--color-primary) !important;
  color: white !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.3);
}

.calendar-day.day-today {
  border: 1.5px solid rgba(var(--color-primary-rgb), 0.6);
  font-weight: 700;
}

/* Workout Indicators in Calendar */
.workout-dot-container {
  display: flex;
  justify-content: center;
  gap: 2.5px;
  position: absolute;
  bottom: 4px;
  width: 100%;
}

.workout-dot {
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background-color: var(--color-primary);
}

.calendar-day.day-selected .workout-dot {
  background-color: white;
}

/* Toast animations */
@keyframes slideDownIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast-item {
  animation: slideDownIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Bottom Nav highlight line */
.nav-active {
  color: var(--color-primary) !important;
  font-weight: 700;
  position: relative;
}

.nav-active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background-color: var(--color-primary);
  border-radius: 0 0 999px 999px;
  box-shadow: 0 1px 8px rgba(var(--color-primary-rgb), 0.8);
}

/* Custom primary helper classes to override Tailwind's hardcoded colors */
.bg-custom-primary {
  background-color: var(--color-primary) !important;
}
.text-custom-primary {
  color: var(--color-primary) !important;
}
.border-custom-primary {
  border-color: var(--color-primary) !important;
}
.hover\:bg-custom-primary-dark:hover {
  filter: brightness(0.9);
}
.focus\:ring-custom-primary:focus {
  --tw-ring-color: var(--color-primary) !important;
}

/* Logo styling */
.gym-logo-container {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  overflow: hidden;
  background-color: var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--color-border);
}
.gym-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Color picker styling */
input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  cursor: pointer;
  background: none;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: 1.5px solid var(--color-border);
  border-radius: 9999px;
}

/* --- DYNAMIC GYM COLOR SCHEME OVERRIDES --- */
.text-brand-orange,
.hover\:text-brand-orange:hover,
.group-hover\:text-brand-orange:hover {
  color: var(--color-primary) !important;
}

.fill-brand-orange {
  fill: var(--color-primary) !important;
}

.bg-brand-orange,
.hover\:bg-brand-orange:hover,
.hover\:bg-brand-accent:hover {
  background-color: var(--color-primary) !important;
}

.border-brand-orange,
.focus\:border-brand-orange:focus {
  border-color: var(--color-primary) !important;
}

/* Opacity variants override */
.bg-brand-orange\/10 {
  background-color: rgba(var(--color-primary-rgb), 0.1) !important;
}

.bg-brand-orange\/20 {
  background-color: rgba(var(--color-primary-rgb), 0.2) !important;
}

.border-brand-orange\/20 {
  border-color: rgba(var(--color-primary-rgb), 0.2) !important;
}

.border-brand-orange\/30 {
  border-color: rgba(var(--color-primary-rgb), 0.3) !important;
}

.border-brand-orange\/40 {
  border-color: rgba(var(--color-primary-rgb), 0.4) !important;
}

/* Gradient background overrides */
.from-brand-orange {
  --tw-gradient-from: var(--color-primary) !important;
  --tw-gradient-to: var(--color-accent) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.to-brand-accent {
  --tw-gradient-to: var(--color-accent) !important;
}

.from-brand-accent {
  --tw-gradient-from: var(--color-accent) !important;
  --tw-gradient-to: var(--color-primary) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.to-brand-orange {
  --tw-gradient-to: var(--color-primary) !important;
}

/* Active timeline reaction button class override */
.btn-react-like.active-reaction,
.btn-react-dislike.active-reaction {
  background-color: rgba(var(--color-primary-rgb), 0.1) !important;
  border-color: var(--color-primary) !important;
  color: var(--color-primary) !important;
  font-weight: 700;
}

.btn-react-like.active-reaction svg,
.btn-react-dislike.active-reaction svg {
  fill: var(--color-primary) !important;
}

/* Calendar Collapse Mode Overrides */
.calendar-collapsed .wod-details-box {
  max-height: none !important;
  font-size: 0.925rem !important;
  line-height: 1.75 !important;
  border-color: rgba(var(--color-primary-rgb), 0.2) !important;
  background-color: rgba(10, 10, 12, 0.95) !important;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
}

.calendar-collapsed #daily-workouts-container {
  margin-top: 1.25rem;
}
