/* ============================================================
   BJP Poster Maker — Main Stylesheet
   File: assets/css/style.css
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --saffron: #FF6B00;
  --deep-saf: #E85C00;
  --green: #138808;
  --navy: #000080;
  --gold: #F4C430;
  --cream: #FFF8F0;
  --card-bg: #ffffff;
  --shadow: 0 8px 32px rgba(255, 107, 0, 0.15);
  --font-main: 'Anek Gujarati', 'Mukta', sans-serif;
  --font-heading: 'Anek Gujarati', 'Baloo Bhai 2', sans-serif;
}

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

/* ── Base ──────────────────────────────────────────────────── */
body {
  font-family: var(--font-main);
  background: linear-gradient(135deg, #fff3e0 0%, #fff8f0 40%, #e8f5e9 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #222;
  margin: 0;
  padding: 0;
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(90deg, #FF6B00 0%, #E85C00 50%, #138808 100%);
  padding: 0;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.04) 10px,
      rgba(255, 255, 255, 0.04) 20px);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
}

.header-logo {
  width: 56px;
  height: 56px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-title h1 {
  font-family: var(--font-heading);
  font-size: clamp(16px, 4vw, 24px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.2;
}

.header-title p {
  color: rgba(255, 255, 255, 0.85);
  font-size: clamp(12px, 2vw, 16px);
}

.lang-switcher {
  margin-left: auto;
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.lang-switcher a {
  padding: 6px 10px;
  text-decoration: none;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  transition: all 0.2s;
}

.lang-switcher a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lang-switcher a.active {
  background: #fff;
  color: var(--saffron);
}

/* ── Tricolour Divider ─────────────────────────────────────── */
.tricolour {
  height: 4px;
  background: linear-gradient(90deg,
      #FF6B00 33.33%,
      #ffffff 33.33% 66.66%,
      #138808 66.66%);
  margin-bottom: 20px;
  border-radius: 2px;
}

/* ── Main Layout ───────────────────────────────────────────── */
.main-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 760px) {
  .main-wrap {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .form-section {
    order: 1;
  }

  .poster-section {
    order: 2;
  }

  .header-inner {
    padding: 10px;
    gap: 8px;
  }

  .header-logo {
    width: 44px;
    height: 44px;
  }

  .tricolour {
    margin-bottom: 10px;
  }
}

/* ── Poster Canvas Section ─────────────────────────────────── */
.poster-section {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 107, 0, 0.1);
}

.poster-section h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--saffron);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f0f0f0;
  aspect-ratio: 4 / 5;
  width: 100%;
}

#posterCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
}

.canvas-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--saffron), var(--deep-saf));
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.45);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--green), #0d6e07);
  color: #fff;
  box-shadow: 0 4px 14px rgba(19, 136, 8, 0.3);
}

.btn-secondary:hover {
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--saffron);
  color: var(--saffron);
  flex: none;
  padding: 12px 18px;
}

.btn-outline:hover {
  background: var(--cream);
}

/* ── Form Section ──────────────────────────────────────────── */
.form-section {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 107, 0, 0.1);
  width: 100%;
}

.form-section h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--saffron);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-family: var(--font-main);
  font-size: 15px;
  color: #222;
  transition: border 0.2s, box-shadow 0.2s;
  background: #fafafa;
}

.form-group input:focus {
  outline: none;
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.12);
  background: #fff;
}

/* ── Photo Upload ──────────────────────────────────────────── */
.photo-upload-area {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
  position: relative;
}

.photo-upload-area:hover {
  border-color: var(--saffron);
  background: var(--cream);
}

.photo-upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.photo-upload-area .upload-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.photo-upload-area p {
  font-size: 14px;
  color: #888;
}

.photo-upload-area .uploaded-preview {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f1c25a;
  margin: 0 auto 8px;
  display: block;
}

/* ── Submit Button ─────────────────────────────────────────── */
.submit-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--saffron), var(--deep-saf));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.35);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(255, 107, 0, 0.45);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ── Toast Notification ────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a1a;
  color: #fff;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-left: 4px solid #4caf50;
}

.toast.error {
  border-left: 4px solid #f44336;
}

/* ── Cropper Modal ─────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: #1a1a1a;
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
}

.modal-box h3 {
  color: #fff;
  font-family: var(--font-heading);
  font-size: 18px;
  margin-bottom: 16px;
}

.crop-container {
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}

#cropImage {
  max-width: 100%;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ── Canvas Loading Overlay ────────────────────────────────── */
.canvas-loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 14px;
  color: var(--saffron);
  font-weight: 600;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--saffron);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 10px;
}

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

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  padding: 12px 20px 0;
  /* No bottom padding to 'touch' the bottom */
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 107, 0, 0.1);
  text-align: center;
}

.footer-inner p {
  margin: 0;
  padding: 0 0 4px 0;
  /* Tiny bit of space for the logo descenders but mostly touching */
  font-size: clamp(14px, 2vw, 18px);
  color: #666;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--saffron);
  transition: opacity 0.2s;
}

.footer-inner a:hover {
  background: var(--saffron);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25);
}

.footer-logo-link:hover {
  opacity: 0.8;
}

.heart {
  color: #e91e63;
  display: inline-block;
  font-size: 18px;
  margin: 0 4px;
}

.company-logo {
  display: inline-block;
  vertical-align: middle;
  height: 24px !important;
  width: auto !important;
  max-width: 150px;
  color: inherit; /* Ensure currentColor works */
}