/* study-planner.css */

:root {
  --sp-bg-1: #e0f2fe;
  --sp-bg-2: #cffafe;
  --sp-text-main: #020617;
  --sp-text-muted: rgba(15, 23, 42, 0.72);
  --sp-card: rgba(255, 255, 255, 0.98);
  --sp-border-soft: rgba(148, 163, 184, 0.7);
  --sp-accent: #2563eb;
  --sp-accent-soft: #dbeafe;
  --sp-accent-strong: #1d4ed8;
  --sp-radius-lg: 26px;
  --sp-radius-md: 18px;
  --sp-radius-pill: 999px;
  --sp-shadow-soft: 0 20px 60px rgba(15, 23, 42, 0.28);
  --sp-shadow-small: 0 14px 32px rgba(15, 23, 42, 0.16);
  --sp-transition-fast: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --sp-transition-med: 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* RESET */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  color: var(--sp-text-main);
}

/* BACKGROUND */

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 0% 0%, #e0f2fe 0, transparent 46%),
    radial-gradient(circle at 100% 100%, #a5f3fc 0, transparent 40%),
    linear-gradient(135deg, var(--sp-bg-1) 0%, #e0f2fe 40%, var(--sp-bg-2) 100%);
  filter: saturate(1.05);
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.2),
      transparent 35%,
      rgba(15, 23, 42, 0.25)
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.22),
      rgba(255, 255, 255, 0.22) 1px,
      transparent 1px,
      transparent 2px
    );
  mix-blend-mode: soft-light;
  opacity: 0.7;
  pointer-events: none;
}

/* LAYOUT */

.sp-container {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

.sp-main {
  padding-bottom: 60px;
}

.sp-section {
  padding: 70px 0;
}

/* HEADER */

.sp-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.97),
    rgba(255, 255, 255, 0.9)
  );
  border-bottom: 1px solid rgba(255, 255, 255, 0.96);
}

.sp-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 10px;
  gap: 16px;
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-logo-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 0 0, #bfdbfe, #2563eb);
  font-weight: 800;
  letter-spacing: -0.08em;
  color: #eff6ff;
  font-size: 0.9rem;
}

.sp-brand-name {
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.06em;
}

.sp-brand-tagline {
  font-size: 0.8rem;
  color: var(--sp-text-muted);
}

.sp-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-header-pill {
  border-radius: var(--sp-radius-pill);
  padding: 4px 10px;
  font-size: 0.8rem;
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.5);
  color: rgba(30, 64, 175, 0.96);
}

/* HERO */

.sp-hero {
  padding: 70px 0 40px;
}

.sp-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1.05fr);
  gap: 32px;
  align-items: center;
}

.sp-hero-kicker {
  margin: 0 0 10px;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(15, 23, 42, 0.8);
}

.sp-hero-title {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 3vw, 3rem);
  letter-spacing: -0.06em;
}

.sp-hero-highlight {
  background: linear-gradient(120deg, #1d4ed8, #22c55e);
  -webkit-background-clip: text;
  color: transparent;
}

.sp-hero-subtitle {
  margin: 0 0 16px;
  font-size: 1.02rem;
  color: var(--sp-text-muted);
}

.sp-hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sp-pill {
  border-radius: var(--sp-radius-pill);
  padding: 5px 11px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.6);
}

/* HERO CARD */

.sp-hero-card {
  background: var(--sp-card);
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.96);
  overflow: hidden;
}

.sp-hero-card-header {
  padding: 10px 14px;
  background: linear-gradient(
    to right,
    rgba(15, 23, 42, 0.14),
    rgba(15, 23, 42, 0)
  );
}

.sp-hero-card-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--sp-radius-pill);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(37, 99, 235, 0.9);
  color: rgba(30, 64, 175, 0.96);
}

.sp-hero-card-body {
  padding: 16px 16px 18px;
}

.sp-hero-steps {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 0.9rem;
  color: var(--sp-text-muted);
}

.sp-hero-steps li + li {
  margin-top: 4px;
}

.sp-hero-note {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(15, 23, 42, 0.8);
}

/* SHELL */

.sp-shell {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow: var(--sp-shadow-soft);
  padding: 20px 20px 22px;
}

.sp-shell-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr);
  gap: 20px;
}

/* FORM SIDE */

.sp-form-side {
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  padding-right: 14px;
}

.sp-heading {
  margin: 0 0 4px;
  font-size: 1.18rem;
  letter-spacing: -0.04em;
}

.sp-subheading {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.sp-subtext {
  margin: 2px 0 10px;
  font-size: 0.9rem;
  color: var(--sp-text-muted);
}

.sp-form {
  margin-top: 8px;
  display: grid;
  gap: 14px;
}

.sp-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.sp-form-row-stack {
  align-items: flex-start;
}

.sp-field {
  display: grid;
  gap: 4px;
}

.sp-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(15, 23, 42, 0.9);
}

.sp-input,
.sp-select {
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.85);
  padding: 10px 12px;
  height: 44px;
  line-height: 1.2;
  font-size: 0.92rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.98);
}

.sp-select {
  /* remove native arrow and add a consistent SVG caret */
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path fill='none' stroke='%2322262a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.sp-input:focus,
.sp-select:focus {
  outline: none;
  border-color: var(--sp-accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.45);
}

.sp-field-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--sp-text-muted);
}

/* RADIO GROUP */

.sp-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sp-radio {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: var(--sp-radius-pill);
  padding: 4px 9px;
  font-size: 0.8rem;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.6);
  cursor: pointer;
}

.sp-radio input {
  accent-color: var(--sp-accent);
}

/* SUBJECTS */

.sp-subjects-block {
  margin-top: 10px;
  padding: 10px 10px 12px;
  border-radius: 18px;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.sp-subjects-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.sp-subject-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.sp-subject-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 6px 8px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.sp-subject-row input[type="text"] {
  width: 100%;
}

.sp-priority-pill {
  font-size: 0.78rem;
  border-radius: var(--sp-radius-pill);
  padding: 2px 8px;
  background: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: rgba(30, 64, 175, 0.9);
}

/* BUTTONS */

.sp-btn-primary,
.sp-btn-outline,
.sp-btn-ghost {
  border-radius: var(--sp-radius-pill);
  border: 1px solid transparent;
  padding: 7px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--sp-transition-fast), color var(--sp-transition-fast),
    box-shadow var(--sp-transition-fast), transform var(--sp-transition-fast),
    border-color var(--sp-transition-fast);
}

.sp-btn-primary {
  background: linear-gradient(135deg, #2563eb, #22c55e);
  color: #f9fafb;
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.5);
}

.sp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.6);
}

.sp-btn-outline {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(37, 99, 235, 0.7);
  color: rgba(30, 64, 175, 0.96);
}

.sp-btn-outline:hover {
  background: rgba(219, 234, 254, 0.96);
  transform: translateY(-1px);
}

.sp-btn-ghost {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(226, 232, 240, 0.96);
  color: rgba(15, 23, 42, 0.86);
  padding-inline: 11px;
  font-size: 0.82rem;
}

.sp-btn-ghost:hover {
  background: rgba(226, 232, 240, 0.9);
}

/* FORM FOOTER */

.sp-form-footer {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sp-error {
  margin: 0;
  font-size: 0.82rem;
  color: #b91c1c;
}

/* OUTPUT SIDE */

.sp-output-side {
  padding-left: 10px;
}

.sp-output-empty {
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.98),
    rgba(219, 234, 254, 0.95)
  );
  border-radius: var(--sp-radius-md);
  padding: 14px 14px 16px;
  border: 1px solid rgba(148, 163, 184, 0.65);
  box-shadow: var(--sp-shadow-small);
  font-size: 0.94rem;
  color: var(--sp-text-muted);
}

.sp-output-empty h2 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.sp-output-empty ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.sp-output-empty li + li {
  margin-top: 2px;
}

.sp-output {
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--sp-radius-md);
  padding: 12px 14px 14px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  box-shadow: var(--sp-shadow-small);
}

.sp-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sp-output-meta {
  margin: 2px 0 0;
  font-size: 0.82rem;
  color: var(--sp-text-muted);
}

.sp-output-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sp-summary {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(219, 234, 254, 0.96),
    rgba(239, 246, 255, 0.98)
  );
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-size: 0.86rem;
  color: rgba(30, 64, 175, 0.98);
}

/* SUMMARY TABLE */

.sp-summary-table-wrap {
  margin-bottom: 12px;
}

.sp-summary-heading {
  margin: 0 0 4px;
  font-size: 0.94rem;
  letter-spacing: -0.02em;
}

.sp-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.sp-summary-table th,
.sp-summary-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.sp-summary-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.82rem;
  color: rgba(15, 23, 42, 0.9);
}

.sp-summary-table tr:last-child td {
  border-bottom: none;
}

/* DAY CARDS */

.sp-days-wrap {
  margin-top: 4px;
}

.sp-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.sp-day-card {
  border-radius: 14px;
  padding: 7px 8px 9px;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.98),
    rgba(219, 234, 254, 0.95)
  );
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.82rem;
}

.sp-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.sp-day-name {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sp-day-total {
  font-size: 0.76rem;
  color: var(--sp-text-muted);
}

.sp-day-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 2px;
}

.sp-day-list li {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.sp-day-subject {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-day-hours {
  font-weight: 600;
}

.sp-day-card.is-today {
  border-color: rgba(37, 99, 235, 0.9);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6);
}

/* FOOTER */

.sp-footer {
  padding: 18px 0 22px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.sp-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.84rem;
  color: rgba(15, 23, 42, 0.86);
}

/* UTIL */

.sp-hidden {
  display: none !important;
}

/* RESPONSIVE */

@media (max-width: 960px) {
  .sp-hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sp-shell-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sp-form-side {
    border-right: none;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    padding-right: 0;
    padding-bottom: 12px;
    margin-bottom: 10px;
  }

  .sp-output-side {
    padding-left: 0;
  }
}

@media (max-width: 640px) {
  .sp-section {
    padding: 60px 0;
  }

  .sp-hero-title {
    font-size: 2.1rem;
  }

  .sp-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .sp-form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .sp-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* PRINT */

@media print {
  body::before,
  body::after,
  .sp-header,
  .sp-hero,
  .sp-form-side,
  .sp-footer {
    display: none !important;
  }

  body {
    background: #ffffff;
  }

  .sp-main {
    padding: 0;
  }

  .sp-section {
    padding: 0;
  }

  .sp-shell {
    box-shadow: none;
    border: none;
    padding: 0;
  }

  .sp-output-side {
    padding: 0;
  }

  .sp-output {
    box-shadow: none;
    border: none;
  }

  .sp-days-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
