/* NowRise Web App - Custom Styles */

/* CSS Variables - Design System */
:root {
  /* Background Colors */
  --athletic-dark-gray: #1a1a1a;

  /* Accent Colors */
  --accent-primary: #4CAF50;
  --accent-secondary: #ff6b35;

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;

  /* UI Elements */
  --card-background: rgba(255, 255, 255, 0.05);
  --border-color: rgba(255, 255, 255, 0.1);

  /* Font Family */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Font Sizes */
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 1.875rem;  /* 30px */
  --text-4xl: 2.25rem;   /* 36px */
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Session Card Styles */
.session-card {
  position: relative;
  background: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.session-card:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.session-card:active {
  transform: scale(0.98);
}

.session-card-image-container {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(255, 107, 53, 0.1) 100%);
}

.session-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.session-card:hover .session-card-image {
  transform: scale(1.05);
}

/* Badge and Pills */
.session-type-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.session-duration-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--athletic-dark-gray);
  font-size: var(--text-xs);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Title Overlay with Gradient */
.session-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 16px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
}

.session-card-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  line-height: 1.3;
}

.session-card-subtitle {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Type-specific colors */
.session-type-meditation {
  border-left: 3px solid #4CAF50;
}

.session-type-visualization {
  border-left: 3px solid #2196F3;
}

.session-type-breathing {
  border-left: 3px solid #00BCD4;
}

.session-type-affirmation {
  border-left: 3px solid #FF9800;
}

.session-type-story {
  border-left: 3px solid #9C27B0;
}

/* Loading Animation */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton-card {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 1000px 100%;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .session-card-title {
    font-size: var(--text-base);
  }

  .session-card-subtitle {
    font-size: var(--text-xs);
  }

  .session-type-badge,
  .session-duration-pill {
    font-size: 10px;
    padding: 3px 8px;
  }
}

/* Focus states for accessibility */
.session-card:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Smooth transitions */
* {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Filter Pills */
.filter-pill {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-pill.active {
  background: #00CED1;
  color: #1a1a1a;
  border-color: #00CED1;
}

.filter-pill:active {
  transform: scale(0.96);
}

/* Hide scrollbar for filter pills */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* ============================================
   PLAYER STYLES
   ============================================ */

/* Blurred Background */
.player-background {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  filter: blur(50px);
  opacity: 0.3;
  transform: scale(1.2);
}

/* Player Controls */
.player-control-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: white;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.player-control-large:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.player-control-large:active {
  transform: scale(0.95);
}

.player-control-small {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.player-control-small:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.player-control-small:active {
  transform: scale(0.95);
}

/* Skip button "15" text positioning */
.player-control-small span {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  color: white;
  pointer-events: none;
  line-height: 1;
}

/* Progress Slider */
.progress-slider {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.progress-slider::-webkit-slider-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.progress-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.progress-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.progress-slider::-moz-range-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.progress-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.progress-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Progress fill effect */
.progress-slider {
  background: linear-gradient(
    to right,
    #00CED1 0%,
    #00CED1 var(--progress-percent, 0%),
    rgba(255, 255, 255, 0.2) var(--progress-percent, 0%),
    rgba(255, 255, 255, 0.2) 100%
  );
}

/* Mobile Adjustments for Player */
@media (max-width: 640px) {
  .player-control-large {
    width: 64px;
    height: 64px;
  }

  .player-control-small {
    width: 48px;
    height: 48px;
  }

  .player-control-small svg {
    width: 20px;
    height: 20px;
  }

  .player-control-small span {
    bottom: 8px;
    font-size: 8px;
  }
}

/* Safe area insets for mobile devices */
.player-safe-area {
  padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0px));
}

/* ============================================
   AFFIRMATIONS STYLES (iOS-inspired)
   ============================================ */

.affirmation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #00CED1;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.affirmation-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.affirmation-text {
  flex: 1;
  font-style: italic;
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.5;
  margin: 0;
}

.affirmation-edit-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  color: #00CED1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.affirmation-item:hover .affirmation-edit-btn {
  opacity: 1;
}

.affirmation-edit-btn:hover {
  background: rgba(0, 206, 209, 0.1);
}

.affirmation-edit-btn:active {
  transform: scale(0.95);
}

/* ============================================
   FOR YOU PAGE STYLES
   ============================================ */

.border-l-3 {
  border-left-width: 3px;
}

/* Horizontal scroll styling */
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Line clamp utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================
   ROUTINES STYLES
   ============================================ */

/* Context Pill Checkboxes */
.context-pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.context-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.context-pill.active {
  background: #00CED1;
  color: #1a1a1a;
  border-color: #00CED1;
}

/* Routine Items */
.routine-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  transition: all 0.2s ease;
}

.routine-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.routine-item.completed .routine-title {
  text-decoration: line-through;
  opacity: 0.5;
}

.routine-item.completed .routine-description {
  opacity: 0.5;
}

.routine-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.routine-checkbox:checked {
  background: #00CED1;
  border-color: #00CED1;
}

.routine-title {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 500;
  margin: 0 0 4px 0;
}

.routine-description {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0 0 8px 0;
}

.routine-contexts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.routine-context-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(0, 206, 209, 0.15);
  color: #00CED1;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}

.routine-edit-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  color: #00CED1;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.routine-item:hover .routine-edit-btn {
  opacity: 1;
}

.routine-edit-btn:hover {
  background: rgba(0, 206, 209, 0.1);
}

.routine-edit-btn:active {
  transform: scale(0.95);
}

/* Small checkbox for For You page */
.routine-checkbox-small {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.routine-checkbox-small:checked {
  background: #00CED1;
  border-color: #00CED1;
}
