.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0c0d10;
  color: #f4f4f6;
  padding: 12px 24px;
  margin: -20px -20px 20px -20px;
  border-bottom: 1px solid #1e1f24;
}

.user-bar-logo {
  height: 44px;
  width: auto;
  filter: brightness(0) invert(1);
}

.user-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #f4f4f6;
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid #3a3b40;
  color: #f4f4f6;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
  background: #1e1f24;
}

.logout-btn {
  background: transparent;
  border: 1px solid #3a3b40;
  color: #f4f4f6;
  padding: 8px 20px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
}

.logout-btn:hover {
  background: #f4f4f6;
  color: #0c0d10;
}

body {
  margin: 0;
  font-family: 'Figtree', sans-serif;
  background-color: #F0F0F0;
  color: #171717;
  padding: 20px;
}

.header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.header h1 {
  font-size: 1.8em;
  letter-spacing: -0.02em;
  font-weight: 700;
}

body.dark {
  background-color: #171717;
  color: #FAFAFA;
}

body.dark h1,
body.dark h2,
body.dark h3 {
  color: #FAFAFA;
}

body.dark .section {
  background: #1f1f1f;
}

body.dark select,
body.dark input,
body.dark textarea {
  background: #2a2a2a;
  color: #FAFAFA;
  border-color: #3a3a3a;
}

body.dark button {
  background: #FAFAFA;
  color: #171717;
}

body.dark button:hover {
  background: #E0E0E0;
}

#themeToggle {
  background: #171717;
  color: #FAFAFA;
  border: 1px solid #3a3a3a;
}

#themeToggle:hover {
  background: #2a2a2a;
}

body.dark #themeToggle {
  background: #FAFAFA;
  color: #171717;
  border: 1px solid #E0E0E0;
}

body.dark #themeToggle:hover {
  background: #E0E0E0;
}

body.dark .history-item {
  background: #2a2a2a;
  border-color: #3a3a3a;
}

body.dark .history-item:hover {
  border-color: #FAFAFA;
}

body.dark #advancedSummary {
  background: #2a2a2a;
  border-color: #3a3a3a;
}

body.dark .close {
  color: #FAFAFA;
}

body.dark .modal {
  background: #1f1f1f;
}

body.dark .tooltip {
  background: #FAFAFA;
  color: #171717;
}

.drill-builder-heading {
  font-size: 1.1em;
  font-weight: 600;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #E0E0E0;
}

body.dark .drill-builder-heading {
  border-bottom-color: #3a3a3a;
}

.drill-builder-section {
  margin-top: 20px;
}

body.dark .tooltip::after {
  border-top-color: #FAFAFA;
}

.welcome-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.welcome-modal-overlay.show {
  display: flex;
}

.welcome-modal {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.welcome-modal h2 {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.5em;
}

.welcome-modal ul {
  padding-left: 20px;
  margin: 15px 0;
}

.welcome-modal li {
  margin-bottom: 8px;
  line-height: 1.4;
}

.welcome-modal p {
  margin: 10px 0;
  line-height: 1.5;
}

.welcome-btn {
  width: 100%;
  padding: 14px;
  font-size: 1em;
  font-weight: 600;
  margin-top: 20px;
  background: #171717;
  color: #FAFAFA;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.welcome-btn:hover {
  background: #2a2a2a;
}

body.dark .welcome-modal {
  background: #1f1f1f;
  color: #FAFAFA;
}

body.dark .welcome-btn {
  background: #FAFAFA;
  color: #171717;
}

body.dark .welcome-btn:hover {
  background: #E0E0E0;
}

.welcome-copyright {
  font-size: 0.75em;
  text-align: center;
  color: #888;
  margin-top: 15px;
  margin-bottom: 0;
}

body.dark .section-container:hover {
  border-color: #FAFAFA;
}

body.dark .preset-sessions {
  border-top-color: #3a3a3a;
}

.drill-content {
  cursor: move;
  padding: 8px;
  background: #F8F8F8;
  margin: 5px 0;
  border-radius: 5px;
  border: 1px solid #E4E4E4;
}

body.dark .drill-content {
  background: #2a2a2a;
  border-color: #3a3a3a;
}

.advanced-summary {
  margin-top: 10px;
  padding: 10px;
  background: #F8F8F8;
  border-radius: 5px;
  border: 1px solid #E4E4E4;
}

body.dark .advanced-summary {
  background: #2a2a2a;
  border-color: #3a3a3a;
}

.clear-all-btn {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  color: #1f1f1f !important;
  cursor: pointer;
  margin-top: 15px;
  padding: 0 !important;
}

body.dark .clear-all-btn {
  color: #FAFAFA !important;
}

.download-pdf-btn {
  background: #FFFFFF !important;
  border: 1px solid #000000 !important;
  color: #000000 !important;
}

body.dark .download-pdf-btn {
  background: #2a2a2a !important;
  border: 1px solid #FAFAFA !important;
  color: #FAFAFA !important;
}

.logo {
  height: 80px;
  margin-right: 20px;
}

h1 {
  color: #171717;
  margin: 0;
  font-size: 2em;
}

h2 {
  text-align: center;
  color: #171717;
}

.side-by-side {
  display: flex;
  gap: 20px;
}

.left-panel { flex: 3; }
.right-panel { flex: 2; }

.section {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 10px rgba(255,255,255,0.05);
}

select, input, button, textarea {
  width: 100%;
  margin: 8px 0;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #E4E4E4;
  background: #F8F8F8;
  color: #171717;
  transition: 0.3s ease;
  font-family: inherit;
}

textarea {
  resize: vertical;
  min-height: 60px;
}

.row-pair {
  display: flex;
  gap: 20px;
}

.row-pair label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-pair label input {
  width: 80px;
}

.duration-box {
  display: inline-block;
  cursor: pointer;
}

.duration-box input[type="radio"] {
  display: none;
}

.duration-box span {
  display: inline-block;
  padding: 8px 14px;
  background: #F8F8F8;
  border: 2px solid #E4E4E4;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.duration-box input[type="radio"]:checked + span {
  background: #171717;
  color: #fff;
  border-color: #171717;
}

.duration-box:hover span {
  border-color: #999;
}

button {
  background: #171717;
  border: none;
  color: #fff;
  font-weight: bold;
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

button:hover {
  background: #2F2F2F;
  transform: scale(1.02);
}

.edit-btn {
  background: #666;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin: 5px 4px 5px 0;
}

.edit-btn:hover {
  background: #555;
}

.delete-btn {
  background: #666;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin: 5px 0;
}

.delete-btn:hover {
  background: #555;
}

.drill-edit-form {
  padding: 10px;
  background: #f5f5f5;
  border-radius: 8px;
  margin: 5px 0;
}

.edit-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.edit-form-grid label {
  font-size: 12px;
  font-weight: 600;
}

.edit-form-grid input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 12px;
  box-sizing: border-box;
}

.drill-edit-form .note-box {
  font-size: 12px;
  padding: 4px 6px;
  min-height: 30px;
}

.save-edit-btn {
  background: #0b6e57;
  color: white;
  border: none;
  padding: 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 6px;
}

.save-edit-btn:hover {
  background: #388E3C;
}

.cancel-edit-btn {
  background: #999;
  color: white;
  border: none;
  padding: 5px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.cancel-edit-btn:hover {
  background: #777;
}

body.dark .drill-edit-form {
  background: #2a2a2a;
}

body.dark .edit-form-grid input {
  background: #333;
  color: #eee;
  border-color: #555;
}

.session-summary {
  background: #FFFFFF;
  padding: 20px;
  border-radius: 16px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal {
  display: none;
  position: fixed;
  top: 10%; left: 50%;
  transform: translateX(-50%);
  background: #FFFFFF;
  padding: 20px;
  border-radius: 10px;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.modal-content {
  position: relative;
}

.close {
  position: absolute;
  top: 8px; right: 12px;
  cursor: pointer;
  font-size: 24px;
  color: #171717;
}

.preset-sessions {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #E4E4E4;
}

.preset-sessions h3 {
  margin: 0 0 15px 0;
  color: #171717;
  font-size: 1.1em;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.preset-buttons button {
  background: #2e7d32;
  padding: 8px 12px;
  margin: 0;
  font-size: 0.9em;
}

.preset-buttons button:hover {
  background: #388e3c;
}

.preset-buttons button {
  position: relative;
}

.tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #171717;
  color: #FFFFFF;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.8em;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  pointer-events: none;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #171717;
}

.preset-buttons button:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

.speed-bands-row {
  margin-bottom: 10px;
}

.speed-bands-toggle {
  background: transparent;
  border: 1px solid #ccc;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: inherit;
}

.speed-bands-toggle:hover {
  background: #e0e0e0;
}

.speed-bands-panel {
  margin-top: 8px;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.speed-bands-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.speed-bands-inputs label {
  display: flex;
  align-items: center;
  gap: 4px;
}

body.dark .speed-bands-panel {
  background: #2a2a2a;
  border-color: #444;
}

body.dark .speed-bands-toggle {
  border-color: #555;
}

body.dark .speed-bands-toggle:hover {
  background: #333;
}

body.dark .speed-bands-inputs input {
  background: #333;
  color: #eee;
  border-color: #555;
}

.preset-sessions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.preset-card {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.preset-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preset-card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.preset-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

body.dark .preset-card {
  background: #2a2a2a;
  border-color: #444;
}

.preset-name-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.preset-name-modal-overlay.show {
  display: flex;
}

.preset-name-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

body.dark .preset-name-modal {
  background: #1f1f1f;
  color: #eee;
}

body.dark .preset-name-modal input {
  background: #333;
  color: #eee;
  border-color: #555;
}

@media (max-width: 600px) {
  .preset-sessions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.each-side-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}

.each-side-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Info tooltip for summary stats */
.info-tooltip {
  cursor: help;
  border-bottom: 1px dotted #666;
}

.section-container {
  margin: 10px 0;
  border: 2px solid transparent;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.section-container:hover {
  border-color: #171717;
}

.section-container {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.section-container.dragging {
  opacity: 0.5;
  cursor: move;
  transform: scale(0.98);
}

.section-container.drag-over {
  border-color: #2e7d32;
  background: rgba(46, 125, 50, 0.08);
  transform: scale(1.01);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

.section-container.drag-over::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2e7d32, #0b6e57);
  border-radius: 3px;
}

.drill-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: grab;
  padding: 8px;
  margin: 4px 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.5);
}

.drill-item:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.drill-item:active {
  cursor: grabbing;
}

.drill-item.dragging {
  opacity: 0.4;
  transform: scale(0.98);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.drill-item.drag-over-top::before,
.drill-item.drag-over-bottom::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2e7d32, #0b6e57);
  border-radius: 2px;
  z-index: 10;
}

.drill-item.drag-over-top::before {
  top: -4px;
}

.drill-item.drag-over-bottom::after {
  bottom: -4px;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.name-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.name-input-wrapper label {
  margin-bottom: 0;
}

.autocomplete-container {
  position: relative;
  flex: 1;
}

.autocomplete-container input {
  width: 100%;
}

.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  color: #333;
  border: 1px solid #E4E4E4;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 4px;
}

.autocomplete-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.15s ease;
  color: #333;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: #f5f5f5;
}

.autocomplete-item small {
  color: #666;
}

@keyframes slideIn {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.history-item {
  background: #F8F8F8;
  padding: 12px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid #E4E4E4;
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: #171717;
  transform: translateX(5px);
}

.history-btn {
  background: #2e7d32;
  padding: 6px 12px;
  margin: 0 5px;
  width: auto;
  font-size: 0.9em;
}

.history-btn:hover {
  background: #388E3C;
}

@media(max-width: 768px) {
  .side-by-side { flex-direction: column; }
  .row-pair { flex-direction: column; }
  .preset-buttons { grid-template-columns: repeat(2, 1fr); }
}
