/* cms.css — SSMM CMS Panel
   Glassmorphism design tokens IDENTICAL to ssmm_admin_panel/admin.css.
   Additional CMS-specific component styles appended below the shared base. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── Design Tokens (identical to admin panel) ─────────────────── */
:root {
  --bg-gradient: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-bg-hover: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.37);
  --glass-blur: blur(18px);

  --text-primary: rgba(255, 255, 255, 0.95);
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-muted: rgba(255, 255, 255, 0.35);

  --accent: #7c6ff7;
  --accent-glow: rgba(124, 111, 247, 0.45);
  --accent-light: rgba(124, 111, 247, 0.18);

  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.15);
  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.15);
  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.15);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --transition: all 0.22s cubic-bezier(.4,0,.2,1);
}

/* ── Reset & Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(124, 111, 247, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, rgba(56, 189, 248, 0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ── Glass Utility ────────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
}

/* ── Full-page Overlays ───────────────────────────────────────── */
.full-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-gradient); background-attachment: fixed;
}
.auth-card {
  width: 100%; max-width: 420px; padding: 40px 36px;
  display: flex; flex-direction: column; gap: 24px;
}
.auth-card .brand { text-align: center; }
.auth-card .brand-logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-light); border: 1px solid rgba(124,111,247,0.3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; margin-bottom: 14px;
}
.auth-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.auth-card .subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
label {
  font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
  color: var(--text-secondary); text-transform: uppercase;
}
input, select, textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit; font-size: 14px;
  padding: 11px 14px; transition: var(--transition); outline: none;
  appearance: none; -webkit-appearance: none;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; cursor: pointer;
}
select option { background: #1e1b4b; color: #fff; }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent); background: rgba(124,111,247,0.08);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
.form-error { font-size: 13px; color: var(--danger); min-height: 18px; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, #7c6ff7, #6366f1);
  border: none; border-radius: var(--radius-sm); color: #fff; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 12px 20px;
  transition: var(--transition); display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.btn-primary:disabled { opacity: 0.55; transform: none; cursor: not-allowed; }

.btn-glass {
  background: var(--glass-bg); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  color: var(--text-primary); cursor: pointer; font-family: inherit;
  font-size: 13px; font-weight: 500; padding: 8px 16px;
  transition: var(--transition); display: inline-flex; align-items: center; gap: 6px;
}
.btn-glass:hover { background: var(--glass-bg-hover); border-color: var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-danger-sm { color: var(--danger); border-color: rgba(248,113,113,0.3); }
.btn-danger-sm:hover { background: var(--danger-bg); }
.btn-danger-ghost {
  background: var(--danger-bg); border: 1px solid rgba(248,113,113,0.3);
  color: var(--danger); border-radius: var(--radius-sm);
  padding: 10px 18px; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 500; transition: var(--transition);
}
.btn-danger-ghost:hover { background: rgba(248,113,113,0.25); }

/* ── App Shell ────────────────────────────────────────────────── */
#appShell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

/* ── Header ───────────────────────────────────────────────────── */
.cms-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 12, 41, 0.7);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
  padding: 0 32px; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.header-brand { display: flex; align-items: center; gap: 12px; }
.header-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent-light); border: 1px solid rgba(124,111,247,0.3);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.header-title { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }
.header-sub { font-size: 11px; color: var(--text-secondary); }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-user { font-size: 13px; color: var(--text-secondary); }

/* ── Tab Navigation ───────────────────────────────────────────── */
.cms-tabs {
  display: flex; gap: 4px;
  padding: 0 32px;
  background: rgba(15,12,41,0.5);
  border-bottom: 1px solid var(--glass-border);
}
.cms-tab {
  padding: 14px 20px; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; background: none; border: none;
  border-bottom: 2px solid transparent; transition: var(--transition);
  font-family: inherit; position: relative; top: 1px;
}
.cms-tab:hover { color: var(--text-primary); }
.cms-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Main Content ─────────────────────────────────────────────── */
.cms-main {
  flex: 1; padding: 28px 32px;
  max-width: 1200px; width: 100%; margin: 0 auto;
  display: flex; flex-direction: column; gap: 20px;
}
.tab-panel { display: none; flex-direction: column; gap: 20px; }
.tab-panel.active { display: flex; }

.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.section-title { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.section-sub { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.section-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Notification Toast ───────────────────────────────────────── */
.cms-notification {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  padding: 13px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  display: none; animation: slideUp 0.25s ease; max-width: 320px;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cms-notification.success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(74,222,128,0.3); }
.cms-notification.error   { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(248,113,113,0.3); }

/* ── Skeleton ─────────────────────────────────────────────────── */
.skeleton-rows { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.skeleton-row {
  height: 52px; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-secondary); font-size: 14px; }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); padding: 20px;
}
.modal-card {
  width: 100%; max-width: 480px; padding: 32px;
  display: flex; flex-direction: column; gap: 20px;
  animation: modalIn 0.22s cubic-bezier(.4,0,.2,1);
}
@keyframes modalIn { from { opacity:0; transform:translateY(12px) scale(0.98); } to { opacity:1; transform:none; } }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 17px; font-weight: 700; }
.modal-sub   { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }
.modal-close {
  background: none; border: none; color: var(--text-secondary);
  font-size: 20px; cursor: pointer; line-height: 1; padding: 0; transition: color 0.15s;
}
.modal-close:hover { color: var(--text-primary); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

/* ── Access Denied ────────────────────────────────────────────── */
.denied-card {
  text-align: center; max-width: 400px; padding: 40px 36px;
  display: flex; flex-direction: column; gap: 14px; align-items: center;
}
.denied-card h2 { font-size: 20px; font-weight: 700; color: var(--danger); }
.denied-card p  { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ── Glass Table ──────────────────────────────────────────────── */
.glass-table-wrap { overflow-x: auto; }
.glass-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.glass-table thead tr { background: rgba(124,111,247,0.1); border-bottom: 1px solid var(--glass-border); }
.glass-table th {
  padding: 13px 16px; text-align: left; font-size: 11px; font-weight: 600;
  letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-secondary); white-space: nowrap;
}
.glass-table tbody tr { border-bottom: 1px solid rgba(255,255,255,0.05); transition: var(--transition); }
.glass-table tbody tr:hover { background: rgba(255,255,255,0.04); }
.glass-table td { padding: 14px 16px; vertical-align: middle; }

/* ── Status Badges ────────────────────────────────────────────── */
.status-badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; letter-spacing: 0.5px;
}
.status-badge.published { background: var(--success-bg); color: var(--success); border: 1px solid rgba(74,222,128,0.3); }
.status-badge.draft     { background: rgba(148,163,184,0.1); color: var(--text-secondary); border: 1px solid rgba(148,163,184,0.3); }

.inq-status-badge {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 20px; text-transform: capitalize; letter-spacing: 0.4px;
}
.status-new      { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(251,191,36,0.3); }
.status-reviewed { background: var(--accent-light); color: #a5b4fc; border: 1px solid rgba(124,111,247,0.3); }
.status-resolved { background: var(--success-bg); color: var(--success); border: 1px solid rgba(74,222,128,0.3); }

/* ── Announcements ────────────────────────────────────────────── */
.ann-card {
  padding: 20px 22px; display: flex; flex-direction: column; gap: 10px;
  transition: var(--transition);
}
.ann-card-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ann-meta { display: flex; align-items: center; gap: 10px; }
.ann-date { font-size: 12px; color: var(--text-muted); }
.ann-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ann-title { font-size: 16px; font-weight: 600; }
.ann-content { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.ann-img-wrap { margin-top: 4px; }
.ann-img { max-height: 140px; border-radius: var(--radius-sm); object-fit: cover; border: 1px solid var(--glass-border); }

/* ── Gallery ──────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.gallery-card {
  display: flex; flex-direction: column; overflow: hidden;
  transition: var(--transition);
}
.gallery-card:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.45); }
.gallery-img-wrap { position: relative; height: 150px; background: rgba(0,0,0,0.3); }
.gallery-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-img-error {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--text-muted); font-size: 13px;
  flex-direction: column; gap: 6px;
}
.gallery-card-body { padding: 12px 14px 6px; display: flex; flex-direction: column; gap: 6px; }
.gallery-title { font-size: 13px; font-weight: 500; }
.cat-chip {
  display: inline-block; font-size: 11px; font-weight: 600;
  background: var(--accent-light); color: #a5b4fc;
  border: 1px solid rgba(124,111,247,0.3); border-radius: 20px;
  padding: 2px 9px; letter-spacing: 0.3px;
}
.gallery-card-footer { padding: 8px 14px 12px; }
.gallery-skeleton { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
.gallery-skeleton-item { height: 220px; border-radius: var(--radius-md); background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

/* ── Category Filters ─────────────────────────────────────────── */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 6px 14px; font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  border-radius: 20px; color: var(--text-secondary); cursor: pointer;
  transition: var(--transition); font-family: inherit;
}
.filter-chip:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.filter-chip.active { background: var(--accent-light); border-color: rgba(124,111,247,0.5); color: #a5b4fc; }

/* ── Inquiries ────────────────────────────────────────────────── */
.inq-filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.inq-filter-tab {
  padding: 7px 16px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  border-radius: 20px; color: var(--text-secondary); cursor: pointer;
  transition: var(--transition); font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
}
.inq-filter-tab:hover { background: var(--glass-bg-hover); color: var(--text-primary); }
.inq-filter-tab.active { background: var(--accent-light); border-color: rgba(124,111,247,0.5); color: #a5b4fc; }
.inq-badge {
  background: var(--warning); color: #000; font-size: 10px;
  font-weight: 700; padding: 1px 6px; border-radius: 20px;
}
.sender-cell { display: flex; align-items: center; gap: 10px; }
.sender-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #7c6ff7, #38bdf8);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sender-name { font-weight: 500; font-size: 13px; }
.sender-contact { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.inq-message-cell { max-width: 300px; }
.inq-message { font-size: 13px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.inq-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.inq-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cms-header, .cms-tabs { padding: 0 16px; }
  .cms-main { padding: 16px; }
  .modal-card { padding: 24px 18px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
