@import url('./index.css');

:root {
  --bg: #0d0c09;
  --txt: #fff2de;
  --surface: #161410;
  --raised: #1e1c17;
  --line: #fff2de11;
  --muted: #fff2de8a;
  --accent: #dffe96;
  --accent-muted: #dffe9620;
  --accent-bg: #dffe9610;
  --transparent: transparent;
  --sans: Inter, "Apple SD Gothic Neo", sans-serif;
  --mono: "Geist Mono", "Apple SD Gothic Neo", monospace;
  color-scheme: dark;
  font-family: var(--sans);
  font-feature-settings: 'liga' 1, 'calt' 1;
  font-synthesis: none;
  color: var(--txt);
  background: var(--bg);
}

@supports (font-variation-settings: normal) {
  :root { --sans: InterVariable, Inter, "Apple SD Gothic Neo", sans-serif; }
}

html, body { min-width: 320px; min-height: 100dvh; font-size: 1rem; line-height: 1.5; }
[hidden] { display: none !important; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: inherit; font-size: 1rem; cursor: pointer; transition: background 150ms, border-color 150ms; }
button:hover:not(:disabled) { background: var(--line); border-color: #fff2de40; }
button:disabled { opacity: .4; cursor: wait; }
button.primary { background: var(--raised); color: var(--txt);}
button.danger { color: #ffad9f; }
button.icon-button { width: 38px; height: 38px; padding: 0; flex-shrink: 0; }
svg { flex-shrink: 0; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
input, textarea { min-width: 0; width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--txt); font-size: 1rem; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #8f887d; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.app-header { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 25px 40px; background: linear-gradient(to bottom, var(--bg), var(--transparent)); }
.brand { display: flex; align-items: center; justify-self: start; min-width: 45px; }
.brand .logo { width: 5rem; height: 3rem; }
.header-actions { display: flex; justify-self: end; align-items: center; gap: 8px; }
.connection-dot { display: none; }
.header-sync { min-width: 38px; min-height: 38px; padding: 8px 10px; gap: 8px; white-space: nowrap; font-size: .85rem; font-weight:600; line-height: 1; font-variant-numeric: tabular-nums; }
.header-sync:disabled { opacity: 1; }
.sync-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; width: 18px; height: 18px; }
.header-sync[aria-busy=true] .sync-icon { animation: sync-rotate 1200ms linear infinite; }
@keyframes sync-rotate { to { transform: rotate(360deg); } }
/* Transitions.dev — Shimmer text */
.t-shimmer { --shimmer-dur: 2000ms; --shimmer-base: rgba(255, 242, 222, .41); --shimmer-highlight: var(--txt); --shimmer-band: 400%; --shimmer-ease: linear; position: relative; display: inline-block; color: var(--shimmer-base); }
.t-shimmer::before { content: attr(data-text); position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(90deg,transparent 0%,transparent 40%,var(--shimmer-highlight) 50%,transparent 60%,transparent 100%); background-size: var(--shimmer-band) 100%; background-repeat: no-repeat; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: t-shimmer var(--shimmer-dur) var(--shimmer-ease) infinite; }
@keyframes t-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0% 0; } }
.header-sync[aria-busy=false] .t-shimmer { color: var(--txt); }
.header-sync[aria-busy=false] .t-shimmer::before { animation: none; visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .t-shimmer::before,.header-sync .sync-icon { animation: none !important; } .t-shimmer { color: var(--txt); } }

/* Transitions.dev free tabs-sliding, menu-dropdown, and panel-reveal recipes.
   https://github.com/Jakubantalik/transitions.dev/tree/main/cli/free */
.tab-slider { position: relative; display: flex; align-items: center; gap: 3px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 10rem; background: var(--transparent); backdrop-filter: blur(.5rem); }
.tab-slider a { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 8px 20px; border-radius: 10px; color: var(--muted); font-size: 1rem; white-space: nowrap; }
.tab-slider a[aria-current=page] { color: var(--txt); }
.tab-slider .slider-pill { position: absolute; left: 0; top: 5px; height: calc(100% - .6rem); border: 1px solid #fff2de13; border-radius: 10rem; background: #fff2de12; pointer-events: none; transition: transform 250ms cubic-bezier(.22,1,.36,1), width 250ms cubic-bezier(.22,1,.36,1); }
main {margin: auto; padding: 18px 1.5rem 110px; }
.page-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 25px; }
.page-toolbar h1 { font-size: 1.125rem; font-weight: 550; letter-spacing: -.035em; }
.toolbar-group { display: flex; align-items: center; gap: 10px; }
.week-label { min-width: 110px; padding: 8px 10px; border: 0; background: transparent; font-size: 1rem; font-weight: 500; text-align: center; }
.button-group { display: flex; align-items: center; gap: 5px; }
.page-panel { animation: panel-in 280ms cubic-bezier(.22,1,.36,1); }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.task-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(290px,1fr)); align-items: stretch; gap: 18px; }
.task-card { position: relative; display: flex; flex-direction: column; gap: 16px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; transition: background 180ms, border-color 180ms, transform 180ms; }
.task-card:hover { background: #1b1914; border-color: #fff2de34; transform: translateY(-2px); }
.task-card.is-extra-credit, .calendar-assignment.is-extra-credit { isolation: isolate; overflow: hidden; background: var(--transparent); }
.is-extra-credit::before { content: ''; position: absolute; z-index: -1; inset: -55%; pointer-events: none; background: radial-gradient(ellipse at 68% 30%, #da66bf40 0%, transparent 24%), radial-gradient(ellipse at 24% 65%, #61bda331 0%, transparent 26%), conic-gradient(from 210deg at 45% 52%, transparent 0deg, #608bcb38 38deg, #b5a47526 63deg, transparent 88deg, transparent 172deg, #d9866840 208deg, #a274cf38 234deg, transparent 263deg); filter: blur(13px); transform: translate3d(-3%, 4%, 0) rotate(-16deg); animation: extra-credit-shimmer 12s ease-in-out infinite alternate; }
.task-card.is-extra-credit:hover, .calendar-assignment.is-extra-credit:hover { border-color: #c8aec15c; }
@keyframes extra-credit-shimmer { 0% { transform: translate3d(-3%, 4%, 0) rotate(-16deg) scale(1); } 50% { transform: translate3d(5%, -2%, 0) rotate(3deg) scale(1.06); } 100% { transform: translate3d(-1%, -5%, 0) rotate(18deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .is-extra-credit::before { animation: none; } }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.course-label { display: inline-flex; align-items: center; gap: 8px; color: var(--course,#b9a0ff); font-size: .8rem; letter-spacing: .015em; }
.category-label { color: var(--muted); font-size: .8rem; }
.task-card h2 { font-size: 1.3rem; font-weight: 600; line-height: 1.45; letter-spacing: -.005em; overflow-wrap: anywhere; }
.task-card.is-complete h2 { color: #b0a99c; }
.card-period { display: grid; gap: 5px; margin-top: auto; color: var(--muted); font-size: .875rem; }
.card-period p { display: flex; align-items: center; gap: 7px; }
.card-period p, .card-period p * { font-size: inherit; }
.card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .8rem; }
.status-chip.done { color: #a9c89e; }
.status-chip.doing { color: #d6bda0; }
.grade-chip { color: var(--txt); font: .8rem var(--mono); }
.task-card .view-task { width: 100%; margin-top: 2px; border-color: #fff2de21; background: transparent; }
.empty-result { grid-column: 1/-1; padding: 75px 20px; text-align: center; color: var(--muted); }
.calendar-board :is(.calendar-board-date,.calendar-board-today,.calendar-board-empty,.calendar-assignment-course,.calendar-assignment-category,.calendar-assignment-period,.calendar-assignment-status) { font-size: .8rem; }

.floating-filter { position: fixed; bottom: 25px; left: 50%; z-index: 35; max-width: calc(100vw - 30px); padding: 6px; border: 1px solid #fff2de26; border-radius: 10rem; background: var(--transparent); box-shadow: 0 12px 40px #0009; backdrop-filter: blur(.5rem); -webkit-backdrop-filter: blur(.5rem); transform: translateX(-50%); }
.dock-controls { display: flex; align-items: center; gap: 4px; }
.dock-controls > button { border: 0; border-radius: 10rem; background: transparent; color: var(--muted); padding: 10px 17px; font-size: .875rem; white-space: nowrap; }
.dock-controls > button.active { background: #fff2de14; color: var(--txt); }
.dock-controls > button svg { transition: transform 250ms cubic-bezier(.22,1,.36,1); }
.dock-controls > button[aria-expanded=true] svg { transform: rotate(-90deg); }
.popover { position: absolute; z-index: 50; min-width: 170px; padding: 6px; border: 1px solid #fff2de26; border-radius: 1rem; background: var(--surface); box-shadow: 0 14px 40px #0004; transform-origin: bottom center; animation: menu-in 250ms cubic-bezier(.22,1,.36,1); }
.popover button { display: flex; justify-content: space-between; width: 100%; padding: 9px 12px; border: 0; background: transparent; text-align: left; }
.popover button[aria-checked=true] { color: var(--accent); background: var(--accent-muted); }
.filter-menu { bottom: calc(100% + 10px); left: 0; }
.filter-menu .filter-subcategory { padding-left: 24px; color: var(--muted); }
.calendar-course-menu { right: 0; top: calc(100% + 8px); transform-origin: top right; }
.calendar-course-control { position: relative; }
@keyframes menu-in { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: none; } }
.toast { position: fixed; z-index: 100; top: 92px; left: 50%; max-width: min(580px,calc(100vw - 30px)); padding: 11px 18px; border: 1px solid #fff2de26; border-radius: 12px; background: #29251e; box-shadow: 0 10px 30px #0007; transform: translateX(-50%); }
.toast:empty { display: none; }
.toast[data-error=true] { color: #ffb4a7; border-color: #e4908040; }

dialog { max-width: none; width: min(820px,calc(100vw - 32px)); max-height: calc(100dvh - 64px); margin: auto; padding: 0; border: 1px solid #fff2de28; border-radius: 22px; background: var(--surface); color: var(--txt); box-shadow: 0 30px 120px #000b; overflow: auto; }
dialog::backdrop { background: #0009; backdrop-filter: blur(8px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 1rem 1.25rem; }
.modal-header h2 { font-size: 1.75rem; font-weight: 600; line-height: 1.4; letter-spacing: -.035em; }
.modal-header .modal-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; color: var(--accent); font-size: .875rem; }
.modal-header .icon-button { border: 0; background: transparent; }
.modal-content { padding: 0 1.25rem; }
.modal-period { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.modal-period dt { margin-bottom: 4px; color: var(--muted); font-size: .875rem; }
.modal-period dd { font-size: .9375rem; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.form-grid { display: grid; gap: 16px; }
.form-grid label { display: grid; gap: 7px; color: var(--muted); font-size: .875rem; }
.form-grid fieldset { display: flex; flex-wrap: wrap; gap: 6px; border: 0; }
.form-grid legend { margin-bottom: 7px; }
.form-grid button[aria-pressed=true] { background: #fff2de15; color: var(--txt); }

@media (max-width: 760px) {
  .app-header { padding: 1.5rem; gap: 12px; grid-template-columns: 1fr auto; }
  .tab-slider { grid-row: 2; grid-column: 1 / -1; justify-self: center; }
  .header-actions { grid-row: 1; grid-column: 2; }
  .brand .logo { width: 4.1rem; height: 2.5rem; margin-left: .5rem; }
  .tab-slider a { padding: 8px 14px; }
  .tab-slider a svg, .header-actions .connection-dot { display: none; }
  main { padding: 0 1rem 5.5rem 1rem; }
  .page-toolbar { gap: 10px; }
  .week-label { min-width: 104px; }
  .floating-filter { bottom: 16px; }
  .dock-controls > button { padding: 10px 12px; }
  .task-grid { grid-template-columns: repeat(auto-fill,minmax(265px,1fr)); }
  .modal-header { padding: 20px 20px 16px; }
  .modal-content { padding: 0 20px 20px; }
  .modal-header h2 { font-size: 1.25rem; }
  .modal-period { gap: 16px; }
}
@media (max-width: 450px) {
  .app-header { grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .brand .logo { width: 4rem; }
  .header-actions { display: flex; }
  .tab-slider a { padding: 8px 10px; font-size: .875rem; }
  .dock-controls > button { padding: 9px 8px; gap: 4px; font-size: .8rem; }
  .task-grid { grid-template-columns: 1fr; }
  .task-card { padding: 19px; }
  .modal-period { display: grid; grid-template-columns: 1fr 1fr; }
  .calendar-course-control > button { padding: 8px; }
  .page-toolbar .toolbar-group { gap: 4px; }
  .week-label { min-width: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media(max-width:600px){.dock-controls{max-width:calc(100vw - 44px);overflow-x:auto;scrollbar-width:thin;scrollbar-color:#fff2de20 transparent}.dock-controls>button{flex-shrink:0}}
