/* --------------------------
   Work Day Schedule Styles
   -------------------------- */

/* CSS Variables for easy theming */
:root{
  --bg: #0e0f12;
  --panel: #151821;
  --text: #e8ecf1;
  --muted: #a7b0bd;
  --border: #2a2f3a;
  --past: #cfd3d8;   /* grey */
  --present: #ef6461;/* red-ish */
  --future: #74c69d; /* green */
  --focus: #6ea8fe;
  --button: #1f6feb;
  --button-hover: #195ec7;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1000px 800px at 10% 0%, #151821 0%, #0e0f12 60%) fixed;
}

/* Layout wrappers */
.wrap{
  width: min(1100px, 92vw);
  margin-inline: auto;
}

/* Header */
.app-header{
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
  padding: 22px 0 18px;
  position: sticky;
  top: 0;
  background: linear-gradient(180deg, rgba(14,15,18,.9), rgba(14,15,18,.75));
  z-index: 10;
}
.app-header h1{
  margin: 0 0 6px;
  font-size: clamp(22px, 2.5vw, 34px);
  letter-spacing: .3px;
}
.subhead{
  margin: 0;
  color: var(--muted);
}

.view-saved-link {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #258aff, #1b5fff);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 138, 255, 0.4);
  transition: all 0.25s ease-in-out;
}

.view-saved-link:hover {
  background: linear-gradient(180deg, #3b9aff, #3272ff);
  box-shadow: 0 6px 16px rgba(37, 138, 255, 0.55);
  transform: translateY(-2px);
}

.view-saved-link:active {
  transform: translateY(0);
}

.saved-link-wrapper {
  text-align: center;
  margin-top: 12px;
}


/* Footer */
.app-footer{
  border-top: 1px solid var(--border);
  color: var(--muted);
  margin-top: 28px;
  padding: 18px 0 26px;
}

/* Grid headings */
.grid{
  display: grid;
  grid-template-columns: 120px 1fr 74px;
  gap: 0;
  align-items: center;
}
.grid-header{
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .3px;
  margin-top: 18px;
  padding: 6px 10px;
}
.grid-header .col{
  opacity: .85;
}

/* Schedule rows */
.schedule{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--panel);
}

.row{
  display: grid;
  grid-template-columns: 120px 1fr 74px;
  min-height: 78px;
  border-top: 1px solid var(--border);
}
.row:first-child{ border-top: 0; }

.time-cell{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-right: 1px solid var(--border);
  font-weight: 600;
  color: #d7dde6;
  background: linear-gradient(180deg, #171b23, #141823);
}

.event-cell{
  padding: 12px;
  display: flex;
  align-items: stretch;
  background: transparent;
}

.event-input{
  width: 100%;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  padding: 14px 12px;
  border-radius: 12px;
  outline: 2px solid transparent;
  transition: outline-color .15s ease, background-color .2s ease;
}
.event-input::placeholder{ color: #9a9fad; }

/* Save button (lock) */
.action-cell{
  border-left: 1px solid var(--border);
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #171b23, #141823);
}
.save-btn{
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f1420;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .2s ease;
}
.save-btn:hover{ background: #121a29; }
.save-btn:active{ transform: scale(.97); }
.save-btn:focus-visible{
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* SVG icon */
.save-btn svg{
  width: 22px; height: 22px;
  fill: #9fb3c8;
}

/* State colors for event cell background */
.row.past .event-cell   { background: #d7dbe0; }
.row.past .event-input  { color: #1c212b; }
.row.present .event-cell{ background: #ef6461; }
.row.future .event-cell { background: #74c69d; }

/* Give editable field a subtle surface so text is readable on all states */
.row.past   .event-input,
.row.present .event-input,
.row.future .event-input{
  background: rgba(0,0,0,.08);
}


.event-input:focus-visible{
  outline-color: var(--focus);
  background: rgba(0,0,0,.12);
}


.tips{
  color: var(--muted);
  font-size: 14px;
  margin: 14px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  justify-content: center;
  text-align: center;
  max-width: 800px;
}
.legend{
  display: inline-block;
  width: 16px; height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.legend.past{ background: var(--past); }
.legend.present{ background: var(--present); }
.legend.future{ background: var(--future); }

@media (max-width: 720px){
  .grid, .row{
    grid-template-columns: 84px 1fr 64px;
  }
  .time-cell{ font-size: 14px; }
  .event-input{ font-size: 15px; }
}

.toast {
  position: fixed;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  background: #2ecc71;
  color: #fff;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  transition: top 0.3s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
  z-index: 9999;
}

.toast.show {
  top: 20px;
  opacity: 1;
}

/* Save button flash */
.save-btn.flash {
  background: #2ecc71 !important;
  transition: background 0.4s ease;
}

.page-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 10px;
  justify-content: center;          
}

.btn-link {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  border: 2px solid #2a7fff;        
  background: linear-gradient(180deg, #258aff, #1b5fff);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(37,138,255,.3);
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}

.btn-link:hover {
  background: linear-gradient(180deg, #3b9aff, #3272ff);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(37,138,255,.4);
}

.btn-link:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(37,138,255,.4);
}

/* Empty message on saved page */
.empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 10px;
}

/* Saved rows layout */
.saved-rows .row {
  grid-template-columns: 160px 1fr;
}

.saved-rows .event-cell {
  background: transparent;
}
      .page-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin: 16px 0 8px;
      }
      .btn-link {
        display: inline-block;
        padding: 10px 14px;
        border-radius: 10px;
        border: 1px solid var(--border);
        background: #0f1420;
        color: var(--text);
        text-decoration: none;
      }
      .btn-link:hover {
        background: #121a29;
      }
      .empty {
        color: var(--muted);
        text-align: center;
        padding: 28px 10px;
      }
      .saved-rows .row {
        grid-template-columns: 160px 1fr;
      }
      .saved-rows .event-cell {
        background: transparent;
      }
      