:root {
  --primary: #FF5E7E; /* Bright Pinkish Red */
  --primary-hover: #ff4768;
  --secondary: #00D2D3; /* Bright Cyan */
  --secondary-hover: #00b8b8;
  --bg-color: #FFF3E0; /* Warm pastel orange/peach */
  --text-main: #2d3748;
  --text-light: #4a5568;
  --card-bg: rgba(255, 255, 255, 0.95);
  --glass-border: rgba(255, 255, 255, 0.6);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 20px -5px rgba(255, 94, 126, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(255, 94, 126, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius-sm: 16px; /* more rounded, kid friendly */
  --radius-md: 24px;
  --radius-lg: 32px;
  --font-heading: 'Nunito', sans-serif;
  --font-body: 'Quicksand', sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: var(--bg-color);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.2;
}

/* Typography Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), #FFA07A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Layout */
#app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Status Messages */
#status-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.status-card {
  max-width: 500px;
  text-align: center;
  padding: 3rem;
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-lg);
}

.status-card h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 45vh;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(255,243,224,0.4), rgba(255,243,224,0.95));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-lg);
  border: 4px solid rgba(255, 255, 255, 0.9);
}

.business-name {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--secondary);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  margin-bottom: 1rem;
  color: #2d3748;
}

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

/* Main Content Structure */
.main-content {
  max-width: 1000px;
  margin: -2rem auto 2rem auto; /* Overlap hero */
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 0 1rem;
  flex: 1;
}

/* Tabs */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tab-btn {
  background: #fff;
  border: 3px solid transparent;
  padding: 1rem 2rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-light);
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
  color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 94, 126, 0.2);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 6px 20px rgba(255, 94, 126, 0.4);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.tab-panel.active {
  display: block;
}

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

/* Forms & Inputs */
.contest-form {
  padding: 3rem;
  max-width: 700px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: var(--text-main);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-row {
  display: flex;
  gap: 1.5rem;
}

.form-group.half {
  flex: 1;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-size: 1rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 3px solid #edf2f7;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.05rem;
  transition: all 0.2s ease;
  background: #fff;
  color: var(--text-main);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px rgba(0, 210, 211, 0.2);
}

select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a5568' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

/* File Upload Custom UI */
.file-upload-group {
  position: relative;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.file-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  border: 3px dashed #cbd5e0;
  border-radius: var(--radius-md);
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.file-upload-label:hover {
  border-color: var(--primary);
  background: #fff5f7;
  transform: translateY(-2px);
}

.upload-icon {
  color: var(--secondary);
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.file-upload-label:hover .upload-icon {
  transform: scale(1.1);
}

.upload-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.file-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  word-break: break-all;
}

#image-preview-container {
  position: relative;
  margin-top: 1rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

#image-preview {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
  background: #fff;
  border: 2px solid #edf2f7;
  border-radius: var(--radius-md);
}

#remove-image-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

#remove-image-btn:hover {
  background: rgba(255, 94, 126, 0.9);
  transform: scale(1.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border-radius: 99px; /* Very rounded, kid-friendly */
  font-family: var(--font-heading);
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.btn-large {
  width: 100%;
  padding: 1.2rem;
  font-size: 1.2rem;
  margin-top: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(255, 94, 126, 0.3);
}

.btn-secondary {
  background: #fff;
  color: var(--text-main);
  border: 2px solid #e2e8f0;
}

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

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-weight: 700;
  text-align: center;
}
.alert-error {
  background: #fff5f5;
  color: #c53030;
  border: 2px solid #feb2b2;
}

/* Loader */
.loader {
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top: 3px solid white;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loader-container { display: flex; justify-content: center; padding: 2rem; }
.spinner {
  border: 4px solid rgba(0, 210, 211, 0.2);
  border-top: 4px solid var(--secondary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* Post Entry State */
.post-entry-state {
  padding: 3rem;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.success-icon {
  margin-bottom: 1rem;
}

.success-msg {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.submitted-photo-wrapper {
  margin-bottom: 2rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: #fff;
  padding: 1rem;
  border: 2px solid #edf2f7;
}

#submitted-photo {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
  margin: 0 auto;
  max-height: 300px;
  object-fit: contain;
}

.submitted-caption {
  margin-top: 1rem;
  font-style: italic;
  font-weight: 500;
  color: var(--text-light);
}

.share-section {
  background: #f8fafc;
  padding: 2rem;
  border-radius: var(--radius-md);
  border: 2px solid #e2e8f0;
}

.share-section h3 {
  margin-bottom: 0.5rem;
}

.share-link-wrapper {
  display: flex;
  margin: 1.5rem 0;
  gap: 0.5rem;
}

.share-link-wrapper input {
  flex: 1;
  background: #fff;
  margin: 0;
  border-radius: 99px;
  padding-left: 1.5rem;
}

.social-share-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  gap: 0.5rem;
  color: white;
}
.fb-btn { background: #1877F2; }
.fb-btn:hover { background: #166fe5; }
.tw-btn { background: #000000; }
.tw-btn:hover { background: #333333; }

.bonus-panel {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #fffaf0;
  border: 2px dashed #feebc8;
  border-radius: var(--radius-md);
  color: #c05621;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.gallery-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 2px solid #edf2f7;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 210, 211, 0.3);
}

.gallery-card-img-wrapper {
  position: relative;
  padding-top: 100%; /* 1:1 Aspect ratio for grid */
  overflow: hidden;
  background: #edf2f7;
  border-bottom: 2px solid #edf2f7;
}

.gallery-card img {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.gallery-card-info {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gallery-card-author {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.gallery-card-caption {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
  flex: 1;
}

.gallery-card-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding-top: 0.8rem;
  border-top: 1px dashed #e2e8f0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 600px;
  margin: 2rem auto;
  border: 3px dashed #cbd5e0;
}
.empty-icon {
  color: var(--secondary);
  margin-bottom: 1rem;
}
.empty-state h3 { font-size: 1.8rem; margin-bottom: 0.5rem; color: var(--text-main); }
.empty-state p { font-size: 1.1rem; color: var(--text-light); margin-bottom: 2rem; font-weight: 500; }

.gallery-actions {
  text-align: center;
  margin-top: 2rem;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(45, 55, 72, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-container {
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

@media (min-width: 900px) {
  .lightbox-container {
    flex-direction: row;
    height: 80vh;
  }
}

.lightbox-close-btn {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(0,0,0,0.1);
  color: var(--text-main);
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
}
.lightbox-close-btn:hover { background: var(--primary); color: white; transform: scale(1.1); }

.lightbox-image-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  min-height: 300px;
}

#lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  color: var(--text-main);
  border: none;
  width: 50px; height: 50px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-md);
}
.lightbox-nav:hover { background: white; color: var(--primary); transform: translateY(-50%) scale(1.1); }
.lightbox-nav.prev { left: 1rem; }
.lightbox-nav.next { right: 1rem; }

.lightbox-details {
  width: 100%;
  background: #fff;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

@media (min-width: 900px) {
  .lightbox-details {
    width: 380px;
    min-width: 380px;
    border-left: 2px solid #edf2f7;
  }
}

.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px dashed #edf2f7;
}

.author-info {
  display: flex;
  flex-direction: column;
}
.author-label { font-size: 0.85rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 1px;}
#lightbox-author { font-size: 1.3rem; font-weight: 800; color: var(--text-main); }

.lightbox-caption {
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 500;
  color: var(--text-main);
  flex: 1;
  margin-bottom: 2rem;
}

/* Voting UI */
.btn-vote {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 2px solid #e2e8f0;
  padding: 0.6rem 1.2rem;
  border-radius: 99px;
  cursor: pointer;
  font-weight: 800;
  color: var(--text-main);
  transition: all 0.2s;
}

.btn-vote:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}

.btn-vote .heart-icon {
  transition: fill 0.2s, color 0.2s;
}

.btn-vote:hover:not(:disabled) .heart-icon {
  color: var(--primary);
}

.btn-vote.voted {
  background: #fff5f7;
  border-color: var(--primary);
  color: var(--primary);
  cursor: default;
}

.btn-vote.voted .heart-icon {
  fill: var(--primary);
  color: var(--primary);
}

.vote-count {
  background: #edf2f7;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.9rem;
}
.btn-vote.voted .vote-count { background: rgba(255,94,126,0.15); }

/* Card Vote Button Specifics */
.gallery-card .btn-vote {
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}
.gallery-card .btn-vote .vote-text { display: none; }

/* Lightbox Share */
.lightbox-share {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 2px dashed #edf2f7;
}
.share-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 0.8rem;
}
.mini-share-btns {
  display: flex;
  gap: 0.8rem;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  color: white; cursor: pointer; transition: transform 0.2s;
}
.icon-btn:hover { transform: scale(1.15); }
.icon-btn.fb { background: #1877F2; }
.icon-btn.tw { background: #000; }
.icon-btn.link { background: var(--secondary); }

/* Powered By Wrapper */
#wbx-powered-by-slot {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  padding-bottom: 2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero { padding: 3rem 1rem; }
  .form-row { flex-direction: column; gap: 0; }
  .contest-form { padding: 1.5rem; }
  .post-entry-state { padding: 1.5rem; }
  .share-link-wrapper { flex-direction: column; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); }
}