:root {
  --bg-main: #f4f7fb;
  --bg-card: #ffffff;
  --bg-soft: #f3f4f6;
  --bg-badge: #e0ecff;

  --text-main: #111827;
  --text-normal: #1f2937;
  --text-muted: #6b7280;

  --primary: #5c71cc81;
  --primary-soft: #dbeafe;
  --primary-text: #ffffff;

  --success-bg: #dcfce7;
  --success-text: #15803d;

  --warning-bg: #fef3c7;
  --warning-text: #b45309;

  --border-color: #e5e7eb;
  --card-border: #eef2f7;
  --button-dark: #111827;
  --disabled: #9ca3af;

  --shadow-card: 0 12px 35px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 18px 45px rgba(0, 0, 0, 0.12);
  --shadow-small: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.dark-theme {
  --bg-main: #020617;
  --bg-card: #0f172a;
  --bg-soft: #1e293b;
  --bg-badge: rgba(37, 99, 235, 0.18);

  --text-main: #f8fafc;
  --text-normal: #e5e7eb;
  --text-muted: #94a3b8;

  --primary: #6063fa;
  --primary-soft: rgba(96, 165, 250, 0.18);
  --primary-text: #020617;

  --success-bg: rgba(34, 197, 94, 0.16);
  --success-text: #86efac;

  --warning-bg: rgba(245, 158, 11, 0.16);
  --warning-text: #fbbf24;

  --border-color: #1e293b;
  --card-border: #1e293b;
  --button-dark: #341eaf;
  --disabled: #475569;

  --shadow-card: 0 18px 45px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-small: 0 14px 35px rgba(0, 0, 0, 0.28);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-normal);
  min-height: 100vh;
}

.page-wrapper {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

header {
  padding: 40px 0 30px;
  text-align: center;
}

.profile-badge {
  display: inline-block;
  padding: 8px 16px;
  background: var(--bg-badge);
  color: var(--primary);
  border-radius: 999px;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 16px;
}

h1 {
  font-size: 42px;
  margin-bottom: 12px;
  color: var(--text-main);
}

.header-text {
  max-width: 650px;
  margin: 0 auto;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 17px;
}

.stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.stat-box {
  background: var(--bg-card);
  padding: 18px 30px;
  border-radius: 18px;
  box-shadow: var(--shadow-small);
  border: 1px solid var(--card-border);
  min-width: 150px;
}

.stat-box h2 {
  color: var(--primary);
  font-size: 28px;
  margin-bottom: 4px;
}

.stat-box p {
  color: var(--text-muted);
  font-size: 14px;
}

main {
  padding: 30px 0 60px;
}

.section-title {
  font-size: 26px;
  margin-bottom: 22px;
  color: var(--text-main);
}

.homework-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.homework-card {
  background: var(--bg-card);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--card-border);
  transition: 0.3s;
}

.homework-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card-hover);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--primary-text);
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
}

.status {
  padding: 6px 12px;
  background: var(--success-bg);
  color: var(--success-text);
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
}

.status.working {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.homework-card.loading {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
}

.homework-card.loading::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(96, 165, 250, 0.12),
    transparent
  );
  animation: loadingMove 1.8s infinite;
}

@keyframes loadingMove {
  from {
    left: -100%;
  }

  to {
    left: 100%;
  }
}

.loading-icon {
  width: 24px;
  height: 24px;
  border: 3px solid var(--primary-soft);
  border-top: 3px solid var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 22px;
}

.progress-fill {
  width: 45%;
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}

.homework-card h3 {
  font-size: 21px;
  margin-bottom: 10px;
  color: var(--text-main);
}

.homework-card p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
  font-size: 15px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.tag {
  background: var(--bg-soft);
  color: var(--text-normal);
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.view-btn {
  text-decoration: none;
  color: white;
  background: var(--button-dark);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: bold;
  transition: 0.3s;
}

.view-btn:hover {
  background: var(--primary);
  color: var(--primary-text);
}

.view-btn.disabled {
  background: var(--disabled);
  cursor: not-allowed;
  pointer-events: none;
}

footer {
  text-align: center;
  padding: 25px 0;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

@media (max-width: 950px) {
  .homework-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  h1 {
    font-size: 34px;
  }
}

@media (max-width: 620px) {
  .homework-grid {
    grid-template-columns: 1fr;
  }

  header {
    padding-top: 30px;
  }

  h1 {
    font-size: 30px;
  }

  .header-text {
    font-size: 15px;
  }

  .stat-box {
    width: 100%;
  }

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

  .view-btn {
    width: 100%;
    text-align: center;
  }
}
