/* =====================================================
   GLOBAL LAYOUT — LIGHT MODE (DEFAULT)
   ===================================================== */

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;

  display: flex;
  flex-direction: column;

  height: 100vh;
  background: #f2f2f2;
  color: #000;
  overflow: hidden;
}

/* =====================================================
   APP SHELL — 3 LIGE BREDE PANELER
   ===================================================== */

.app-shell {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  gap: 0;
}

/* =====================================================
   TOP HEADER – STRAVA ORANGE
   ===================================================== */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: #fc4c02;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}

.app-title {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

/* =====================================================
   THEME TOGGLE BUTTON
   ===================================================== */

.theme-toggle {
  margin-left: auto;
  padding: 6px 12px;
  background: #ffffff22;
  color: #fff;
  border: 1px solid #ffffff55;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.2s;
}

.theme-toggle:hover {
  background: #ffffff44;
}

/* =====================================================
   SIDEBAR
   ===================================================== */

#sidebar {
  background: #ffffff;
  border-right: 1px solid #ccc;
  padding: 15px;
  overflow-y: auto;
  box-shadow: 0 0 6px rgba(0,0,0,0.05);
}

/* Plan-række med skraldespand */
.plan-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

/* Plan-knap */
.plan-item {
  flex: 1;
  padding: 5px 6px;
  font-size: 13px;
  background: #f7f7f7;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.plan-item:hover {
  background: #fc4c02;
  color: white;
  border-color: #fc4c02;
}

.plan-item.selected {
  border: 2px solid black !important;
  background: #ffe9dd;
}

/* Skraldespands-ikon */
.delete-plan {
  cursor: pointer;
  color: #777;
  padding: 3px;
  border-radius: 4px;
  margin-left: 4px;
  transition: 0.2s;
}

.delete-plan:hover {
  color: #fc4c02;
  background: #ffe9dd;
}


/* Sidebar action-knapper (Ny/Gem/Import/Export) */
#sidebar .sidebar-actions button {
  padding: 5px 8px;
  font-size: 13px;
  margin-top: 4px;
  border-radius: 6px;
  background: #fc4c02;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  border: none;
}

#sidebar .sidebar-actions button:hover {
  background: #e04402;
  transform: translateY(-1px);
}


/* =====================================================
   WEEK BUTTONS
   ===================================================== */

/* Container: ugerne skal ligge under hinanden */
#weekButtons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Selve ugeknappen */
.week-btn {
  width: 100%;
  padding: 6px 8px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #fafafa;
  cursor: pointer;
  transition: 0.2s;
  text-align: left;
}

/* Valgt uge: sort ramme */
.week-btn.selected {
  background: #fc4c02;
  color: white;
  border: 2px solid #000;
}


/* =====================================================
   MAIN PANEL
   ===================================================== */

#mainPanel {
  padding: 15px;
  overflow-y: auto;
  min-width: 0;
  background: #f7f7f7;
}

#mainPanel h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 20px;
  font-weight: 700;
  color: #333;
}

/* Session-kort (træningspas) */

.session-card {
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: 0.2s;
}

.session-card.selected {
  border: 2px solid #000;
}

.session-card:hover {
  background: #fff5ef;
}

.session-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.session-title {
  font-weight: 700;
  font-size: 15px;
}

/* Ugedags-dropdown i midterpanelet */
.session-day-select {
  width: 90px;
  padding: 4px 6px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #bbb;
  background: #fff;
  margin-left: auto;
  box-sizing: border-box;
}

.session-steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Strava-stil knapper i bunden af hvert pas */
.session-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.session-actions button {
  flex: 1;
  padding: 8px;
  background: #fc4c02;
  color: white;
  border-radius: 6px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}

.session-actions button:hover {
  background: #e04402;
}

/* =====================================================
   STEP CARDS
   ===================================================== */

.step-card {
  background: white;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: 0.2s;
}

.step-card:hover {
  background: #fff5ef;
}

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

.step-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.step-sub {
  color: #555;
  font-size: 14px;
}

/* Step actions (flyt/slet) */

.step-actions {
  display: flex;
  gap: 6px;
}

.step-action-btn {
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  color: #666;
  transition: 0.2s;
  font-size: 12px;
}

.step-action-btn:hover {
  background: #eee;
  color: #fc4c02;
}

.step-action-btn.delete:hover {
  background: #ffe5e5;
  color: #d00000;
}

/* =====================================================
   EDITOR PANEL
   ===================================================== */

#editorPanel {
  background: #ffffff;
  border-left: 1px solid #ccc;
  padding: 12px;
  overflow-y: auto;
  box-shadow: 0 0 6px rgba(0,0,0,0.05);
}

#editorPanel h3 {
  margin-top: 16px;
  margin-bottom: 6px;
  font-size: 15px;
  color: #fc4c02;
}

label {
  display: block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: bold;
}

input, select, textarea {
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #bbb;
  transition: 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #fc4c02;
  box-shadow: 0 0 0 2px rgba(252,76,2,0.25);
  outline: none;
}

/* =====================================================
   JSON PREVIEW
   ===================================================== */

#jsonPreview {
  background: #1e1e1e;
  color: #dcdcdc;
  padding: 10px;
  border-radius: 6px;
  margin-top: 15px;
  height: 200px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}

/* =====================================================
   SEGMENT EDITOR (hvis du bruger den)
   ===================================================== */

.segment-card {
  background: #fafafa;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
}

.segment-card strong {
  color: #fc4c02;
}

/* =====================================================
   DARK MODE OVERRIDES
   ===================================================== */

body.dark-mode {
  background: #000;
  color: #fff;
}

body.dark-mode #sidebar,
body.dark-mode #editorPanel,
body.dark-mode #mainPanel {
  background: #111;
  color: #fff;
}

body.dark-mode .plan-item {
  background: #1a1a1a;
  border-color: #333;
  color: #fff;
}

body.dark-mode .plan-item:hover {
  background: #fc4c02;
  color: #fff;
}

body.dark-mode .plan-item.selected {
  background: #2a2a2a;
  border: 2px solid #fff !important;
}

body.dark-mode .delete-plan {
  color: #aaa;
}

body.dark-mode .delete-plan:hover {
  color: #fc4c02;
  background: #333;
}

body.dark-mode .week-button {
  background: #1a1a1a;
  border-color: #333;
  color: #fff;
}

body.dark-mode .week-button.active {
  background: #fc4c02;
  border: 2px solid #fff !important;
}

body.dark-mode .session-card {
  background: #1a1a1a;
  color: #fff;
}

body.dark-mode .step-card {
  background: #1a1a1a;
  color: #fff;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #222;
  color: #fff;
  border: 1px solid #555;
}

body.dark-mode .segment-card {
  background: #1a1a1a;
  border-color: #333;
  color: #fff;
}

body.dark-mode #mainPanel h2 {
  color: #fff;
}

body.dark-mode .session-day-select {
  background: #222;
  color: #fff;
  border: 1px solid #555;
}

/* =====================================================
   DURATION ROW
   ===================================================== */

.duration-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.duration-field {
  display: flex;
  align-items: center;
  gap: 4px;
}

.duration-field input {
  width: 60px;
}

/* =====================================================
   OVERSKRIV PANELBREDDER
   ===================================================== */

#sidebar,
#mainPanel,
#editorPanel {
  width: auto !important;
  flex: none !important;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

/* TILFØJ TRÆNINGSPAS KNAP */

#addSessionBtn {
  display: block;
  width: 100%;
  padding: 6px 8px;
  margin-top: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  background: #fc4c02;
  color: white;
  border: none;
  cursor: pointer;
  transition: 0.15s;
}

#addSessionBtn:hover {
  background: #e04402;
  transform: translateY(-1px);
}



/* =========================================
   STRAVA-INSPIRERET UGE-LISTE (NAVIGATION)
   - Uger skal se anderledes ud end action-knapper
   ========================================= */

:root {
  --strava-orange: #fc4c02;
  --charcoal: #111827;       /* mørk neutral */
  --slate: #374151;          /* sekundær tekst */
  --panel: #f3f4f6;          /* lys panel baggrund */
  --card: #ffffff;           /* kort/knap baggrund */
  --border: #e5e7eb;         /* diskret kant */
}

/* Container: lodret liste */
#weekButtons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}

/* Ugeknapper: "liste-element" (ikke action-knap) */
.week-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;

  /* anderledes end dine normale knapper */
  background: linear-gradient(180deg, var(--card), #fbfbfb);
  border: 1px solid var(--border);

  color: var(--charcoal);
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

/* Hover: subtil (ikke fuld orange som action-knap) */
.week-btn:hover {
  border-color: #d1d5db;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

/* Klik-følelse */
.week-btn:active {
  transform: translateY(1px);
}

/* Valgt uge: sort ramme + strava-orange accent */
.week-btn.selected {
  border: 2px solid #000;                 /* ✅ din ønskede sorte ramme */
  background: #fff7f2;                    /* lys orange tone */
  position: relative;
}

/* Lille orange accent-stribe i venstre side (Strava vibe) */
.week-btn.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 10px;
  background: var(--strava-orange);
}
/* =========================================
   LÅS "TRÆNINGSPLANER" LISTE: ændrer IKKE udseende i dark mode
   ========================================= */

/* Plan-items: samme look i både light og dark */
body.dark-mode .plan-item {
  background: #f7f7f7 !important;
  border: 1px solid #ddd !important;
  color: #000 !important;
}

/* Hover: behold samme Strava-orange hover (som i light mode) */
body.dark-mode .plan-item:hover {
  background: #fc4c02 !important;
  color: #fff !important;
  border-color: #fc4c02 !important;
}

/* Selected: behold samme selected-look (som i light mode) */
body.dark-mode .plan-item.selected {
  background: #ffe9dd !important;
  border: 2px solid #000 !important;
  color: #000 !important;
}

/* Skraldespands-ikon: behold light-mode look */
body.dark-mode .delete-plan {
  color: #777 !important;
}

body.dark-mode .delete-plan:hover {
  color: #fc4c02 !important;
  background: #ffe9dd !important;
}
/* =====================================================
   UGER – MØRKEGRÅ STRAVA-STIL (overstyr orange hover/selected)
   ===================================================== */

#weekButtons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}

/* Standard ugeknap: mørkegrå */
.week-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;

  background: #2b2f36;           /* mørkegrå */
  border: 1px solid #3b414a;     /* mørk kant */
  color: #f3f4f6;                /* lys tekst */

  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

/* Hover: lidt lysere grå (IKKE orange) */
.week-btn:hover {
  background: #343a43 !important;
  border-color: #4b5563 !important;
  color: #ffffff !important;
}

/* Valgfri Strava accent: lille orange stripe til venstre */
.week-btn.selected::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 10px;
  display: none;
}

/* Sørg for at gamle dark-mode week-button regler ikke påvirker */
body.dark-mode .week-button,
body.dark-mode .week-button.active {
  all: unset;
}

/* Valgt uge: Strava-orange ramme */
.week-btn.selected {
  border: 2px solid #fc4c02 !important;   /* ✅ orange ramme */
  background: #3a404a !important;         /* behold mørkegrå */
  color: #fff !important;
  position: relative;
}
/* UGEKNAPPER: mørkegrå navigation */
#weekButtons .week-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  background: #2b2f36;
  border: 1px solid #3b414a;
  color: #f3f4f6;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

#weekButtons .week-btn:hover {
  background: #343a43;
  border-color: #4b5563;
  color: #fff;
}

/* VALGT UGE: orange ramme */
#weekButtons .week-btn.selected {
  background: #3a404a;
  border: 2px solid #fc4c02;  /* ✅ Strava orange ramme */
  color: #fff;
}

/* TILFØJ UGE: behold Strava-orange action-stil */
#weekButtons .add-week-btn {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fc4c02;
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

#weekButtons .add-week-btn:hover {
  background: #e04402;
  transform: translateY(-1px);
}
/* ===== Træningsmål panel ===== */
.goals-panel {
  margin: 8px 0 14px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fafafa;
}

.goal-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.goal-row:last-child {
  margin-bottom: 0;
}

.goal-label {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.goal-input {
  margin-left: auto;
  width: 145px;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid #bbb;
  background: #fff;
  box-sizing: border-box;
}

/* Dark mode: gør panelet mørkere, men behold læsbarhed */
body.dark-mode .goals-panel {
  background: #1a1a1a;
  border-color: #333;
}

body.dark-mode .goal-label {
  color: #fff;
}

body.dark-mode .goal-input {
  background: #222;
  color: #fff;
  border-color: #555;
}
/* =========================================
   UGER (Strava navigation): mørkegrå + orange ramme på valgt
   ========================================= */

#weekButtons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}

.week-item-row {
  display: flex;
}

.week-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  background: #2b2f36;      /* mørkegrå */
  border: 1px solid #3b414a;
  color: #f3f4f6;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  user-select: none;
}

.week-item:hover {
  background: #343a43;      /* stadig grå */
  border-color: #4b5563;
  color: #fff;
}

.week-item.selected {
  background: #3a404a;
  border: 2px solid #fc4c02; /* ✅ Strava orange ramme */
  color: #fff;
}
