/* AWE Resource Portal — Frontend Styles v2 */

.awe-portal *,
.awe-portal *::before,
.awe-portal *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.awe-portal {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  line-height: 1.5;
  padding: 2rem 0;
}
.awe-hidden {
  display: none !important;
}
.awe-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Gate */
.awe-gate {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}
.awe-gate__card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  text-align: center;
}
.awe-gate__icon {
  width: 56px;
  height: 56px;
  background: #ffcc00;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: #1a1400;
}
.awe-gate__icon svg {
  width: 26px;
  height: 26px;
}
.awe-gate__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.awe-gate__desc {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.75rem;
}
.awe-gate__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.awe-gate__input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  text-align: center;
  letter-spacing: 0.2em;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: #fafafa;
}
.awe-gate__input:focus {
  border-color: #ffcc00;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.2);
  background: #fff;
}
.awe-gate__error {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #c0392b;
  font-weight: 500;
}

/* Buttons */
.awe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, background 0.15s;
  line-height: 1;
}
.awe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.awe-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.awe-btn--primary {
  background: #ffcc00;
  color: #1a1400;
}
.awe-btn--primary:hover:not(:disabled) {
  background: #f0c000;
}
.awe-btn--ghost {
  background: transparent;
  color: #555;
  border: 1px solid #ddd;
}
.awe-btn--ghost:hover {
  background: #f5f5f5;
}
.awe-btn--full {
  width: 100%;
}
.awe-btn--sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  border-radius: 8px;
}
.awe-btn--sm svg {
  width: 15px;
  height: 15px;
}
.awe-btn__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(26, 20, 0, 0.3);
  border-top-color: #1a1400;
  border-radius: 50%;
  animation: awe-spin 0.7s linear infinite;
}
@keyframes awe-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Portal header */
.awe-portal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.awe-portal__title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}
.awe-portal__subtitle {
  font-size: 0.875rem;
  color: #888;
}
.awe-portal__header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Search */
.awe-search-wrap {
  position: relative;
}
.awe-search__input {
  padding: 0.45rem 0.9rem 0.45rem 2rem;
  font-size: 0.875rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  outline: none;
  background: #fafafa
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E")
    0.6rem center / 14px no-repeat;
  transition: border-color 0.15s;
}
.awe-search__input:focus {
  border-color: #ffcc00;
  background-color: #fff;
}

/* Programme progress */
.awe-progress {
  margin-bottom: 2.5rem;
  border: 1px solid #e5e5e5;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.awe-progress__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: unset;
  padding: 18px;
}
.awe-progress__table {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.awe-progress__col {
  padding: 0 1.25rem 1.25rem;
}
.awe-progress__col--done {
  border-right: 1px solid #eee;
}
.awe-progress__head {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  padding: 0.9rem 0;
  border-bottom: 2px solid #ffcc00;
  margin-bottom: 0.75rem;
}
.awe-progress__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.awe-progress__list li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.9rem;
  color: #333;
}
.awe-progress__list li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
}
.awe-progress__col--done .awe-progress__list li::before {
  content: "✓";
  color: #1f9d55;
}
.awe-progress__col--pending .awe-progress__list li {
  color: #888;
}
.awe-progress__col--pending .awe-progress__list li::before {
  content: "○";
  color: #bbb;
}
@media (max-width: 560px) {
  .awe-progress__table {
    grid-template-columns: 1fr;
  }
  .awe-progress__col--done {
    border-right: none;
    border-bottom: 1px solid #eee;
  }
}

/* Module groups */
.awe-modules {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.awe-module__header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #ffcc00;
}
.awe-module__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a1a;
}
.awe-module__desc {
  font-size: 0.85rem;
  color: #888;
  flex: 1;
}
.awe-module__count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #888;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Resource grid */
.awe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* Resource card */
.awe-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  outline: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}
.awe-card:hover,
.awe-card:focus-visible {
  border-color: #ffcc00;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.awe-card.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Card image preview */
.awe-card__preview {
  width: calc(100% + 2.5rem);
  margin: -1.25rem -1.25rem 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: #f3f4f6;
}
.awe-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.awe-card:hover .awe-card__preview img,
.awe-card:focus-visible .awe-card__preview img {
  transform: scale(1.03);
}

/* Card icon */
.awe-card__icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.awe-card__icon-wrap svg {
  width: 22px;
  height: 22px;
}
.awe-card--video .awe-card__icon-wrap {
  background: #fff0f0;
  color: #e53e3e;
}
.awe-card--image .awe-card__icon-wrap {
  background: #edfbf6;
  color: #0d9488;
}
.awe-card--pdf .awe-card__icon-wrap {
  background: #fff5f5;
  color: #e53e3e;
}
.awe-card--doc .awe-card__icon-wrap {
  background: #ebf4ff;
  color: #2b6cb0;
}
.awe-card--ppt .awe-card__icon-wrap {
  background: #fff7ed;
  color: #c05621;
}
.awe-card--xls .awe-card__icon-wrap {
  background: #f0fff4;
  color: #276749;
}
.awe-card--link .awe-card__icon-wrap {
  background: #f5f0ff;
  color: #6b46c1;
}

.awe-card__body {
  flex: 1;
}
.awe-card__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a5f00;
  background: #fff8d6;
  border-radius: 6px;
  padding: 2px 7px;
  margin-bottom: 0.4rem;
}
.awe-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.35;
  margin-bottom: 0.25rem;
}
.awe-card__desc {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.4;
}

.awe-card__action {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid #f0f0f0;
}
.awe-card__action svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}
.awe-card:hover .awe-card__action svg {
  transform: translateX(3px);
}
.awe-card__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #ddd;
  border-top-color: #555;
  border-radius: 50%;
  animation: awe-spin 0.7s linear infinite;
}

/* Empty state */
.awe-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #999;
  font-size: 0.9rem;
}

/* Video modal */
.awe-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.awe-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}
.awe-modal__box {
  position: relative;
  z-index: 1;
  background: #0d0d0d;
  border-radius: 14px;
  width: 100%;
  max-width: 820px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}
.awe-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 1rem;
}
.awe-modal__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffcc00;
  margin-bottom: 0.2rem;
}
.awe-modal__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}
.awe-modal__close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.awe-modal__close:hover {
  background: rgba(255, 255, 255, 0.16);
}
.awe-modal__close svg {
  width: 16px;
  height: 16px;
}
.awe-modal__video {
  aspect-ratio: 16/9;
  width: 100%;
}
.awe-modal__video iframe,
.awe-modal__video img {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}
.awe-modal__video img {
  object-fit: contain;
  background: #0d0d0d;
}
body.awe-modal-open {
  overflow: hidden;
}

/* Notice */
.awe-notice {
  background: #fff3cd;
  border-left: 4px solid #ffcc00;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #555;
}

/* Responsive */
@media (max-width: 600px) {
  .awe-portal__header {
    flex-direction: column;
  }
  .awe-grid {
    grid-template-columns: 1fr;
  }
  .awe-portal__header-actions {
    width: 100%;
  }
  .awe-search__input {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .awe-card,
  .awe-btn {
    transition: none;
  }
  .awe-btn__spinner,
  .awe-card__spinner {
    animation: none;
  }
}
