/* ============================================
   Ujyalo Nepal Party – Unified Design System
   Green / Gold / White Theme
   ============================================ */

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

/* ---- Design Tokens ---- */
:root {
  --primary-green: #1a7a42;
  --deep-green: #145c32;
  --bright-green: #22915a;
  --accent-gold: #c9a227;
  --gold-light: #dbb93a;
  --gold-dark: #b08d1e;
  --dark-bg: #f7f8f6;
  --darker-bg: #eef0ec;
  --card-bg: #ffffff;
  --card-bg-hover: #ffffff;
  --card-border: rgba(0, 0, 0, 0.08);
  --card-border-hover: rgba(26, 122, 66, 0.35);
  --glass-blur: blur(16px);
  --text-primary: #1a1e1a;
  --text-secondary: #546054;
  --text-muted: #8a968a;
  --danger: #dc3545;
  --danger-hover: #c82333;
  --primary-gradient: linear-gradient(135deg, #1a7a42 0%, #145c32 100%);
  --gold-gradient: linear-gradient(135deg, #c9a227 0%, #b08d1e 100%);
  --hero-gradient: linear-gradient(135deg, #1a7a42 0%, #145c32 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-gold: 0 4px 16px rgba(201, 162, 39, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Subtle background pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(26, 122, 66, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(201, 162, 39, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ---- Top Bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary-gradient);
  padding: 0 24px;
  box-shadow: 0 2px 16px rgba(20, 92, 50, 0.2);
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  -webkit-text-fill-color: #fff;
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.logo-gold {
  color: var(--gold-light);
  -webkit-text-fill-color: var(--gold-light);
}

.badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--gold-gradient);
  color: #fff;
  -webkit-text-fill-color: #fff;
  vertical-align: middle;
  margin-left: 8px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---- Container ---- */
.container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
}

@media (min-width: 1024px) {

  .container {
    padding: 6px 24px;
  }

  .tab-bar {
    padding: 6px 24px 0;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
  }

  .gallery-thumb {
    aspect-ratio: 1 / 1;
    height: auto;
  }

  .gallery-info {
    padding: 6px 12px;
  }

  .gallery-info h3 {
    font-size: 0.9rem;
    margin-bottom: 0;
  }
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26, 122, 66, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 122, 66, 0.35);
}

.btn-gold {
  background: var(--gold-gradient);
  color: #fff;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(201, 162, 39, 0.35);
}

.btn-secondary {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  background: #f5f7f5;
  border-color: var(--card-border-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.7);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(220, 53, 69, 0.15);
  color: var(--danger);
  border: 1px solid rgba(220, 53, 69, 0.25);
}

.btn-danger:hover {
  background: rgba(220, 53, 69, 0.25);
  color: var(--danger-hover);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn-icon {
  width: 20px;
  height: 20px;
}

/* ---- Glass Card ---- */
.glass-card {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-lg);
}

.glass-card-inner {
  background: var(--dark-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  padding: 16px;
  margin-bottom: 12px;
}

/* ==============================
   LANDING PAGE
   ============================== */

.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

.landing-hero {
  text-align: center;
  margin-bottom: 60px;
  animation: fadeInDown 0.7s ease-out;
}

.landing-title {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary-green);
  -webkit-text-fill-color: var(--primary-green);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.landing-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 500px;
  margin: 0 auto;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 800px;
  width: 100%;
  animation: fadeInUp 0.7s ease-out 0.15s both;
}

.landing-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.landing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(26, 122, 66, 0.04) 0%, transparent 70%);
  transition: var(--transition);
}

.landing-card:hover {
  transform: translateY(-8px);
  border-color: var(--card-border-hover);
  box-shadow: var(--shadow-lg);
}

.landing-card:hover::before {
  background: radial-gradient(circle at 50% 0%, rgba(26, 122, 66, 0.08) 0%, transparent 70%);
}

.landing-card-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

.landing-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--accent-gold);
}

.landing-card-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.landing-card-arrow {
  display: inline-block;
  margin-top: 20px;
  font-size: 1.1rem;
  color: var(--accent-gold);
  opacity: 0;
  transform: translateY(10px);
  transition: var(--transition);
}

.landing-card:hover .landing-card-arrow {
  opacity: 1;
  transform: translateY(0);
}

/* ==============================
   BANNER MAKER (Profile Picture)
   ============================== */

/* Upload Section */
.upload-section {
  margin-bottom: 3rem;
}

.upload-area {
  background: #fff;
  border: 2px dashed rgba(26, 122, 66, 0.25);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.upload-area:hover {
  border-color: var(--primary-green);
  background: rgba(26, 122, 66, 0.03);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.upload-area.dragover {
  border-color: var(--accent-gold);
  background: rgba(201, 162, 39, 0.06);
  transform: scale(1.02);
}

.upload-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  color: var(--primary-green);
  opacity: 0.7;
}

.upload-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.upload-text {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

/* Editor */
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.editor-controls {
  display: flex;
  gap: 1rem;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.canvas-container {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow);
}

#editorCanvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
  cursor: move;
  box-shadow: var(--shadow);
}

.canvas-instructions {
  margin-top: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.editor-sidebar {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--accent-gold);
}

.size-control {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--card-border);
}

.control-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.size-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin-bottom: 0.5rem;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-gradient);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
}

.size-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-gradient);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
}

.size-value {
  display: block;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-gold);
}

/* Banner Grid */
.banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.banner-grid::-webkit-scrollbar {
  width: 6px;
}

.banner-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

.banner-grid::-webkit-scrollbar-thumb {
  background: rgba(26, 122, 66, 0.3);
  border-radius: 3px;
}

.banner-option {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.banner-option:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--accent-gold);
}

.banner-option.selected {
  border-color: var(--primary-green);
  background: rgba(26, 122, 66, 0.05);
  box-shadow: 0 0 12px rgba(26, 122, 66, 0.12);
}

.banner-preview {
  width: 100%;
  height: 100px;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
  background-size: cover;
  background-position: center;
}

.banner-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.banner-description {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==============================
   TEMPLATE MAKER (Post Maker)
   ============================== */

/* Gallery */
.gallery-hero {
  text-align: center;
  margin-bottom: 40px;
}

.gallery-hero h2 {
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
}

.subtitle {
  color: var(--text-secondary);
  margin-top: 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.gallery-card {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-gold);
}

.gallery-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-card:hover .gallery-thumb img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-card:hover .gallery-overlay {
  opacity: 1;
}

.gallery-cta {
  font-weight: 600;
  color: var(--accent-gold);
  font-size: 0.95rem;
}

.gallery-info {
  padding: 16px;
}

.gallery-info h3 {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Template Editor */
.editor-main {
  display: flex;
  min-height: auto;
  position: relative;
  z-index: 1;
}

.canvas-wrapper {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8px;
  overflow: auto;
}

.canvas-wrapper .canvas-container {
  max-width: 100%;
  max-height: 60vh;
}

.canvas-wrapper .canvas-container canvas {
  max-width: 100%;
  height: auto !important;
}

@media (min-width: 1024px) {
  .editor-main {
    height: calc(100vh - 120px);
    overflow: hidden;
  }

  .canvas-wrapper {
    flex: 1;
    height: 100%;
    align-items: center;
    padding: 4px;
  }

  .canvas-wrapper .canvas-container {
    max-height: calc(100vh - 140px);
  }

  .canvas-wrapper .canvas-container canvas {
    max-height: calc(100vh - 150px);
    width: auto !important;
  }

  .editor-sidebar-template {
    height: calc(100vh - 120px);
    overflow-y: auto;
  }
}

.editor-sidebar-template {
  width: 300px;
  background: #fff;
  border-left: 1px solid var(--card-border);
  padding: 20px;
  overflow-y: auto;
  flex-shrink: 0;
}

.editor-sidebar-template h3 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-gold);
  margin-bottom: 14px;
}

.editor-sidebar-template hr {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 20px 0;
}

.hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Editor top controls – 3 buttons in one compact row */
.editor-top-controls {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px 4px;
  position: relative;
  z-index: 10;
}

.editor-top-controls .btn-small {
  padding: 0.4rem 0.6rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* Mobile photo action buttons (remove bg / delete) */
.mobile-photo-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px 8px;
  position: relative;
  z-index: 10;
}

@media (min-width: 1024px) {
  .editor-top-controls .btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .mobile-photo-actions {
    display: none !important;
  }
}

/* ==============================
   FORMS
   ============================== */
.form-section {
  padding: 32px;
  margin-bottom: 40px;
}

.form-section h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  font-weight: 600;
  color: var(--accent-gold);
}

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

.form-grid.four-col {
  grid-template-columns: repeat(4, 1fr);
}

.form-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.form-group select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-group select option {
  background: #fff;
  color: var(--text-primary);
  padding: 8px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(26, 122, 66, 0.1);
  background: #fff;
}

.form-group input[type="color"] {
  height: 42px;
  padding: 4px;
  cursor: pointer;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input[type="range"] {
  padding: 0;
  background: transparent;
  border: none;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
}

.form-group input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.form-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold-gradient);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

.form-group input[type="range"]:focus {
  box-shadow: none;
}

/* File upload */
.file-upload {
  position: relative;
}

.file-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: var(--dark-bg);
  border: 2px dashed var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
  cursor: pointer;
}

.file-upload:hover .file-upload-label {
  border-color: var(--primary-green);
  background: rgba(26, 122, 66, 0.03);
  color: var(--text-primary);
}

.file-icon {
  font-size: 1.5rem;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

/* ==============================
   ADMIN PANELS
   ============================== */

/* Template grid (Admin) */
.templates-section h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--accent-gold);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.template-card {
  transition: var(--transition);
}

.template-card:hover {
  transform: translateY(-4px);
  background: var(--card-bg-hover);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  border-color: var(--accent-gold);
}

.template-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-info {
  padding: 16px;
}

.template-info h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.template-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* Canvas toolbar */
.canvas-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tool-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: var(--primary-green);
  box-shadow: 0 2px 12px rgba(45, 122, 46, 0.3);
}

.admin-canvas-container {
  position: relative;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 70vh;
  background: var(--dark-bg);
}

.admin-canvas-container canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Popup overlay */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup {
  padding: 28px;
  min-width: 380px;
  max-width: 90vw;
}

.popup h3 {
  font-size: 1.2rem;
  margin-bottom: 18px;
  font-weight: 600;
  color: var(--accent-gold);
}

/* Edit preview */
.edit-preview {
  margin-bottom: 24px;
  max-width: 400px;
}

.edit-preview .preview-img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

/* Banner Contacts Admin */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-box {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 3rem;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  text-align: center;
}

.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.error-message {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  display: none;
}

.error-message.show {
  display: block;
}

/* Dashboard */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.table-container {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.table-title {
  font-size: 1.5rem;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(26, 122, 66, 0.06);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--accent-gold);
  border-bottom: 2px solid var(--card-border);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--card-border);
}

tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

.message-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-cell {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.photo-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.3s ease;
  border: 1px solid var(--card-border);
}

.photo-thumbnail:hover {
  transform: scale(1.15);
}

/* Photo Modal */
.photo-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.photo-modal.active {
  display: flex;
}

.photo-modal img {
  max-width: 90%;
  max-height: 90%;
  border-radius: var(--radius);
}

.photo-modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.photo-modal-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: rotate(90deg);
}

/* ==============================
   MODALS
   ============================== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--card-border);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--accent-gold);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
}

.modal-description {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.modal-actions .btn {
  flex: 1;
}

/* ==============================
   LOADING
   ============================== */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
}

.loading-overlay.active {
  display: flex;
}

.spinner-container {
  text-align: center;
}

.spinner {
  width: 56px;
  height: 56px;
  border: 3px solid var(--card-border);
  border-top-color: var(--primary-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

.spinner-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.spinner-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.loading .spinner {
  border: 3px solid var(--card-border);
  border-top: 3px solid var(--primary-green);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

/* ==============================
   UTILITIES
   ============================== */
.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* ==============================
   ANIMATIONS
   ============================== */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

/* ==============================
   RESPONSIVE
   ============================== */
@media (max-width: 768px) {
  .landing-title {
    font-size: 2.5rem;
  }

  .landing-grid {
    grid-template-columns: 1fr;
  }

  .landing-card {
    padding: 36px 24px;
  }

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .editor-header {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-controls {
    flex-direction: column;
  }

  .banner-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .section-title {
    font-size: 1.5rem;
    text-align: center;
  }

  .editor-main {
    flex-direction: column;
    height: auto;
  }

  .editor-sidebar-template {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--card-border);
  }

  .canvas-wrapper {
    min-height: auto;
  }

  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .form-grid.four-col {
    grid-template-columns: repeat(2, 1fr);
  }

  .table-container {
    padding: 1rem;
  }

  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 0.75rem 0.5rem;
  }

  .photo-thumbnail {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-grid.four-col {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   LIQUID GLASS – ALL SCREENS
   Apple-style frosted glass aesthetic
   ============================== */

/* --- Background layer --- */
.lg-bg {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

/* ---- Clean white body ---- */
body {
  background: #fff;
}

body::before {
  background: none;
}

/* ---- Floating glass orbs ---- */
.lg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  will-change: transform;
}

.lg-orb-1 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(26, 122, 66, 0.6) 0%, rgba(26, 122, 66, 0) 70%);
  top: -80px;
  left: -60px;
  animation: lgDrift1 12s ease-in-out infinite;
}

.lg-orb-2 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.5) 0%, rgba(201, 162, 39, 0) 70%);
  top: 25%;
  right: -70px;
  animation: lgDrift2 15s ease-in-out infinite;
}

.lg-orb-3 {
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(34, 145, 90, 0.45) 0%, rgba(34, 145, 90, 0) 70%);
  bottom: 15%;
  left: -50px;
  animation: lgDrift3 18s ease-in-out infinite;
}

.lg-orb-4 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(219, 185, 58, 0.4) 0%, rgba(219, 185, 58, 0) 70%);
  bottom: -30px;
  right: 15%;
  animation: lgDrift4 14s ease-in-out infinite;
}

/* ---- Logo watermark behind card ---- */
.lg-watermark {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30vw;
  max-width: 280px;
  opacity: 0.3;
  pointer-events: none;
  z-index: 1;
}

/* ---- Hero background photo ---- */
.lg-hero-bg {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 35vw;
  max-width: 450px;
  height: auto;
  object-fit: contain;
  opacity: 1;
  pointer-events: none;
  border-radius: 0;
  z-index: 2;
}

/* ---- Topbar: frosted glass ---- */
.topbar {
  background: rgba(13, 61, 31, 0.92);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 4px 24px rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- Tab bar: glass pills ---- */
.tab-bar {
  position: relative;
  z-index: 2;
}

.main-tabs {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 4px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 4px 16px rgba(0, 0, 0, 0.04);
}

.main-tab {
  color: var(--text-secondary);
}

.main-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.15);
}

.main-tab.active {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-primary);
  font-weight: 700;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 4px 12px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

/* ---- Container ---- */
.container {
  position: relative;
  z-index: 2;
}

/* ---- Upload area: frosted glass card ---- */
.upload-area {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2) inset,
    0 8px 32px rgba(0, 0, 0, 0.04);
}

.upload-area:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 12px 40px rgba(0, 0, 0, 0.08);
}

/* ---- Buttons: clear glass ---- */
.btn-gold {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 4px 16px rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
  font-weight: 700;
}

.btn-gold:hover {
  background: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 6px 24px rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--text-primary);
}

/* ---- Editor section: glass panels ---- */
.canvas-container {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 32px rgba(0, 0, 0, 0.15);
}

.editor-sidebar {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 8px 32px rgba(0, 0, 0, 0.15);
}

.sidebar-title {
  color: var(--gold-light);
}

.section-title {
  color: var(--text-primary);
}

/* ---- Banner grid items: glass ---- */
.banner-option {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

.banner-option:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(201, 162, 39, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.banner-option.selected {
  background: rgba(26, 122, 66, 0.15);
  border-color: rgba(26, 122, 66, 0.4);
  box-shadow:
    0 0 0 2px rgba(26, 122, 66, 0.2),
    0 4px 16px rgba(0, 0, 0, 0.2);
}

/* ---- Modal: frosted glass ---- */
.modal {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-content {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(28px) saturate(1.8);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 16px 64px rgba(0, 0, 0, 0.15);
}

.modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* ---- Template page heading decorations ---- */
.template-heading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.template-deco-text {
  font-size: 0.85rem;
  font-weight: 800;
  color: rgba(26, 122, 66, 0.15);
  letter-spacing: 0.05em;
  user-select: none;
  white-space: nowrap;
}

.template-deco-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.25;
}

@media (min-width: 1024px) {

  .template-deco-text,
  .template-deco-icon {
    display: none;
  }
}

/* ---- Mobile decorative symbols section ---- */
.mobile-deco {
  text-align: center;
  padding: 16px 0 8px;
  position: relative;
  z-index: 2;
}

.mobile-deco-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.mobile-deco-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  opacity: 0.25;
}

.mobile-deco-label {
  font-size: 1.3rem;
  font-weight: 800;
  color: rgba(26, 122, 66, 0.15);
  letter-spacing: 0.08em;
  user-select: none;
}

@media (min-width: 1024px) {
  .mobile-deco {
    display: none;
  }
}

/* ---- Desktop decorative symbols and text ---- */
.deco-symbol,
.deco-text {
  display: none;
}

@media (min-width: 1024px) {
  #editorCanvas {
    max-height: 50vh;
    width: auto !important;
    max-width: 100%;
    margin: 0 auto;
  }

  .canvas-container {
    display: flex;
    justify-content: center;
    padding: 1rem;
  }

  .deco-symbol {
    display: block;
    position: absolute;
    width: 220px;
    height: auto;
    opacity: 0.12;
    pointer-events: none;
    z-index: 1;
    top: 50%;
    transform: translateY(-50%);
  }

  .deco-left {
    left: 40px;
  }

  .deco-right {
    right: 40px;
    transform: translateY(-50%) scaleX(-1);
  }

  .deco-text {
    display: block;
    position: absolute;
    font-size: 6rem;
    font-weight: 900;
    color: rgba(26, 122, 66, 0.14);
    pointer-events: none;
    z-index: 0;
    white-space: nowrap;
    letter-spacing: 0.05em;
    font-family: 'Inter', sans-serif;
    top: 50%;
    user-select: none;
  }

  .deco-text-left {
    left: 60px;
    transform: translateY(-50%) rotate(-90deg);
    transform-origin: left center;
  }

  .deco-text-right {
    right: 150px;
    top: 70%;
    transform: translateY(-50%) rotate(90deg);
    transform-origin: right center;
  }
}

/* ---- Mobile-specific adjustments ---- */
@media (max-width: 768px) {
  .lg-hero-bg {
    left: 50%;
    transform: translateX(-50%);
    width: 85vw;
    max-width: 400px;
  }

  .lg-watermark {
    width: 55vw;
    max-width: 240px;
  }

  /* ---- Smaller orbs on mobile ---- */
  .lg-orb-1 {
    width: 260px;
    height: 260px;
    top: -60px;
    left: -40px;
  }

  .lg-orb-2 {
    width: 200px;
    height: 200px;
  }

  .lg-orb-3 {
    width: 180px;
    height: 180px;
  }

  .lg-orb-4 {
    width: 140px;
    height: 140px;
  }

  .topbar-inner {
    height: 56px;
    padding: 0;
  }

  .logo {
    font-size: 1.1rem;
  }

  .tab-bar {
    padding: 16px 16px 0;
  }

  .main-tab {
    font-size: 0.8rem;
    padding: 0.6rem 1rem;
    border-radius: 16px;
  }

  .container {
    padding: 20px 16px;
  }

  .hero-section {
    padding: 24px 16px 16px;
  }

  .upload-section {
    margin-bottom: 2rem;
  }

  .upload-area {
    padding: 1.8rem 1.2rem;
  }

  .upload-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.2rem;
  }

  .upload-title {
    font-size: 1.4rem;
  }

  .upload-text {
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
  }

  .canvas-container {
    padding: 1.2rem;
  }

  .editor-sidebar {
    padding: 1.2rem;
  }

  .editor-header {
    margin-bottom: 1.2rem;
  }
}

/* ---- Liquid Glass Keyframes ---- */
@keyframes lgGradientShift {
  0% {
    background-position: 0% 50%;
  }

  25% {
    background-position: 50% 100%;
  }

  50% {
    background-position: 100% 50%;
  }

  75% {
    background-position: 50% 0%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes lgDrift1 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(40px, 60px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 30px) scale(0.95);
  }
}

@keyframes lgDrift2 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(-50px, -40px) scale(1.15);
  }

  66% {
    transform: translate(30px, -60px) scale(0.9);
  }
}

@keyframes lgDrift3 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(60px, -30px) scale(1.05);
  }

  66% {
    transform: translate(-40px, 50px) scale(1.1);
  }
}

@keyframes lgDrift4 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-30px, -50px) scale(1.2);
  }
}