/* ═══════════════════════════════════════════════════════════
   Record Page — WerkerHeld V3 Timer Design
   Two states: .timer-idle (ready) / .timer-active (running)
   ═══════════════════════════════════════════════════════════ */

/* ─── General Page ──────────────────────────────────────── */
body[data-page="record"] {
  font-family: var(--font-main);
  background: var(--color-background);
  padding-left: var(--space-l);
  padding-right: var(--space-l);
}

body[data-page="record"] .container {
  padding: 0;
  gap: var(--space-m);
}

body[data-page="record"] #employeeRec {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxl);
}

body[data-page="record"] #employeeRec .area {
  padding: 0;
  margin: 0;
  padding-top: 0;
  gap: var(--space-s);
}

/* ─── Timer Card Container ──────────────────────────────── */
.timer-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xxl);
  padding: 28px 20px 24px;
  box-shadow: var(--shadow-One);
  text-align: center;
  transition:
    background var(--transition-slow),
    box-shadow var(--transition-slow);
}

/* activities link inside timer card */
#open_activities_btn {
  display: block;
  margin-top: 16px;
  font-size: 11px;
  font-weight: 800;
  color: var(--color-accent);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  transition: all 0.2s ease;
  text-align: center;
}

#open_activities_btn:hover {
  opacity: 1;
}

/* Active state adjustments */
.timer-card.timer-active #open_activities_btn {
  color: rgba(255, 255, 255, 0.8);
}

/* ─── Timer Upper Label ─────────────────────────────────── */
.timer-card .timer__subtitle--upper {
  font-size: 10px;
  font-weight: var(--weight-xl);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
  width: 100%;
}

.timer-card.timer-active .timer__subtitle--upper {
  color: rgba(255, 255, 255, 0.65);
}

/* ─── Timer Number ──────────────────────────────────────── */
.timer-card .timer__time {
  font-size: 2.75rem;
  font-weight: var(--weight-xl);
  color: var(--color-black);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  margin: 0 0 4px;
  width: 100%;
}

/* ─── Pause Info Box ────────────────────────────────────── */
.timer-card .pause-info {
  background: var(--color-background);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.timer-card .pause-info .pause-info__icon {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: var(--radius-v2-avatar);
  background: var(--color-accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-card .pause-info .pause-info__icon svg {
  width: 14px;
  height: 14px;
  stroke: var(--color-accent);
  fill: none;
}

.timer-card .pause-info .pause-info__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.timer-card .pause-info .pause-info__title {
  font-size: var(--size-xs);
  font-weight: var(--weight-l);
  color: var(--color-darkgray);
  width: auto;
  line-height: 1.2;
}

.timer-card .pause-info .pause-info__time {
  font-size: var(--size-xxs);
  color: var(--color-muted);
  width: auto;
  line-height: 1.2;
}

/* ─── Activity Feed ─────────────────────────────────────── */
.shift-progress {
  background: rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-m);
  margin-top: 14px;
  overflow: hidden;
}

.shift-progress__header {
  padding: 8px 12px 4px;
}

.shift-progress__header-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}

.shift-progress__feed {
  padding: 2px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 116px;
  overflow-y: auto;
  scrollbar-width: none;
}

.shift-progress__feed::-webkit-scrollbar {
  display: none;
}

.shift-progress__empty {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  padding: 6px 0 4px;
}

.shift-progress__event {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.shift-progress__event--running {
  background: rgba(255, 255, 255, 0.16);
}

.shift-progress__event-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot--break   { background: #fbbf24; }
.dot--project { background: #34d399; }

.shift-progress__event-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.shift-progress__event .event-label {
  font-size: 11px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-progress__event .event-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.shift-progress__event .event-dur {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  flex-shrink: 0;
}

.shift-progress__event .event-dur--live {
  color: #34d399;
}

/* ─── Action Buttons (2-column grid) ────────────────────── */
.timer-card .timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.timer-card .timer-actions .action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-m);
  padding: 12px 10px;
  cursor: pointer;
  transition: opacity var(--transition);
  min-height: 48px;
}

.timer-card .timer-actions .action-btn:active {
  opacity: 0.8;
}

/* Pause Button (idle state) */
.timer-card .action-btn--pause {
  background: var(--color-orange-light);
}

.timer-card .action-btn--pause svg {
  width: 16px;
  height: 16px;
  fill: var(--color-orange);
}

.timer-card .action-btn--pause span {
  font-size: var(--size-xxs);
  font-weight: var(--weight-l);
  color: var(--color-orange);
}

/* Projekt Button (idle state) */
.timer-card .action-btn--project {
  background: var(--color-accent-light);
}

.timer-card .action-btn--project svg {
  width: 16px;
  height: 16px;
  fill: var(--color-accent);
}

.timer-card .action-btn--project span {
  font-size: var(--size-xxs);
  font-weight: var(--weight-l);
  color: var(--color-accent);
}

/* ─── Start Button ──────────────────────────────────────── */
.timer-card .shift_start_button {
  width: 100%;
  background: var(--color-green);
  border: none;
  border-radius: var(--radius-l);
  padding: 14px 16px;
  margin-top: 16px;
  font-size: var(--size-s);
  font-weight: var(--weight-xl);
  color: white;
  cursor: pointer;
  transition:
    opacity var(--transition),
    transform var(--transition);
  min-height: 0;
  display: block;
}

.timer-card .shift_start_button:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* ─── Stop Button (shift_end_button) ────────────────────── */
.timer-card .shift_end_button {
  width: 100%;
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-l);
  padding: 14px 16px;
  margin-top: 16px;
  font-size: var(--size-s);
  font-weight: var(--weight-xl);
  color: var(--color-red);
  cursor: pointer;
  transition:
    opacity var(--transition),
    transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  min-height: 0;
}

.timer-card .shift_end_button:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* Hide stop icon in new design */
.timer-card .shift_end_button #shift_end_button_img {
  display: none;
}

/* ═══════════════════════════════════════════════════════════
   STATE: AKTIV (.timer-active)
   ═══════════════════════════════════════════════════════════ */

.timer-card.timer-active {
  background: var(--color-accent);
  box-shadow: 0 8px 32px rgba(26, 115, 200, 0.25);
}

.timer-card.timer-active .timer__time {
  color: white;
}

.timer-card.timer-active .timer__subtitle {
  color: rgba(255, 255, 255, 0.7);
}

/* Pause Info Box — Active */
.timer-card.timer-active .pause-info {
  background: rgba(255, 255, 255, 0.15);
}

.timer-card.timer-active .pause-info .pause-info__icon {
  background: rgba(255, 255, 255, 0.2);
}

.timer-card.timer-active .pause-info .pause-info__icon svg {
  stroke: white;
}

.timer-card.timer-active .pause-info .pause-info__title {
  color: white;
}

.timer-card.timer-active .pause-info .pause-info__time {
  color: rgba(255, 255, 255, 0.6);
}

/* Action Buttons — Active */
.timer-card.timer-active .action-btn--pause,
.timer-card.timer-active .action-btn--project {
  background: rgba(255, 255, 255, 0.2);
}

.timer-card.timer-active .action-btn--pause svg,
.timer-card.timer-active .action-btn--project svg {
  stroke: white;
}

.timer-card.timer-active .action-btn--pause span,
.timer-card.timer-active .action-btn--project span {
  color: white;
}

/* Stop Button — Active (sits OUTSIDE the blue area visually, 
   but inside the card DOM) */
.timer-card.timer-active .shift_end_button {
  background: var(--color-surface);
  color: var(--color-red);
}

/* ═══════════════════════════════════════════════════════════
   SECTIONS UNDER TIMER CARD
   ═══════════════════════════════════════════════════════════ */

/* Section Label */
.rec-section__label {
  font-size: var(--size-xxs);
  font-weight: var(--weight-xl);
  color: var(--color-darkgray);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
  width: 100%;
}

/* Arbeitszeit Card */
.rec-worktime-card {
  background: var(--color-surface);
  border-radius: var(--radius-l);
  padding: var(--space-m) var(--space-l);
  box-shadow: var(--shadow-One);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rec-worktime-card .worktime__time {
  font-size: var(--size-xs);
  font-weight: var(--weight-l);
  color: var(--color-black);
}

.rec-worktime-card .worktime__badge {
  background: var(--color-orange-light);
  color: var(--color-orange);
  border-radius: var(--radius-full);
  padding: 3px var(--space-s);
  font-size: var(--size-xxs);
  font-weight: var(--weight-l);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   Projekt Cards (grouped list)
   ═══════════════════════════════════════════════════════════ */

.rec-projects-list {
  background: var(--color-surface);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-One);
}

.rec-project-item {
  padding: var(--space-m) var(--space-l);
}

.rec-project-item + .rec-project-item {
  border-top: 0.5px solid #f3f4f6;
}

.rec-project-item .project-item__time {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rec-project-item .project-item__time-range {
  font-size: var(--size-xxs);
  font-weight: var(--weight-l);
  color: var(--color-accent);
}

.rec-project-item .project-item__badge {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-radius: var(--radius-full);
  padding: 2px var(--space-s);
  font-size: var(--size-xxs);
  font-weight: var(--weight-l);
}

.rec-project-item .project-item__name {
  font-size: var(--size-xs);
  font-weight: var(--weight-l);
  color: var(--color-black);
  margin-top: 2px;
}

.rec-project-item .project-item__meta {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}

.rec-project-item .project-item__meta svg {
  width: 9px;
  height: 9px;
  stroke: var(--color-muted);
  fill: none;
  flex-shrink: 0;
}

.rec-project-item .project-item__meta span {
  font-size: 8px;
  color: var(--color-muted);
}

/* ═══════════════════════════════════════════════════════════
   Active Project Card
   ═══════════════════════════════════════════════════════════ */

.rec-active-project {
  background: var(--color-surface);
  border-radius: var(--radius-l);
  padding: var(--space-m) var(--space-l);
  box-shadow: var(--shadow-One);
}

.rec-active-project .active-project__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.rec-active-project .active-project__since {
  font-size: var(--size-xxs);
  color: var(--color-green);
}

.rec-active-project .active-project__badge {
  background: var(--color-green-light);
  color: var(--color-green);
  border-radius: var(--radius-full);
  padding: 2px var(--space-s);
  font-size: var(--size-xxs);
  font-weight: var(--weight-l);
}

.rec-active-project .active-project__name {
  font-size: var(--size-xs);
  font-weight: var(--weight-l);
  color: var(--color-black);
}

.rec-active-project .active-project__meta {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}

.rec-active-project .active-project__meta svg {
  width: 9px;
  height: 9px;
  stroke: var(--color-muted);
  fill: none;
  flex-shrink: 0;
}

.rec-active-project .active-project__meta span {
  font-size: 8px;
  color: var(--color-muted);
}

.rec-active-project .active-project__end-btn {
  width: 100%;
  background: var(--color-red-light);
  border: none;
  border-radius: var(--radius-s);
  padding: var(--space-s);
  margin-top: var(--space-s);
  font-size: var(--size-xxs);
  font-weight: var(--weight-l);
  color: var(--color-red);
  cursor: pointer;
  transition: opacity var(--transition);
}

.rec-active-project .active-project__end-btn:active {
  opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════════
   Passiv utility (hide) — used by existing JS
   ═══════════════════════════════════════════════════════════ */
.passiv {
  display: none !important;
}

/* ─── Old card/button class overrides for record page ───── */
body[data-page="record"] .card {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}

body[data-page="record"] .card-header-Two,
body[data-page="record"] .card-content-Two,
body[data-page="record"] .card-footer-Two {
  display: none;
}

/* ─── Dynamically generated project cards (from JS) ─────── */
body[data-page="record"] #employeeRec .area .card-Two {
  background: var(--color-surface);
  border-radius: var(--radius-l);
  padding: var(--space-m) var(--space-l);
  box-shadow: var(--shadow-One);
  border: none;
  margin-bottom: 0;
}

body[data-page="record"] #employeeRec .area .card-Two + .card-Two {
  border-top: 0.5px solid #f3f4f6;
  border-radius: 0;
  box-shadow: none;
}

body[data-page="record"] #employeeRec .area .card-Two:first-of-type {
  border-radius: var(--radius-l) var(--radius-l) 0 0;
}

body[data-page="record"] #employeeRec .area .card-Two:last-of-type {
  border-radius: 0 0 var(--radius-l) var(--radius-l);
}

body[data-page="record"] #employeeRec .area .card-Two:only-of-type {
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-One);
}

body[data-page="record"] #employeeRec .card-Two .card-content-Two {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

body[data-page="record"] #employeeRec .card-Two h3.blue {
  font-size: var(--size-xxs);
  font-weight: var(--weight-l);
  color: var(--color-accent);
}

body[data-page="record"] #employeeRec .card-Two .block h3:not(.blue) {
  font-size: var(--size-xs);
  font-weight: var(--weight-l);
  color: var(--color-black);
}

/* ─── Noshadow helper (used by cloned activity boxes) ──── */
.noshadow {
  box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════
   Desktop adaptations
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .timer-card {
    max-width: 520px;
    margin: 0 auto;
  }

  .timer-card .timer__time {
    font-size: 3.5rem;
  }

  .rec-worktime-card,
  .rec-projects-list,
  .rec-active-project {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }

  body[data-page="record"] #employeeRec .area {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
}
