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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f8fc;
    color: #1e293b;
}

a {
    text-decoration: none;
}

/* Messages */
.message {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 15px;
    font-weight: bold;
}

.error-message {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.success-message {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.form-error {
    color: #c62828;
    font-weight: 600;
    margin-top: 16px;
}

.form-success {
    color: #2e7d32;
    font-weight: 600;
    margin-top: 16px;
}

.hidden {
    display: none;
}

.subject-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.subject-card-main-link {
  display: block;
  text-decoration: none;
  color: inherit;
  flex-grow: 1;
}

.subject-card-main-link-disabled {
  cursor: default;
}

.subject-card-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.7rem;
  align-items: center;
  margin-top: 1rem;
}

.subject-card-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 1 auto;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.subject-card-disabled {
  opacity: 0.68;
}

.subject-card-disabled:hover {
  transform: none;
}

.subscription-lock-note {
  display: inline-block;
  margin-top: 0.65rem;
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 700;
}

.disabled-link {
  background: #e5e7eb !important;
  border-color: #d1d5db !important;
  color: #6b7280 !important;
  cursor: not-allowed;
  opacity: 1;
  pointer-events: none;
  filter: grayscale(0.25);
}

.grade-button-disabled,
.topic-item-disabled {
  opacity: 0.62;
}

.subject-past-papers-link {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #ffffff;
}

.subject-past-papers-link:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.subject-memos-link {
  border: 1px solid #86efac;
  background: #dcfce7;
  color: #166534;
}

.subject-memos-link:hover {
  background: #bbf7d0;
  border-color: #22c55e;
  color: #14532d;
}

.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu-btn {
    background: white;
    border: 1px solid #2f66f3;
    color: #2f66f3;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.user-menu-btn:hover {
    background: #f5f8ff;
}

.caret {
    margin-left: 6px;
    font-size: 12px;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    min-width: 180px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    padding: 8px 0;
    z-index: 1000;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown-item {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: #222;
    font-size: 15px;
}

.user-dropdown-item:hover {
    background: #f5f8ff;
    color: #2f66f3;
}
