/* =====================================
   Base
===================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
}

main {
    max-width: 1000px;
    margin: 32px auto 60px auto;
    padding: 0 20px;
}

/* =====================================
   Layout Container
===================================== */

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================
   Header
===================================== */

.site-header {
    background: #121212;
    border-bottom: 1px solid #2a2a2a;
    padding: 18px 0;
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link img {
    height: 42px;
    width: auto;
    display: block;
}
.logo-text img {
    height: 42px;
    width: auto;
    display: block;
}

.logout-btn {
    display: flex;
    align-items: center;
}

.logout-btn img {
    height: 28px;
    width: auto;
    opacity: 0.8;
}

.logout-btn img:hover {
    opacity: 1;
}


/* =====================================
   Footer
===================================== */

.site-footer {
    margin-top: 80px;
    padding: 48px 0;
    border-top: 1px solid #2a2a2a;
    background: #111;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Footer nav */
.footer-nav {
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.footer-nav a {
    color: #81c784;
    text-decoration: none;
    margin-right: 20px;
}

.footer-nav a:hover {
    text-decoration: underline;
}

/* Support section layout */
.footer-support-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 32px;
    align-items: start;
}

/* Text block */
.footer-support {
    max-width: 520px;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #bdbdbd;
}

.footer-support-title {
    font-size: 1rem;
    margin-bottom: 12px;
    color: #ffffff;
}

/* QR images */
.footer-tipjar img.tipjar {
    width: 160px;
    height: auto;
    border-radius: 10px;
    background: #fff;
    padding: 6px;
}

/* =====================================
   Mobile
===================================== */

@media (max-width: 800px) {

    .footer-support-row {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-tipjar {
        display: flex;
        justify-content: center;
    }

    .footer-tipjar img.tipjar {
        width: 180px;
    }

}


/* =====================================
   Typography
===================================== */

h1 { font-size: 1.6rem; margin-bottom: 16px; }
h2 { font-size: 1.3rem; margin-bottom: 14px; }
h3 { font-size: 1.1rem; }

label {
    display: block;
    font-size: 0.9rem;
    color: #9e9e9e;
    margin-bottom: 6px;
}

/* =====================================
   Design System
===================================== */

.section {
    margin: 28px 0;
}

.card {
    background: #1e1e1e;
    border: 1px solid #2f2f2f;
    border-radius: 14px;
    padding: 18px;
	position: relative;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #181818;
    color: #e0e0e0;
    font-size: 16px;
}

.form-control:focus {
    outline: none;
    border-color: #4caf50;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 48px;

    border-radius: 8px;
    border: none;

    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.btn-danger {
    background: #b71c1c;
    color: #fff;
}

.btn-danger-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px 10px;
    border-radius: 6px;

    background: rgba(183, 28, 28, 0.12);
    border: 1px solid rgba(183, 28, 28, 0.4);

    color: #ef9a9a;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;

    transition: background 0.15s ease, transform 0.05s ease;
}

.btn-danger-link:hover {
    background: rgba(183, 28, 28, 0.25);
}

.btn-danger-link:active {
    transform: scale(0.96);
}

/* =====================================
   Action group component
   ===================================== */

.action-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-group .btn {
    width: auto;
    padding: 0 14px;
}

/* ---------- Mobile behavior ---------- */

@media (max-width: 700px) {

    .action-group {
        flex-direction: column;
    }

    .action-group .btn {
        width: 100%;
        height: 48px;
        font-size: 16px;
    }

}


/* =====================================
   Action system
   ===================================== */

.btn-sm {
    height: 36px;
    padding: 0 12px;
    font-size: 0.9rem;
}

.btn-secondary {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #3a3a3a;
}

.btn-secondary:hover {
    background: #333;
}


.btn-primary {
    background: #2e7d32;
    color: #fff;
}

/* =====================================
   Component — Set Card
===================================== */

.sets-wrapper {
    margin-top: 16px;
}

.set-card {
    background: #181818;
    border: 1px solid #2f2f2f;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.set-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.set-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.field-group label {
    font-size: 0.8rem;
    color: #9e9e9e;
    margin-bottom: 6px;
}

/* =====================================
   Sticky Exercise Header
===================================== */

.exercise-header {
    position: sticky;
    top: 72px; /* height of your main header */
    z-index: 50;

    background: #1e1e1e;

    margin: -18px -18px 16px -18px;
    padding: 14px 18px;

    border-bottom: 1px solid #2f2f2f;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* =====================================
   Workouts Table (Desktop)
===================================== */

.workouts-table {
    width: 100%;
    border-collapse: collapse;
}

.workouts-table th,
.workouts-table td {
    padding: 12px;
    border: 1px solid #2f2f2f;
    font-size: 0.95rem;
}

/* =====================================
   Mobile
===================================== */

@media (max-width: 700px) {

    main {
        padding: 0 14px;
    }

    /* Hide table headers */
    table thead {
        display: none;
    }

    /* Workouts as cards */
    .workouts-table tbody tr {
        display: block;
        background: #1e1e1e;
        border: 1px solid #2f2f2f;
        border-radius: 14px;
        padding: 18px;
        margin-bottom: 20px;
    }

    .workouts-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border: none;
        font-size: 1.05rem;
    }

    .workouts-table tbody td::before {
        content: attr(data-label);
        font-size: 0.85rem;
        color: #9e9e9e;
        font-weight: 500;
    }

    /* Sets mobile mode */
    table.sets-table tr {
        display: block;
        background: #1b1b1b;
        margin-bottom: 14px;
        padding: 14px;
        border-radius: 10px;
        border: 1px solid #2a2a2a;
    }

    table.sets-table td {
        display: flex;
        flex-direction: column;
        padding: 8px 0;
        border: none;
    }

    .field-label {
        display: block;
        font-size: 0.75rem;
        color: #8a8a8a;
        text-transform: uppercase;
        margin-bottom: 4px;
    }

    table.sets-table input {
        width: 100%;
        padding: 10px 12px;
        border-radius: 8px;
        border: 1px solid #333;
        background: #141414;
        color: #e0e0e0;
        font-size: 16px;
    }
		
	
}
/* =====================================
   Landing page
===================================== */

.landing-main {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-hero {
    text-align: center;
}

.landing-hero img {
    max-width: 520px;
    width: 90%;
    height: auto;
    transition: transform 0.2s ease;
}

.landing-link:hover img {
    transform: scale(1.02);
}

/* =====================================
   Help Drawer
===================================== */

#help-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background: #1e1e1e;
    border-left: 1px solid #2f2f2f;
    z-index: 999;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

#help-drawer.open {
    right: 0;
}

.help-drawer-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.help-drawer-header {
    padding: 18px;
    border-bottom: 1px solid #2f2f2f;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.help-drawer-content {
    padding: 18px;
    overflow-y: auto;
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (max-width: 700px) {
    #help-drawer {
        width: 100%;
        right: -100%;
    }

    #help-drawer.open {
        right: 0;
    }
}
/* for mapping pages */
.sticky-top-card {
    position: sticky;
    top: 0;
    z-index: 10;
}
/* =====================================
   Status badges
===================================== */

.status-approved {
    color: #81c784; /* already used green tone */
}

.status-proposed {
    color: #ffb74d; /* warm amber tone */
}

.status-rejected {
    color: #ef5350;
}

/* =====================================
   Checkbox group
===================================== */

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
}
/* =====================================
   Form section label
===================================== */

.form-section-label {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
}

/* =====================================
   Autocomplete – Exercise Search
===================================== */

.search-wrapper {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    background: #1e1e1e;
    border: 1px solid #2f2f2f;
    border-top: none;

    border-radius: 0 0 12px 12px;

    max-height: 260px;
    overflow-y: auto;

    z-index: 200;
}

.search-result-item {
    padding: 12px 14px;
    cursor: pointer;
    font-size: 0.95rem;
    border-bottom: 1px solid #2a2a2a;
}

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

.search-result-item:hover {
    background: #252525;
}

.search-result-item strong {
    color: #ffffff;
}

.search-result-meta {
    display: block;
    font-size: 0.8rem;
    color: #9e9e9e;
    margin-top: 2px;
}
/* =====================================
   Rep mode buttons
===================================== */

.rep-toggle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  border: 1px solid #3a3a3a;
  background: #ffffff;
  color: #111;

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

.rep-toggle-btn:active {
  transform: scale(0.96);
}

/* White state (no reps) */
.rep-toggle-btn.rep-disabled {
  background: #ffffff;
  color: #111;
  border-color: #cfcfcf;
}

/* Green state (has reps) */
.rep-toggle-btn.rep-enabled {
  background: #2e7d32;
  color: #fff;
  border-color: #2e7d32;
}

/* Disable button inside reps card */
.remove-repdetails-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 700;
  line-height: 1;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;

  background: #b71c1c;
  color: #fff;
  border: 1px solid #b71c1c;
}
.remove-repdetails-btn:active {
  transform: scale(0.96);
}
/* Set row: table-like */
.set-row {
  display: grid;
  grid-template-columns: 48px 1fr 1fr 1fr 1fr 44px; /* # | reps | weight | total | time | del */
  gap: 10px;
  align-items: center;
}

.set-cell {
  font-size: 0.95rem;
}

.set-cell-muted {
  font-size: 0.75rem;
  color: #9e9e9e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 4px;
}

.set-notes {
  margin-top: 10px;
}

.set-del-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b71c1c;
  background: rgba(183, 28, 28, 0.9);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 700px) {
  .workout-meta-row {
    display: grid !important;
    grid-template-columns: 90px 1fr;
    gap: 10px 12px;
    align-items: center;
  }

  /* kill inline widths on mobile */
  .workout-meta-row .form-control {
    width: 100% !important;
  }

  /* back link should look like a button */
  a.btn { text-decoration: none; }
}
/* Set row: table-like */
.set-row{
  display:grid;
  gap:10px 12px;
  align-items:center;
}

.set-row--simple{
  grid-template-columns: 44px 1fr 1fr 1fr 44px; /* SET | REPS | WEIGHT | TIME | - */
}

.set-row--rep{
  grid-template-columns: 44px 1fr 1fr 1fr 1fr 44px; /* SET | REPS | WEIGHT | TOTAL | TIME | - */
}

.unit{
  opacity:.8;
  font-size:.85em;
  margin-left:2px;
}
.input-compact {
  max-width: 80px;
  width: 100%;
}

/* Mobile: blijf 1 rij, maar compacter */
@media (max-width:700px){
  .set-cell{ font-size:0.92rem; }
  .set-cell-muted{ font-size:0.68rem; margin-bottom:2px; }

  .set-row--simple{
    grid-template-columns: 36px 1fr 1fr 1fr 40px;
  }

  .set-row--rep{
    grid-template-columns: 36px 0.9fr 1.1fr 1.1fr 1fr 40px;
  }

  .set-row .form-control{ height:36px; }
  .input-compact{
    max-width: 70px;
  }
}

/* Rep rows inside a set card (no extra side margin) */
.reps-container {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #2a2a2a;
}

.rep-row {
  display: grid;
  grid-template-columns: 44px 1fr 1fr 1.4fr 44px; /* rep# | weight | time | note | - */
  gap: 10px 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #232323;
}

.rep-row:last-child {
  border-bottom: none;
}

@media (max-width: 700px) {
  .rep-row {
    grid-template-columns: 36px 1fr 1fr 1.2fr 40px;
  }
}
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.6);
  z-index:9999;
  padding:18px;
}

.modal-card{
  max-width:640px;
  margin:60px auto;
}

.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}

/* =====================================
   Workout VIEW layout (read-only)
===================================== */

.set-row--view {
  grid-template-columns:
    60px   /* Set */
    60px   /* Toggle */
    140px  /* Reps */
    140px  /* Weight */
    160px  /* Total */
    120px  /* Time */
    1fr;   /* Notes */
}

.rep-row--view {
  grid-template-columns:
    60px   /* Rep */
    140px  /* Weight */
    120px  /* Time */
    1fr    /* Note */
    0px;
}

.is-hidden { display: none; }

.repdetails td {
  padding: 12px 12px;
}
/* =====================================
   Workout VIEW: hard override (prevents mobile stack rules)
===================================== */

.set-row--view {
  display: grid !important;
}

.rep-row--view {
  display: grid !important;
}
/* Workout VIEW: make repdetails align under the full set row */
.reps-container--view {
  margin-left: 0;          /* kill any inherited indentation */
  padding-left: 0;
  width: 100%;
}

/* Slight visual nesting without changing width */
.reps-container--view {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2a2a2a;
}
.reps-container--view {
  padding-left: 60px; /* aligns under the Toggle column nicely */
}

.set-row--view-head,
.rep-row--view-head {
  padding-top: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #2a2a2a;
}

.set-row--view-head .set-cell,
.rep-row--view-head .set-cell {
  opacity: 0.95;
}
/* =====================================
   Workout VIEW — Mobile clean reset
===================================== */

@media (max-width: 700px) {

  /* Kill desktop grid */
  .set-row--view {
    display: block !important;
    grid-template-columns: none !important;
  }

  .rep-row--view {
    display: block !important;
    grid-template-columns: none !important;
  }

  /* Remove desktop indent */
  .reps-container--view {
    padding-left: 0 !important;
  }

  /* Each cell becomes label | value */
  .set-row--view .set-cell,
  .rep-row--view .set-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
  }

  .set-row--view .set-cell::before,
  .rep-row--view .set-cell::before {
    content: attr(data-label);
    font-size: 0.75rem;
    color: #9e9e9e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Hide header rows completely */
  .set-row--view-head,
  .rep-row--view-head {
    display: none !important;
  }
  .set-row--view .set-cell,
  .rep-row--view .set-cell {
    padding: 4px 0;   /* was 6px */
  }
    .reps-container--view {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #2a2a2a;
    opacity: 0.95;
  }
    .set-row--view .set-cell::before,
  .rep-row--view .set-cell::before {
    font-size: 0.68rem;
    opacity: 0.7;
  }
}
/* =====================================
   Workout VIEW — Mobile TABLE mode
   Portrait: only Set, Reps, Weight, Time
   Landscape: all columns visible (grid), allow scroll
===================================== */

/* Give the set area a safe horizontal scroll on small screens */
@media (max-width: 700px) {
  .sets-wrapper { overflow-x: auto; }
}

/* ---- Portrait: 4 columns only ---- */
@media (max-width: 700px) and (orientation: portrait) {

  /* undo your "mobile clean reset" that turns it into blocks */
  .set-row--view,
  .set-row--view-head {
    display: grid !important;
    grid-template-columns: 44px 1fr 1fr 1fr !important; /* Set | Reps | Weight | Time */
    gap: 10px 12px;
    align-items: center;
  }

  /* hide columns: Toggle(2), Total(5), Notes(7) */
  .set-row--view > .set-cell:nth-child(2),
  .set-row--view > .set-cell:nth-child(5),
  .set-row--view > .set-cell:nth-child(7),
  .set-row--view-head > .set-cell:nth-child(2),
  .set-row--view-head > .set-cell:nth-child(5),
  .set-row--view-head > .set-cell:nth-child(7) {
    display: none !important;
  }

  /* also hide rep details block (since there's no toggle visible) */
  .reps-container--view {
    display: none !important;
  }
  
   /* remove inline labels inside the grid cells */
  .set-row--view .set-cell::before,
  .rep-row--view .set-cell::before {
    content: none !important;
    display: none !important;
  }
}

/* ---- Landscape: show full grid (keep your desktop columns) ---- */
@media (max-width: 700px) and (orientation: landscape) {

  /* undo your "mobile clean reset" for VIEW rows */
  .set-row--view,
  .set-row--view-head {
    display: grid !important;
  }

  .rep-row--view,
  .rep-row--view-head {
    display: grid !important;
  }

  /* also undo the label/value pseudo labels on landscape */
  .set-row--view .set-cell::before,
  .rep-row--view .set-cell::before {
    content: none !important;
  }
}
/* =====================================
   Workouts list — Mobile portrait: table mode + fewer columns
   Keep your existing mobile "cards" for landscape.
===================================== */
@media (max-width: 700px) and (orientation: portrait) {

  /* restore real table layout (undo the "cards" rules) */
  .workouts-table thead { display: table-header-group !important; }
  .workouts-table tbody { display: table-row-group !important; }
  .workouts-table tbody tr { 
    display: table-row !important;
    background: transparent !important;
    border: 1px solid #2f2f2f !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .workouts-table tbody td {
    display: table-cell !important;
    padding: 12px !important;
    border: 1px solid #2f2f2f !important;
  }
  .workouts-table tbody td::before { 
    content: none !important;
    display: none !important;
  }

  /* hide Started (4), Ended (5), Duration (6) */
  .workouts-table th:nth-child(3),
  .workouts-table td:nth-child(3),
  .workouts-table th:nth-child(4),
  .workouts-table td:nth-child(4),
  .workouts-table th:nth-child(5),
  .workouts-table td:nth-child(5),
  .workouts-table th:nth-child(6),
  .workouts-table td:nth-child(6),
  .workouts-table th:nth-child(7),
  .workouts-table td:nth-child(7)  {
    display: none !important;
  }
}
/* hidden by default */
.mobile-landscape-tip{
  display:none;
  margin-bottom:10px;
  padding:10px 12px;
  font-size:0.85rem;
  border-radius:8px;
  border:1px solid #2f2f2f;
  background:#181818;
  color:#9e9e9e;
}

/* visible only on mobile portrait */
@media (max-width:700px) and (orientation:portrait){
  .mobile-landscape-tip{
    display:block;
  }
}


a {
  color: #81c784;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:visited {
  color: #81c784; /* kill the purple visited look */
}

/* links die als button dienen: nooit underline */
a.btn,
a.btn:hover {
  text-decoration: none;
}


/* body { outline: 6px solid hotpink !important; } */

