/* ==========================================================================
   Pharmacy Conference System — unified theme
   คณะเภสัชศาสตร์ มหาวิทยาลัยนเรศวร
   Single design system shared by every page via includes/header.php.
   ========================================================================== */

:root {
  /* --- Core brand palette: green (primary) + gold (accent) --- */
  --brand-green-darkest: #1b5e20;
  --brand-green-dark:    #2e7d32;
  --brand-green:         #388e3c;
  --brand-green-light:   #4caf50;
  --brand-green-lighter: #66bb6a;
  --brand-green-pale:    #e8f5e9;

  --brand-gold:          #f9a825;
  --brand-gold-dark:     #f57f17;
  --brand-gold-light:    #ffca28;
  --brand-gold-pale:     #fff8e1;

  --text-dark:   #263238;
  --text-muted:  #718096;
  --border-color:#e2e8f0;
  --bg-page:     #f7faf7;

  --danger:      #e53935;
  --danger-dark: #c62828;
  --info:        #2196f3;

  --radius-pill: 50px;
  --radius-lg:   20px;
  --radius-md:   14px;
  --radius-sm:   8px;

  --shadow-sm: 0 4px 15px rgba(27,94,32,0.07);
  --shadow-md: 0 10px 30px rgba(27,94,32,0.08);
  --shadow-lg: 0 15px 35px rgba(27,94,32,0.12);

  /* Back-compat aliases: many pages reference these var names directly
     (both in old inline style="" attributes and in class definitions below) */
  --pastel-green:  var(--brand-green-pale);
  --dark-green:    var(--brand-green-dark);
  --primary-green: var(--brand-green-lighter);
  --medium-green:  var(--brand-green-lighter);
  --accent-green:  var(--brand-green-light);
  --accent-orange: var(--brand-gold);
  --soft-gray:     var(--bg-page);
  --soft-white:    var(--bg-page);
  --light-bg:      var(--bg-page);
  --bg-light:      var(--bg-page);
}

/* ------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------ */
body {
  font-family: 'Prompt', sans-serif;
  background-color: var(--bg-page);
  color: var(--text-dark);
  min-height: 100vh;
}

a { text-decoration: none; }

::selection { background: var(--brand-green-pale); color: var(--brand-green-dark); }

/* ------------------------------------------------------------------------
   Navbar (one style, all contexts: guest / member / admin)
   ------------------------------------------------------------------------ */
.navbar,
.navbar-custom {
  background-color: #ffffff !important;
  border-bottom: 3px solid var(--brand-green-lighter);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 0.7rem 0;
}

.navbar-logo {
  height: 64px;
  width: auto;
  border-radius: 8px;
  object-fit: contain;
}

@media (max-width: 575.98px) {
  .navbar-logo { height: 48px; }
}

.navbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-green-lighter);
}

.navbar-brand,
.navbar-custom .navbar-brand {
  color: var(--brand-green-dark) !important;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-text-muted { color: var(--text-muted); }

.admin-chip {
  background: linear-gradient(135deg, var(--brand-gold-light) 0%, var(--brand-gold) 100%);
  color: #5c3d00;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-member-link {
  color: #556;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  margin-right: 6px;
  transition: 0.25s;
}
.nav-member-link:hover { color: var(--brand-green-dark); }

/* ------------------------------------------------------------------------
   Buttons — canonical brand buttons + reconciled legacy classnames
   ------------------------------------------------------------------------ */
.btn-brand {
  background: linear-gradient(135deg, var(--brand-green-light) 0%, var(--brand-green-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 500;
  transition: 0.3s;
}
.btn-brand:hover { background: linear-gradient(135deg, var(--brand-green-dark) 0%, var(--brand-green-darkest) 100%); color: #fff; transform: translateY(-2px); }

.btn-brand-outline {
  background: #fff;
  color: var(--brand-green-dark);
  border: 2px solid var(--brand-green-dark);
  border-radius: var(--radius-pill);
  font-weight: 500;
  transition: 0.3s;
}
.btn-brand-outline:hover { background: var(--brand-green-pale); color: var(--brand-green-dark); }

.btn-accent {
  background: linear-gradient(135deg, var(--brand-gold-light) 0%, var(--brand-gold-dark) 100%);
  color: #4a2e00;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 600;
  transition: 0.3s;
  box-shadow: 0 6px 16px rgba(245,127,23,0.25);
}
.btn-accent:hover { transform: translateY(-2px); color: #4a2e00; box-shadow: 0 10px 20px rgba(245,127,23,0.32); }

/* Legacy classnames used across pages — all reconciled to the same look */
.btn-login, .btn-detail, .btn-submit, .btn-save, .btn-update, .btn-register,
.btn-reg, .btn-menu-cta {
  background: linear-gradient(135deg, var(--brand-green-light) 0%, var(--brand-green-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 500;
  transition: 0.3s;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(46,125,50,0.2);
}
.btn-login:hover, .btn-detail:hover, .btn-submit:hover, .btn-save:hover,
.btn-update:hover, .btn-register:hover, .btn-reg:hover {
  background: linear-gradient(135deg, var(--brand-green-dark) 0%, var(--brand-green-darkest) 100%);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(46,125,50,0.3);
}
.btn-submit, .btn-save, .btn-update { padding: 14px 45px; border-radius: 12px; font-size: 1.02rem; }
.btn-register { padding: 1rem 2rem; font-size: 1.1rem; }
.btn-register.disabled { background: #ccc; box-shadow: none; color: #666; }

.btn-list, .btn-home, .btn-outline-home, .btn-back {
  background: #fff;
  color: var(--brand-green-dark);
  border: 2px solid var(--brand-green-dark);
  border-radius: var(--radius-pill);
  font-weight: 500;
  transition: 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-list:hover, .btn-home:hover, .btn-outline-home:hover, .btn-back:hover {
  background: var(--brand-green-pale);
  color: var(--brand-green-dark);
}

.btn-logout {
  background-color: var(--danger);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.4rem 1.2rem;
  text-decoration: none;
  font-size: 0.9rem;
  transition: 0.3s;
  border: none;
}
.btn-logout:hover { background-color: var(--danger-dark); color: #fff; }

.btn-menu {
  border-radius: 12px;
  padding: 25px;
  transition: all 0.3s;
  text-decoration: none;
  display: block;
  border: 2px solid transparent;
  height: 100%;
}
.btn-menu:hover { transform: translateY(-5px); border-color: var(--brand-green-lighter); background-color: var(--brand-green-pale); }
.btn-menu i { font-size: 2.8rem; color: var(--brand-green-lighter); }

.btn-action { border-radius: 8px; transition: 0.3s; }

.copy-helper-btn {
  font-size: 0.8rem;
  padding: 2px 10px;
  border-radius: 6px;
  color: var(--brand-green-dark);
  border: 1px solid var(--brand-green-light);
  background-color: var(--brand-green-pale);
  cursor: pointer;
  transition: all 0.2s ease;
}
.copy-helper-btn:hover { background-color: var(--brand-green-light); color: #fff; }

.btn-pdf {
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--danger-dark);
  text-decoration: none;
  margin-bottom: 0.5rem;
}
.btn-pdf:hover { background-color: #fff5f5; border-color: var(--danger); color: var(--danger-dark); transform: translateX(5px); }

/* ------------------------------------------------------------------------
   Hero / banner sections
   ------------------------------------------------------------------------ */
.hero-section,
.header-banner {
  background: linear-gradient(135deg, var(--brand-green-dark) 0%, var(--brand-green-lighter) 100%);
  color: #fff;
  padding: 4rem 0 6rem 0;
  text-align: center;
}
.header-banner { text-align: left; padding: 3rem 0; margin-bottom: 2rem; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

/* ------------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------------ */
.conference-card, .card-event, .conf-card {
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: 0.3s;
  background: #fff;
  box-shadow: var(--shadow-sm);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.conference-card:hover, .card-event:hover, .conf-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.card-img-top, .conf-img { height: 220px; object-fit: cover; }
.card-event { margin-bottom: 20px; }

/* Poster click-to-zoom preview (SweetAlert2 popup) */
.poster-hover-trigger { cursor: zoom-in; }

.poster-zoom-popup { background: transparent !important; box-shadow: none !important; }
.poster-zoom-img {
  max-width: min(90vw, 900px);
  max-height: 85vh;
  width: auto !important;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  object-fit: contain;
  background: #fff;
}

.registration-card, .card-edit, .card-form, .list-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(46,125,50,0.08);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.registration-card { margin-top: 40px; margin-bottom: 60px; }
.list-card { padding: 2.5rem; margin-top: 2rem; }
.card-form, .card-edit { padding: 1.5rem; margin-top: 2rem; margin-bottom: 3rem; }

.card-header-banner {
  background: linear-gradient(135deg, var(--brand-green-pale) 0%, #c8e6c9 100%);
  color: var(--brand-green-dark);
  padding: 35px 25px;
  border-bottom: 1px solid rgba(46,125,50,0.1);
  text-align: center;
}

.card-admin, .card-stats {
  border: none;
  border-radius: 15px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.card-table, .table-container {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.detail-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  margin-top: 2rem;
  margin-bottom: 4rem;
}

/* ------------------------------------------------------------------------
   Section titles
   ------------------------------------------------------------------------ */
.section-title {
  color: var(--brand-green-dark);
  font-weight: 700;
  font-size: 1.1rem;
  border-left: 5px solid var(--brand-green-light);
  padding-left: 12px;
  margin-top: 30px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title:first-of-type { margin-top: 5px; }

/* ------------------------------------------------------------------------
   Badges / statuses
   ------------------------------------------------------------------------ */
.badge-cpe, .cpe-badge, .cpe-badge-large {
  background: linear-gradient(135deg, var(--brand-gold-light) 0%, var(--brand-gold-dark) 100%);
  color: #4a2e00;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  display: inline-block;
  box-shadow: 0 3px 10px rgba(245,127,23,0.25);
}
.cpe-badge { position: absolute; top: 15px; right: 15px; }
.cpe-badge-large { font-size: 1.2rem; padding: 0.5rem 1.5rem; }

.badge-event-type {
  background: var(--brand-green-pale);
  color: var(--brand-green-dark);
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  display: inline-block;
  border: 1px solid rgba(46,125,50,0.15);
}

.status-badge {
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-badge.position-absolute { top: 15px; right: 15px; z-index: 10; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

.status-pending, .status-waiting_verify, .status-waiting {
  color: var(--brand-gold-dark); background: var(--brand-gold-pale);
  padding: 4px 12px; border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 500;
}
.status-verified {
  color: var(--brand-green-dark); background: var(--brand-green-pale);
  padding: 4px 12px; border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 500;
}
.status-rejected {
  color: var(--danger-dark); background: #fdedec;
  padding: 4px 12px; border-radius: var(--radius-pill); font-size: 0.85rem; font-weight: 500;
}

.badge-alumni {
  background-color: var(--brand-gold-pale);
  color: var(--brand-gold-dark);
  border: 1px solid var(--brand-gold-light);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 500;
}

/* ------------------------------------------------------------------------
   Info / stat boxes
   ------------------------------------------------------------------------ */
.info-item { font-size: 0.85rem; margin-bottom: 0.4rem; display: flex; align-items: flex-start; gap: 8px; }
.info-item i { color: var(--brand-green-dark); }

.info-box, .payment-info {
  background-color: var(--brand-green-pale);
  border-radius: 15px;
  padding: 1.5rem;
  height: 100%;
}
.payment-info { border-left: 5px solid var(--brand-green-lighter); border-radius: 10px; padding: 15px; }

.participant-stats { background-color: #f1f8f1; padding: 0.8rem; border-radius: 12px; margin: 1rem 0; }

.reg-rate-box {
  background-color: var(--brand-gold-pale);
  border-left: 3px solid var(--brand-gold);
  padding: 0.8rem;
  border-radius: 5px;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.progress { height: 8px; background-color: #e0eadd; margin-bottom: 5px; }
.progress-bar.bg-success { background-color: var(--brand-green-light) !important; }

/* ------------------------------------------------------------------------
   Forms
   ------------------------------------------------------------------------ */
.form-label { font-weight: 500; color: #4a5568; font-size: 0.92rem; margin-bottom: 6px; }
.form-control, .form-select {
  border-radius: 10px;
  border: 1.5px solid var(--border-color);
  padding: 11px 16px;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--brand-green-light);
  box-shadow: 0 0 0 3.5px rgba(76,175,80,0.15);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  background: #fcfdfe;
  border: 1.5px solid var(--border-color);
  padding: 20px;
  border-radius: 12px;
}
.status-option {
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}
.status-option:hover { border-color: var(--brand-green-light); background-color: rgba(232,245,233,0.3); }
.form-check-input:checked { background-color: var(--brand-green-dark); border-color: var(--brand-green-dark); }
.form-check-input:checked + .form-check-label { color: var(--brand-green-dark); font-weight: 600; }

.file-box { background: #f8f9fa; padding: 15px; border-radius: 10px; border: 1px dashed #ccc; height: 100%; }
.preview-img { max-width: 200px; border-radius: 10px; border: 2px solid var(--border-color); }
.current-file { font-size: 0.85rem; color: #666; margin-top: 5px; display: block; overflow: hidden; text-overflow: ellipsis; }

.tox-tinymce { border-radius: 10px !important; border: 1.5px solid var(--brand-green-light) !important; }

/* ------------------------------------------------------------------------
   Login card
   ------------------------------------------------------------------------ */
.login-card {
  border: none;
  border-radius: 25px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  background: #fff;
}
.login-header {
  background: linear-gradient(135deg, var(--brand-green-lighter) 0%, var(--brand-green-dark) 100%);
  color: #fff;
  padding: 35px 20px;
  text-align: center;
}
.register-link { color: var(--brand-green-dark); text-decoration: none; font-weight: 600; }
.register-link:hover { text-decoration: underline; }

/* ------------------------------------------------------------------------
   Profile images
   ------------------------------------------------------------------------ */
.profile-preview, .profile-img {
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}
.profile-preview { width: 120px; height: 120px; border-width: 4px; }
.profile-img { width: 45px; height: 45px; border: 2px solid var(--brand-green-pale); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.profile-placeholder {
  width: 120px; height: 120px; border-radius: 50%; background: var(--brand-green-pale);
  border: 4px solid #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.12);
  display: inline-flex; align-items: center; justify-content: center;
}

.poster-container { background-color: #f0f0f0; text-align: center; padding: 2rem; border-bottom: 1px solid #eee; }
.poster-img { max-width: 100%; max-height: 600px; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.poster-preview, .slip-thumb { width: 60px; height: 80px; object-fit: cover; border-radius: 5px; cursor: pointer; }
.slip-thumb { width: 50px; height: 50px; border: 1px solid var(--border-color); }

/* ------------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------------ */
.table thead, .card-table .table thead {
  background-color: var(--brand-green-lighter);
  color: #fff;
}
.table-container .table thead, .list-card .table thead {
  background-color: #f8fdf8;
  color: var(--brand-green-dark);
  border-bottom: 2px solid var(--brand-green-pale);
}
.list-card .table thead th { padding: 1.2rem; font-weight: 600; }
.list-card .table tbody td { vertical-align: middle; padding: 1.2rem; border-bottom: 1px solid #eee; }

/* ------------------------------------------------------------------------
   Misc
   ------------------------------------------------------------------------ */
.breadcrumb-item a { color: var(--brand-green-lighter); text-decoration: none; }
.additional-details { line-height: 1.8; color: #444; }
.created-at { font-size: 0.85rem; color: #888; }

.pdpa-content {
  text-align: left; font-size: 0.9rem; line-height: 1.6; max-height: 380px; overflow-y: auto;
  padding: 15px; border: 1px solid var(--border-color); border-radius: 10px; background-color: #fafbfc;
}

/* ------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------ */
.site-footer {
  text-align: center;
  padding: 3rem 0;
  margin-top: 3rem;
  color: var(--text-muted);
  background: #fff;
  border-top: 1px solid var(--border-color);
}
.site-footer .footer-logo { height: 34px; width: auto; margin-bottom: 10px; opacity: 0.9; }
.site-footer .footer-link {
  color: var(--brand-green);
  text-decoration: none;
  font-weight: 500;
}
.site-footer .footer-link:hover { text-decoration: underline; }
.site-footer .footer-link:not(:last-child)::after {
  content: "•";
  margin: 0 0.5rem;
  color: var(--text-muted);
}
