/* ========================================================
   PGRI CABANG LEUWIGOONG - ADMIN CMS STYLESHEET
   Full-page Responsive Dashboard & Authentication
   ======================================================== */

:root {
  --primary-red: #c51616;
  --primary-red-dark: #991010;
  --primary-red-light: #fef2f2;
  --accent-gold: #f59e0b;
  --accent-blue: #2563eb;
  --accent-blue-light: #eff6ff;
  --accent-green: #16a34a;
  --accent-green-light: #f0fdf4;
  --dark-bg: #0f172a;
  --dark-surface: #1e293b;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #c51616;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

/* ========================================================
   LOGIN PAGE STYLES
   ======================================================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 10% 20%, #fef2f2 0%, #f1f5f9 90%);
  position: relative;
  overflow: hidden;
}

.login-wrapper::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(197, 22, 22, 0.05);
  pointer-events: none;
}

.login-wrapper::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 350px;
  height: 350px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.04);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  padding: 36px 32px;
  position: relative;
  z-index: 2;
  animation: fadeInDown 0.3s ease-out;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 8px rgba(197, 22, 22, 0.2));
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-red);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}

.login-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.login-alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-alert.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.login-alert.info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.login-alert.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-label span.req {
  color: var(--primary-red);
}

.form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-wrap i.prefix-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: #ffffff;
  transition: all 0.2s ease;
}

.form-input.no-prefix {
  padding-left: 14px;
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(197, 22, 22, 0.12);
}

.toggle-password-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.toggle-password-btn:hover {
  color: var(--text-main);
}

.btn-primary-block {
  width: 100%;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(197, 22, 22, 0.25);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-block:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(197, 22, 22, 0.35);
}

.login-footer-links {
  text-align: center;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
}

.login-footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.login-footer-links a:hover {
  color: var(--primary-red);
}

/* ========================================================
   ADMIN DASHBOARD LAYOUT (Full Screen, Responsive)
   ======================================================== */
.admin-app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 1. Header Bar */
.admin-navbar {
  height: 68px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.navbar-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.navbar-brand-text h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-red);
  line-height: 1.2;
}

.navbar-brand-text span {
  font-size: 12px;
  color: var(--text-muted);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge-status.online {
  background: var(--accent-green-light);
  color: var(--accent-green);
  border: 1px solid #bbf7d0;
}

.badge-status.unsaved {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.btn-nav {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
}

.btn-nav-outline {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-nav-outline:hover {
  background: var(--light-bg);
  border-color: #cbd5e1;
}

.btn-nav-primary {
  background: linear-gradient(135deg, var(--primary-red) 0%, var(--primary-red-dark) 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(197, 22, 22, 0.25);
}

.btn-nav-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.btn-nav-danger {
  background: #ffffff;
  color: #dc2626;
  border: 1px solid #fee2e2;
}

.btn-nav-danger:hover {
  background: #fee2e2;
}

/* 2. Main Dashboard Layout: Sidebar + Main Content */
.admin-container {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 68px);
}

.admin-sidebar {
  width: 280px;
  background: #ffffff;
  border-right: 1px solid var(--border-color);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow-y: auto;
}

.sidebar-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 700;
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-tabs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-tab-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.nav-tab-item i {
  width: 20px;
  text-align: center;
  font-size: 15px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.nav-tab-item:hover {
  background: var(--light-bg);
  color: var(--primary-red);
}

.nav-tab-item:hover i {
  color: var(--primary-red);
}

.nav-tab-item.active {
  background: var(--primary-red-light);
  color: var(--primary-red);
  font-weight: 600;
}

.nav-tab-item.active i {
  color: var(--primary-red);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* 3. Main Workspace Area */
.admin-workspace {
  flex: 1;
  padding: 32px 40px;
  background: var(--light-bg);
  overflow-y: auto;
  max-width: 1200px;
}

.pane-section {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.pane-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark-bg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Form Cards */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.form-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-card-title i {
  color: var(--primary-red);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--text-main);
  background: #ffffff;
  resize: vertical;
  min-height: 85px;
  line-height: 1.5;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(197, 22, 22, 0.12);
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Dropzone & Image Upload Preview */
.dropzone-box {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.dropzone-box:hover, .dropzone-box.dragover {
  border-color: var(--primary-red);
  background: var(--primary-red-light);
}

.dropzone-icon {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: color 0.2s;
}

.dropzone-box:hover .dropzone-icon {
  color: var(--primary-red);
}

.dropzone-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.dropzone-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.upload-preview-container {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.img-preview-thumb {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: #f1f5f9;
}

/* Slider & List Dynamic Cards */
.dynamic-item-card {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
  transition: border-color 0.2s;
}

.dynamic-item-card:hover {
  border-color: #cbd5e1;
}

.dynamic-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-color);
}

.dynamic-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-remove-item {
  background: none;
  border: none;
  color: #dc2626;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-remove-item:hover {
  background: #fee2e2;
}

.btn-add-item {
  padding: 10px 18px;
  background: #ffffff;
  border: 1px dashed var(--primary-red);
  color: var(--primary-red);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-add-item:hover {
  background: var(--primary-red-light);
}

/* YouTube Preview Card */
.video-preview-wrapper {
  margin-top: 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  max-width: 480px;
  background: #000;
}

.video-thumb-preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Gallery Grid */
.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.gallery-admin-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-admin-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #f1f5f9;
}

.gallery-admin-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.gallery-admin-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
}

/* Toast Notification */
.admin-toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-toast {
  min-width: 300px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--dark-bg);
  color: #ffffff;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUpToast 0.25s ease-out;
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-toast.success {
  background: #166534;
  border-left: 4px solid #22c55e;
}

.admin-toast.error {
  background: #991b1b;
  border-left: 4px solid #ef4444;
}

.admin-toast.info {
  background: #1e3a8a;
  border-left: 4px solid #3b82f6;
}

/* Sticky Bottom Bar for Mobile / Smaller Screens */
.admin-sticky-footer {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 12px 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  z-index: 90;
  justify-content: space-between;
  align-items: center;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .admin-container {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
  }
  .nav-tabs-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  .nav-tab-item {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }
  .admin-workspace {
    padding: 20px 16px;
  }
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .admin-sticky-footer {
    display: flex;
  }
}
