:root {
  --bg: #fafafa;
  --text: #222;
  --card: #ffffff;
  --primary: #0077cc;
}

body.dark {
  --bg: #121212;
  --text: #eee;
  --card: #1e1e1e;
  --primary: #4da3ff;
}

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 1rem;
  max-width: 900px;
  margin-inline: auto;
}

/* HEADER */
header {
  background: var(--primary);
  color: white;
  padding: 1rem;
  text-align: center;
  border-radius: 6px;
}

/* SUBJECTS */
#subjects {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.subject-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.subject-btn.active {
  background: var(--primary);
  color: white;
}

/* TOP BAR */
.top-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.top-bar input {
  flex: 1;
  padding: 0.4rem;
}

/* SECTIONS */
.resource-section {
  margin-bottom: 2rem;
}

.resource-list a {
  display: block;
  color: var(--primary);
  margin-bottom: 0.3rem;
  text-decoration: none;
}

/* PAPERS */
.paper-item {
  background: var(--card);
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.paper-actions button,
.paper-actions a {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.8rem;
}

.paper-actions button:last-child {
  background: transparent;
  color: gold;
}

/* VIEWER */
#paper-viewer {
  margin-top: 1rem;
  background: var(--card);
  padding: 0.5rem;
  border-radius: 4px;
}

.pdf-frame {
  width: 100%;
  height: 600px;
  border: none;
}

/* VIDEOS */
iframe {
  width: 100%;
  max-width: 560px;
  height: 315px;
}

/* MOBILE */
@media (max-width: 600px) {
  .paper-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .top-bar {
    flex-direction: column;
  }
}
.app-footer {
  margin-top: 3rem;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: #666;
  border-top: 1px solid #ddd;
  background-color: transparent;
}

.app-footer a {
  color: #0077cc;
  text-decoration: none;
  font-weight: bold;
}

.app-footer a:hover {
  text-decoration: underline;
}

body.dark .app-footer {
  color: #aaa;
  border-top-color: #333;
}

body.dark .app-footer a {
  color: #4da3ff;
}
.install-btn {
  display: block;
  margin: 1rem auto;
  padding: 0.6rem 1.2rem;
  background-color: #0077cc;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.install-btn:hover {
  background-color: #005fa3;
}
.cache-status {
  text-align: center;
  background-color: #e0f0ff;
  color: #0077cc;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

body.dark .cache-status {
  background-color: #1e1e2a;
  color: #4da3ff;
}
