/* ============================================================
   JFAST - Global Stylesheet
   Journal on Frontier Applied Science and Technology
   ============================================================ */

:root {
  --primary:       #1a3a5c;
  --primary-light: #2563a8;
  --accent:        #e8a020;
  --bg:            #f7f8fc;
  --surface:       #ffffff;
  --border:        #dde2ec;
  --text:          #1e2535;
  --text-muted:    #6b7a99;
  --success:       #1a7a4a;
  --warning:       #b45309;
  --danger:        #b91c1c;
  --radius:        8px;
  --shadow:        0 2px 12px rgba(26,58,92,0.08);
  --transition:    0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-content { flex: 1; padding: 40px 0; }

/* ── Header ── */
#site-header {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 64px; max-width: 1200px; margin: 0 auto;
}
.site-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-logo .journal-name { font-size: 1.05rem; font-weight: 700; color: #fff; line-height: 1.2; }
.site-logo .journal-abbr { font-size: 0.78rem; color: rgba(255,255,255,0.7); }
nav.main-nav { display: flex; align-items: center; gap: 4px; }
nav.main-nav a {
  color: rgba(255,255,255,0.88); padding: 8px 14px; border-radius: var(--radius);
  font-size: 0.9rem; font-weight: 500; transition: background var(--transition);
}
nav.main-nav a:hover, nav.main-nav a.active {
  background: rgba(255,255,255,0.15); text-decoration: none; color: #fff;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.btn-header {
  padding: 7px 16px; border-radius: var(--radius); font-size: 0.85rem;
  font-weight: 600; cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none; display: inline-block;
}
.btn-login { background: transparent; border: 1.5px solid rgba(255,255,255,0.5); color: #fff; }
.btn-login:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.btn-submit { background: var(--accent); color: #fff; }
.btn-submit:hover { background: #d4901a; text-decoration: none; color: #fff; }

/* ── Hero Banner ── */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff; padding: 60px 24px; text-align: center;
}
.hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; }
.hero p { font-size: 1.1rem; opacity: 0.88; max-width: 640px; margin: 0 auto 28px; }
.hero-search { display: flex; max-width: 560px; margin: 0 auto; gap: 0; }
.hero-search input {
  flex: 1; padding: 13px 18px; border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 1rem; outline: none;
}
.hero-search button {
  padding: 13px 24px; background: var(--accent); color: #fff; border: none;
  border-radius: 0 var(--radius) var(--radius) 0; font-weight: 700; cursor: pointer;
  font-size: 1rem; transition: background var(--transition);
}
.hero-search button:hover { background: #d4901a; }

/* ── Section Titles ── */
.section-title {
  font-size: 1.35rem; font-weight: 700; color: var(--primary);
  margin-bottom: 20px; padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ── Article Cards ── */
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.article-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; transition: box-shadow var(--transition);
  display: flex; flex-direction: column;
}
.article-card:hover { box-shadow: var(--shadow); }
.article-card .article-type {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; padding: 3px 10px; border-radius: 20px; margin-bottom: 10px;
  background: #e8f0fe; color: var(--primary-light);
}
.article-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--primary-light); text-decoration: none; }
.article-card .authors { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.article-card .abstract {
  font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card .card-footer { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; }
.article-card .pub-date { font-size: 0.8rem; color: var(--text-muted); }
.cat-tag {
  font-size: 0.72rem; padding: 2px 8px; border-radius: 12px;
  background: #f0f4ff; color: var(--primary); border: 1px solid #c7d4f0;
  text-decoration: none; display: inline-block;
}
.cat-tag:hover { background: #e0e8ff; text-decoration: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--radius); font-size: 0.9rem;
  font-weight: 600; cursor: pointer; border: none; transition: all var(--transition);
  text-decoration: none;
}
.btn-primary { background: var(--primary-light); color: #fff; }
.btn-primary:hover { background: var(--primary); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--surface); color: var(--primary); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary-light); text-decoration: none; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: #d4901a; text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 0.88rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 0.95rem; background: var(--surface);
  color: var(--text); transition: border-color var(--transition); font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(37,99,168,0.1); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; border: 1px solid transparent; }
.alert-success { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.alert-error   { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.alert-info    { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.alert-warning { background: #fef3c7; border-color: #fcd34d; color: #92400e; }

/* ── Status Badges ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: capitalize; }
.badge-submitted      { background: #dbeafe; color: #1e40af; }
.badge-under_review   { background: #fef3c7; color: #92400e; }
.badge-accepted       { background: #d1fae5; color: #065f46; }
.badge-rejected       { background: #fee2e2; color: #991b1b; }
.badge-published      { background: #d1fae5; color: #065f46; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th {
  background: var(--primary); color: #fff; padding: 11px 14px;
  text-align: left; font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em;
}
table.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:hover td { background: #f0f4ff; }

/* ── Card / Panel ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; }
.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: var(--primary); }

/* ── Pagination ── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination button {
  padding: 7px 13px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 0.88rem;
  transition: all var(--transition);
}
.pagination button:hover { border-color: var(--primary-light); color: var(--primary-light); }
.pagination button.active { background: var(--primary-light); color: #fff; border-color: var(--primary-light); }

/* ── Two-column layout ── */
.two-col { display: grid; grid-template-columns: 1fr 280px; gap: 32px; align-items: start; }
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.sidebar-card-title { font-size: 1rem; font-weight: 700; margin-bottom: 14px; color: var(--primary); }
.sidebar-meta { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; margin-top: 12px; }
.sidebar-meta div strong { color: var(--text); }

/* ── Subject category list ── */
.subject-group { margin-bottom: 14px; }
.subject-group-title { font-size: 0.88rem; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.subject-tags { display: flex; flex-wrap: wrap; gap: 5px; }

/* ── Page header ── */
.page-header { background: var(--primary); color: #fff; padding: 36px 24px; }
.page-header h1 { font-size: 1.8rem; font-weight: 800; }
.page-header p { opacity: 0.85; margin-top: 6px; }

/* ── Info list ── */
.info-list { list-style: none; }
.info-list li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.info-list li:last-child { border-bottom: none; }
.info-list li strong { color: var(--primary); display: inline-block; min-width: 140px; }

/* ── Footer ── */
#site-footer { background: var(--primary); color: rgba(255,255,255,0.8); padding: 40px 24px 20px; margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px; max-width: 1200px; margin: 0 auto 28px; }
.footer-col h4 { color: #fff; font-size: 0.95rem; margin-bottom: 12px; }
.footer-col p { font-size: 0.88rem; line-height: 1.6; }
.footer-col a { display: block; color: rgba(255,255,255,0.7); font-size: 0.88rem; margin-bottom: 6px; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { text-align: center; font-size: 0.82rem; border-top: 1px solid rgba(255,255,255,0.15); padding-top: 20px; max-width: 1200px; margin: 0 auto; }

/* ── Admin sidebar ── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar { width: 200px; background: #1a2744; color: #fff; padding: 20px 0; flex-shrink: 0; }
.admin-sidebar .brand { padding: 0 20px 20px; font-weight: 700; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-sidebar .brand small { display: block; font-size: 0.75rem; opacity: 0.6; font-weight: 400; margin-top: 2px; }
.admin-nav a { display: block; padding: 11px 20px; color: rgba(255,255,255,0.75); font-size: 0.9rem; transition: background 0.2s; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; }
.admin-main { flex: 1; display: flex; flex-direction: column; }
.admin-topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 0 28px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.admin-topbar h1 { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.admin-content { padding: 28px; flex: 1; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--primary-light); }
.stat-card .stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 12px 16px; gap: 10px; }
  nav.main-nav { order: 3; width: 100%; flex-wrap: wrap; }
  .hero h1 { font-size: 1.6rem; }
  .articles-grid { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: 100%; }
}

/* ── Nav Auth State ── */
.nav-user-area { display: flex; align-items: center; gap: 8px; }
.nav-user-name {
  color: rgba(255,255,255,0.9); font-size: 0.82rem; font-weight: 600;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-logout {
  background: transparent; border: 1.5px solid rgba(255,255,255,0.5);
  color: #fff; cursor: pointer; font-family: inherit;
}
.btn-logout:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.nav-dashboard-link { background: rgba(255,255,255,0.15); color: #fff; border: none; }
.nav-dashboard-link:hover { background: rgba(255,255,255,0.25); color: #fff; text-decoration: none; }

/* ── Review Comments ── */
.review-comment { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; background: #fff; }
.review-comment .rc-meta { font-size: .8rem; color: var(--text-muted); margin-bottom: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.review-comment .rc-recommendation { font-weight: 700; }
.review-comment .rc-recommend-accept { color: var(--success); }
.review-comment .rc-recommend-reject { color: var(--danger); }
.review-comment .rc-recommend-minor { color: #b45309; }
.review-comment .rc-recommend-major { color: #c0550a; }
.review-comment .rc-body { font-size: .92rem; line-height: 1.75; white-space: pre-wrap; }
.review-comment .rc-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 4px; }
.review-comment .rc-section { margin-bottom: 12px; }
.review-comment .rc-section:last-child { margin-bottom: 0; }

/* ── Submission Detail (author view) ── */
.sub-detail-section { margin-bottom: 24px; }
.sub-detail-section h3 { font-size: .95rem; font-weight: 700; color: var(--primary); border-bottom: 2px solid var(--primary); padding-bottom: 5px; margin-bottom: 14px; }
.info-grid { display: grid; grid-template-columns: 160px 1fr; gap: 8px 16px; }
.info-label { font-size: .83rem; font-weight: 600; color: var(--text-muted); padding-top: 2px; }
.info-value { font-size: .9rem; }
