:root {
  --bg: #f2f2f7;
  --card: #ffffff;
  --primary: #007aff;
  --text: #1c1c1e;
  --secondary: #8e8e93;
  --today: #e5f0ff;

  --slide-animation-time: 0.5s;
}

* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 16px;
  text-align: center;
  background: var(--card);
  border-bottom: 1px solid #ddd;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

main {
  padding: 16px;
}

.day-card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.day-card.today {
  background: var(--today);
  border: 1px solid var(--primary);
}

.day-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.lesson {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.lesson-time {
  color: var(--secondary);
}

.filters {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.filter:last-child {
  margin-bottom: 0;
}

label {
  font-size: 13px;
  color: var(--secondary);
  margin-bottom: 4px;
}

select {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #d1d1d6;
  background: #fff;
  font-size: 15px;
}

.week-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.week-selector button {
  border: none;
  background: none;
  font-size: 20px;
  color: var(--primary);
  padding: 4px 10px;
}

#weekLabel {
  font-weight: 600;
  font-size: 15px;
}

/* Week label animation */
.week-label-wrapper {
  overflow: hidden;
  position: relative;
  flex: 1;
  text-align: center;
}

#weekLabel {
  display: inline-block;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Schedule animation */
.schedule-animate {
  animation: slideFade 0.25s ease;
}

@keyframes slideFade {
  from {
    opacity: 0;
    transform: translateX(var(--slide-dir));
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Swipe container */
.schedule-swipe {
  position: relative;
  overflow: hidden;
}

/* panels */
.schedule-panel {
  width: 100%;
}

/* only animating panels are absolute */
.schedule-panel.animating {
  position: absolute;
  top: 0;
  left: 0;
}

.schedule-panel.animating.old {
  position: relative;
}


/* Animations */
.slide-in-right {
  animation: slideInRight var(--slide-animation-time) ease-out forwards;
}

.slide-in-left {
  animation: slideInLeft var(--slide-animation-time) ease-out forwards;
}

.slide-out-left {
  animation: slideOutLeft var(--slide-animation-time) ease-out forwards;
}

.slide-out-right {
  animation: slideOutRight var(--slide-animation-time) ease-out forwards;
}

@keyframes slideInRight {
  from { transform: translateX(120%); }
  to   { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-120%); }
  to   { transform: translateX(0); }
}

@keyframes slideOutLeft {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}

.lesson {
  display: block;
  padding: 10px 0;
  border-top: 1px solid #e5e5ea;
}

.lesson:first-of-type {
  border-top: none;
}

.lesson-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
}

.lesson-meta {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--secondary);
  margin-bottom: 4px;
}

.lesson-teacher {
  font-size: 13px;
  color: var(--secondary);
}

/* Skeleton loader */

.skeleton .day-card {
  background: var(--card);
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(
    90deg,
    #e5e5ea 25%,
    #f2f2f7 37%,
    #e5e5ea 63%
  );
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
  margin-bottom: 10px;
}

.skeleton-title {
  height: 18px;
  width: 60%;
}

.skeleton-line.short {
  width: 40%;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* Empty week card */

.empty-week {
  text-align: center;
  padding: 32px 16px;
}

.empty-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-subtitle {
  font-size: 14px;
  color: var(--secondary);
}

/* === Custom down arrow for select === */
.filter select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'>\
<path d='M1 1l5 5 5-5' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/>\
</svg>");

  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;

  padding-right: 36px; /* space for arrow */
}
