/* UTAS Research Library — Shared Design System (plain CSS, works with Tailwind CDN) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --color-teal-deep: #042f2e;
  --color-teal: #0f766e;
  --color-emerald: #059669;
  --color-slate-900: #0f172a;
  --color-slate-700: #334155;
  --color-slate-500: #64748b;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-slate-50);
  color: var(--color-slate-900);
}

.page-main {
  flex-grow: 1;
  width: 100%;
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1rem;
}

@media (min-width: 640px) {
  .page-main { padding: 2.5rem 1.5rem; }
}

@media (min-width: 1024px) {
  .page-main { padding-left: 2rem; padding-right: 2rem; }
}

.page-main-narrow {
  flex-grow: 1;
  width: 100%;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-slate-900);
  letter-spacing: -0.025em;
}

@media (min-width: 640px) {
  .section-title { font-size: 1.875rem; }
}

.section-subtitle {
  color: var(--color-slate-500);
  font-size: 1rem;
  margin-top: 0.5rem;
  max-width: 42rem;
  line-height: 1.625;
}

.card {
  background-color: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.04);
}

.card-hover {
  transition: all 0.2s ease;
}

.card-hover:hover {
  box-shadow: 0 4px 12px -2px rgb(0 0 0 / 0.08);
  border-color: rgba(13, 148, 136, 0.25);
  transform: translateY(-2px);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background-color: #0f766e;
  border: none;
  cursor: pointer;
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  transition: background-color 0.15s;
  text-decoration: none;
}

.btn-primary:hover { background-color: #115e59; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-slate-700);
  background-color: #fff;
  border: 1px solid var(--color-slate-300);
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
}

.btn-secondary:hover { background-color: var(--color-slate-50); }

.btn-emerald {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: #047857;
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  transition: background-color 0.15s;
  text-decoration: none;
}

.btn-emerald:hover { background-color: #d1fae5; }

.btn-danger-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: #dc2626;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s;
  text-decoration: none;
}

.btn-danger-text:hover { background-color: #fef2f2; }

.input-field {
  display: block;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-slate-300);
  background-color: #fff;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--color-slate-900);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input-field::placeholder { color: #94a3b8; }

.input-field:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-slate-700);
  margin-bottom: 0.375rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-teal {
  background-color: #f0fdfa;
  color: #115e59;
  border: 1px solid #ccfbf1;
}

.badge-slate {
  background-color: var(--color-slate-100);
  color: var(--color-slate-500);
  border: 1px solid var(--color-slate-200);
}

.badge-emerald {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.alert {
  padding: 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  border: 1px solid;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.alert-error {
  background-color: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

.alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.alert-info {
  background-color: #f0fdfa;
  color: #115e59;
  border-color: #99f6e4;
}

.site-nav {
  background-color: var(--color-teal-deep);
  color: #fff;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(15, 118, 110, 0.4);
}

.site-nav-inner {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

@media (min-width: 640px) {
  .site-nav-inner { padding-left: 1.5rem; padding-right: 1.5rem; }
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.site-logo-icon {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.site-logo-text {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

@media (min-width: 640px) {
  .site-logo-text { font-size: 1.125rem; }
}

.site-logo-accent {
  color: #6ee7b7;
  font-weight: 600;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  color: #ccfbf1;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
}

.nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-btn-admin {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  background-color: #d97706;
  text-decoration: none;
  transition: background-color 0.15s;
}

.nav-btn-admin:hover { background-color: #b45309; }

.nav-btn-outline {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-lg);
  font-size: 0.75rem;
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: background-color 0.15s;
}

.nav-btn-outline:hover { background-color: rgba(255, 255, 255, 0.18); }

.nav-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  background-color: #0d9488;
  text-decoration: none;
  transition: background-color 0.15s;
}

.nav-btn-primary:hover { background-color: #14b8a6; }

.nav-btn-register {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-teal-deep);
  background-color: #fff;
  text-decoration: none;
  transition: background-color 0.15s;
}

.nav-btn-register:hover { background-color: #f0fdfa; }

.hero-section {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: linear-gradient(135deg, #042f2e 0%, #134e4a 50%, #064e3b 100%);
  color: #fff;
  padding: 2.5rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.15);
}

@media (min-width: 640px) {
  .hero-section {
    padding: 3.5rem 2.5rem;
    margin-bottom: 2.5rem;
    border-radius: 1.25rem;
  }
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top right, rgba(16, 185, 129, 0.18), transparent 55%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6ee7b7;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-size: 1.875rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

@media (min-width: 640px) {
  .hero-title { font-size: 2.25rem; }
}

@media (min-width: 1024px) {
  .hero-title { font-size: 3rem; }
}

.hero-subtitle {
  color: rgba(204, 251, 241, 0.92);
  font-size: 1rem;
  max-width: 42rem;
  line-height: 1.625;
}

.search-panel { margin-bottom: 2rem; }

.search-panel .card-inner { padding: 1.25rem; }

@media (min-width: 640px) {
  .search-panel .card-inner { padding: 1.5rem; }
}

.paper-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  cursor: pointer;
  position: relative;
}

.paper-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-slate-900);
  margin-bottom: 0.5rem;
  line-height: 1.375;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s;
}

.paper-card:hover .paper-card-title { color: #115e59; }

.paper-card-abstract {
  color: var(--color-slate-500);
  font-size: 0.875rem;
  line-height: 1.625;
  flex-grow: 1;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.paper-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-slate-500);
  margin-bottom: 1rem;
}

.paper-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--color-slate-100);
}

.paper-download-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f766e;
  background-color: #f0fdfa;
  border: 1px solid #ccfbf1;
  text-decoration: none;
  transition: background-color 0.15s;
}

.paper-download-btn:hover { background-color: #ccfbf1; }

.delete-paper-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.5rem;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 9999px;
  color: #94a3b8;
  border: 1px solid transparent;
  transition: all 0.15s;
  z-index: 20;
  text-decoration: none;
}

.delete-paper-btn:hover {
  color: #dc2626;
  background-color: #fef2f2;
  border-color: #fecaca;
}

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  border: 2px dashed var(--color-slate-200);
  border-radius: var(--radius-xl);
  background-color: #fff;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.modal-overlay.is-open { display: flex; }

.modal-panel {
  background-color: #fff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  max-width: 42rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-slate-100);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: linear-gradient(to bottom, #f8fafc, #fff);
}

.modal-body { padding: 2rem; }

.modal-footer {
  padding: 1.25rem 1.5rem;
  background-color: var(--color-slate-50);
  border-top: 1px solid var(--color-slate-100);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.modal-close-btn {
  color: #94a3b8;
  background: #fff;
  border: 1px solid transparent;
  padding: 0.5rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s;
}

.modal-close-btn:hover {
  color: var(--color-slate-700);
  background-color: var(--color-slate-100);
  border-color: var(--color-slate-200);
}

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #f8fafc 0%, rgba(240, 253, 250, 0.5) 40%, rgba(236, 253, 245, 0.35) 100%);
  padding: 3rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 28rem;
  box-shadow: 0 10px 40px -10px rgb(0 0 0 / 0.12);
  overflow: hidden;
}

.auth-header {
  text-align: center;
  padding: 2.5rem 2rem 1.5rem;
}

.auth-form-body {
  padding: 0 2rem 2rem;
}

.auth-form-body form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-footer {
  background-color: var(--color-slate-50);
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--color-slate-100);
  text-align: center;
}

.auth-logo {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #042f2e, #0f766e);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.35);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--color-slate-500);
  margin-top: 0.375rem;
  line-height: 1.4;
}

.form-section {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-slate-100);
}

.form-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-slate-500);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-stat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-stat {
  flex: 1;
  min-width: 140px;
  padding: 1.25rem 1.5rem;
}

.admin-stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-slate-900);
}

.admin-stat-label {
  font-size: 0.875rem;
  color: var(--color-slate-500);
  margin-top: 0.25rem;
}

.admin-table-wrap { overflow: hidden; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table thead { background-color: var(--color-slate-50); }

.admin-table th {
  padding: 0.875rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-slate-500);
}

.admin-table td {
  padding: 1rem 1.5rem;
  font-size: 0.875rem;
  border-top: 1px solid var(--color-slate-100);
  vertical-align: middle;
}

.admin-table tbody tr:hover { background-color: #fafafa; }

.admin-mobile-list {
  display: none;
  flex-direction: column;
  gap: 1rem;
}

@media (max-width: 767px) {
  .admin-table-desktop { display: none; }
  .admin-mobile-list { display: flex; }
}

.admin-mobile-card .admin-mobile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-slate-100);
}

.site-footer {
  background-color: var(--color-slate-900);
  color: #94a3b8;
  padding: 2.5rem 1rem;
  margin-top: auto;
  border-top: 1px solid #1e293b;
}

.site-footer-inner {
  max-width: 80rem;
  margin: 0 auto;
  text-align: center;
}

.site-footer-title {
  color: #e2e8f0;
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.site-footer-copy {
  font-size: 0.75rem;
  opacity: 0.65;
  line-height: 1.5;
  max-width: 36rem;
  margin: 0 auto;
}

.file-input-wrap input[type="file"] {
  font-size: 0.875rem;
  color: var(--color-slate-500);
}

.file-input-wrap input[type="file"]::file-selector-button {
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  border: 0;
  font-size: 0.875rem;
  font-weight: 600;
  background-color: #f0fdfa;
  color: #0f766e;
  cursor: pointer;
}

.tag-chip {
  font-size: 0.625rem;
  background-color: var(--color-slate-100);
  color: var(--color-slate-500);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  border: 1px solid var(--color-slate-200);
}

.modal-tag-chip {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--color-slate-700);
  background-color: var(--color-slate-100);
  border: 1px solid var(--color-slate-200);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-lg);
}

.w-full-btn { width: 100%; }
