/* Dark Mode Design */
:root {
  --primary-color: #bb86fc;
  --primary-dark: #9965f4;
  --primary-light: #d4b3ff;
  --secondary-color: #03dac6;
  --accent-color: #cf6679;
  --surface-color: #1e1e1e;
  --surface-elevated: #2d2d2d;
  --background-color: #121212;
  --on-surface: #e4e4e4;
  --on-surface-variant: #a0a0a0;
  --outline: #2d2d2d;
  --success-color: #81c784;
  --error-color: #cf6679;
  --shadow: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-elevated: 0 4px 16px rgba(0,0,0,0.4);
}

* {
  box-sizing: border-box;
}


body {
  background: var(--background-color);
  margin: 0;
  padding: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-surface);
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Mobile-first container */
.container {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* Header/App Bar */
.app-header {
  background: var(--primary-color);
  color: white;
  padding: 16px 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.app-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  text-align: center;
}

/* Main content area */
.main-content {
  padding: 16px;
  flex: 1 1 auto;
  overflow-y: auto;
  padding-bottom: 80px; /* Space for bottom nav only */
}

/* Sticky Action Bar */
.sticky-action-bar {
  position: sticky;
  top: 0px; /* Below the app header */
  background: var(--surface-elevated);
  padding: 12px 16px;
  box-shadow: var(--shadow-elevated);
  border-bottom: 1px solid rgba(187, 134, 252, 0.2);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Timer Section */
.timer-section {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-light);
  font-weight: 500;
  font-size: 16px;
}

.timer-display i {
  font-size: 18px;
}

.btn-timer {
  background: none;
  border: 1px solid var(--primary-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-timer:hover {
  background: rgba(187, 134, 252, 0.2);
  border-color: var(--primary-light);
}

.btn-timer.active {
  background: var(--success-color);
  border-color: var(--success-color);
  color: #121212;
}

/* Update save button for sticky bar */
.sticky-action-bar .btn {
  padding: 8px 16px;
  font-size: 14px;
  min-height: 36px;
  flex-shrink: 0;
}

/* Routine Selector - Material Design */
.routine-selector {
  margin-bottom: 12px;
}

/* Day Selector - Material Design */
.day-selector {
  margin-bottom: 16px;
}

.form-select {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: var(--surface-color);
  font-size: 16px;
  color: var(--on-surface);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23a0a0a0' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.2);
}

/* Exercise Cards - Material Design */
.exercise-card {
  background: var(--surface-color);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--outline);
  transition: all 0.2s;
}

.exercise-card:hover {
  border-color: rgba(187, 134, 252, 0.3);
  box-shadow: var(--shadow-elevated);
}

.exercise-header {
  background: var(--surface-elevated);
  color: var(--primary-light);
  padding: 16px 20px;
  font-weight: 500;
  font-size: 16px;
  margin: 0;
  border-left: 3px solid var(--primary-color);
}

.exercise-title {
  margin-bottom: 8px;
}

.muscle-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.muscle-pill {
  background: rgba(187, 134, 252, 0.15);
  color: var(--primary-light);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(187, 134, 252, 0.3);
}

.exercise-body {
  padding: 12px 20px;
}

/* Set Input - Android Style */
.set-input {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px 0;
}

.set-input span {
  width: 60px;
  font-weight: 500;
  color: var(--on-surface-variant);
  font-size: 14px;
}

.set-input input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--outline);
  border-radius: 8px;
  background: var(--surface-color);
  color: var(--on-surface);
  font-size: 16px;
  margin-right: 8px;
  transition: border-color 0.2s;
}

.set-input input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(187, 134, 252, 0.2);
}

.set-input input::placeholder {
  color: var(--on-surface-variant);
  font-size: 14px;
}


/* Buttons - Material Design */
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}

.btn-primary {
  background: var(--primary-color);
  color: #121212;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: var(--shadow-elevated);
}

.btn-success {
  background: var(--success-color);
  color: #121212;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.btn-success:hover {
  background: #a5d6a7;
  box-shadow: var(--shadow-elevated);
}

.btn-secondary {
  background: var(--surface-elevated);
  color: var(--on-surface);
}

.btn-secondary:hover {
  background: #3a3a3a;
}

.btn-outline-primary {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
  background: rgba(187, 134, 252, 0.1);
}

.btn-outline-danger {
  background: transparent;
  color: var(--error-color);
  border: 1px solid var(--error-color);
}

.btn-outline-danger:hover {
  background: rgba(207, 102, 121, 0.1);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
  min-height: 36px;
}

/* Action buttons container */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.action-buttons .btn {
  flex: 1;
}

/* Floating Action Button */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--secondary-color);
  color: var(--on-surface);
  border: none;
  box-shadow: var(--shadow-elevated);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1001;
}

/* Logs Section */
.logs-section {
  margin-top: 16px;
}

.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
}

.logs-header h4 {
  margin: 0;
  color: var(--primary-light);
  font-size: 18px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logs-header h4 i {
  color: var(--primary-color);
}

/* Schedule Section */
.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 4px;
  gap: 12px;
}

.schedule-header h4 {
  margin: 0;
  color: var(--primary-light);
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.schedule-header h4 i {
  color: var(--primary-color);
}

.schedule-day-card {
  background: var(--surface-color);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--outline);
  transition: all 0.2s;
}

.schedule-day-card:hover {
  border-color: rgba(187, 134, 252, 0.3);
  box-shadow: var(--shadow-elevated);
}

.schedule-day-header {
  background: var(--surface-elevated);
  color: var(--primary-light);
  padding: 12px 16px;
  font-weight: 500;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid var(--primary-color);
}

.schedule-day-body {
  padding: 16px;
}

.schedule-exercise {
  padding: 10px 0;
  border-bottom: 1px solid var(--outline);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.schedule-exercise:last-child {
  border-bottom: none;
}

.schedule-exercise-name {
  flex: 1;
  font-size: 14px;
  color: var(--on-surface);
  font-weight: 400;
}

.schedule-exercise-sets {
  color: var(--primary-light);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}

.schedule-exercise-muscles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.schedule-muscle-tag {
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-surface-variant);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 400;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.schedule-summary {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid var(--outline);
}

.schedule-stat {
  text-align: center;
}

.schedule-stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-light);
  display: block;
}

.schedule-stat-label {
  font-size: 12px;
  color: var(--on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Accordion/Workout Logs */
.accordion-item {
  background: var(--surface-color);
  border: 1px solid var(--outline);
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.2s;
}

.accordion-item:hover {
  border-color: rgba(187, 134, 252, 0.3);
}

.accordion-button {
  background: var(--surface-color);
  border: none;
  padding: 16px 20px;
  color: var(--on-surface);
  font-weight: 500;
  border-radius: 12px;
  transition: all 0.2s;
}

.accordion-button:hover {
  background: rgba(187, 134, 252, 0.05);
}

.accordion-button:not(.collapsed) {
  background: var(--surface-color);
  color: var(--primary-light);
  box-shadow: none;
  border-left: 3px solid var(--primary-color);
  padding-left: 17px;
}

.accordion-button:focus {
  box-shadow: none;
  border: none;
}

.accordion-body {
  background: var(--surface-color);
  border-top: 1px solid var(--outline);
}

.workout-date {
  font-size: 12px;
  color: var(--on-surface-variant);
  font-weight: 400;
}

.exercise-title {
  font-weight: 500;
  color: var(--on-surface);
  margin-bottom: 8px;
  font-size: 16px;
}

.sets-list {
  margin-left: 16px;
}

.sets-list .small {
  color: var(--on-surface-variant);
  margin-bottom: 4px;
  font-size: 13px;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-elevated);
  border-top: 1px solid var(--outline);
  display: flex;
  justify-content: space-around;
  z-index: 998;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--on-surface-variant);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item:hover {
  color: var(--primary-light);
  background: rgba(187, 134, 252, 0.08);
}

.nav-item.active {
  color: var(--primary-light);
}

.nav-item i {
  font-size: 20px;
  margin-bottom: 4px;
}

/* Dropdown menu styling */
.dropdown-menu {
  background: var(--surface-elevated);
  border: 1px solid var(--outline);
  box-shadow: var(--shadow-elevated);
  border-radius: 12px;
  padding: 8px 0;
  margin-top: 8px;
}

.dropdown-item {
  padding: 12px 20px;
  font-size: 14px;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  text-decoration: none;
}

.dropdown-item i {
  font-size: 16px;
  width: 20px;
}

.dropdown-item:hover {
  background: rgba(187, 134, 252, 0.15);
  color: var(--primary-light);
}

.dropdown-item.text-danger {
  color: var(--error-color);
}

.dropdown-item.text-danger:hover {
  background: rgba(207, 102, 121, 0.15);
  color: #e88c99;
}

.dropdown-divider {
  height: 1px;
  background: var(--outline);
  margin: 8px 0;
  border: none;
}

/* Alert styling */
.alert {
  border: none;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.alert-info {
  background: rgba(187, 134, 252, 0.1);
  color: var(--primary-light);
  border: 1px solid rgba(187, 134, 252, 0.3);
}

/* Cancel Button */
#cancelBtn {
  background: var(--error-color);
  color: #121212;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

#cancelBtn:hover {
  background: #e88c99;
}

.btn-danger {
  background: var(--error-color);
  color: #121212;
  font-weight: 600;
}

.btn-danger:hover {
  background: #e88c99;
}

/* Responsive adjustments */
@media (max-width: 576px) {
  .main-content {
    padding: 12px;
  }
  
  .floating-controls {
    padding: 12px 16px;
  }
  
  .exercise-header,
  .exercise-body {
    padding: 12px 16px;
  }
  
  .accordion-button {
    padding: 12px 16px;
  }
  
  .set-input input {
    padding: 10px 12px;
  }
}
