:root {
  --primary: #2C5E3B;
  --primary-hover: #1f4229;
  --secondary: #D9A05B;
  --secondary-hover: #c48c4a;
  --text-dark: #2d3748;
  --text-light: #718096;
  --bg-color: #F7F5F0;
  --white: #ffffff;
  --border: #e2e8f0;
  --error: #e53e3e;
}

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

body {
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
  background-color: var(--bg-color);
  line-height: 1.6;
}

.hidden { display: none !important; }

h1, h2, h3, h4 { font-family: 'Playfair Display', serif; }

.hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: white;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(44, 94, 59, 0.8) 100%);
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  max-width: 800px;
}

.tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.1;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.hero-details {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  background: rgba(0,0,0,0.2);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  display: inline-block;
}

.status-message {
  max-width: 1000px;
  margin: 2rem auto 0;
  padding: 1.5rem;
  background: var(--white);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 20px 4rem;
  display: flex;
  flex-direction: column;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.125rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.4s ease; }

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

.card {
  background: var(--white);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
  max-width: 600px;
  margin: 0 auto;
}

.card h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--primary);
  text-align: center;
}

.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

input[type="text"], input[type="email"], textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8fafc;
}

select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  width: 100%;
  padding: 0.875rem 1rem;
  padding-right: 2.5rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #f8fafc;
  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='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 94, 59, 0.1);
  background: var(--white);
}

.file-upload-wrapper {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
}

.file-upload-wrapper:hover {
  border-color: var(--primary);
  background: var(--white);
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-upload-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  text-align: center;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 6px rgba(44, 94, 59, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 6px 12px rgba(44, 94, 59, 0.3);
}
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

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

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

.error-msg {
  background: #fff5f5;
  color: var(--error);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid var(--error);
  margin-bottom: 1.5rem;
  font-weight: 600;
}

/* Post Entry View */
.my-submission {
  margin: 1.5rem 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.my-submission img { width: 100%; height: auto; display: block; }
.my-submission p { padding: 1rem; background: #f8fafc; font-style: italic; }

.share-panel {
  background: rgba(217, 160, 91, 0.1);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(217, 160, 91, 0.3);
  text-align: center;
}

.share-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.share-actions input { flex: 1; }
.share-actions .btn { width: auto; }

/* Gallery Grid */
.gallery-empty {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--white);
  border-radius: 16px;
}

.gallery-empty svg { margin-bottom: 1rem; opacity: 0.5; }
.gallery-empty h3 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-dark); }
.gallery-empty p { color: var(--text-light); margin-bottom: 1.5rem; }
.gallery-empty .btn { width: auto; }

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

.gallery-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.gc-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.gc-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gc-caption {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.gc-author {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

.vote-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.vote-count {
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.vote-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.vote-btn:hover:not(:disabled) { background: var(--primary-hover); }
.vote-btn.voted { background: var(--secondary); }
.vote-btn:disabled { cursor: not-allowed; opacity: 0.8; }

.load-more-wrapper { text-align: center; margin-top: 3rem; }
.load-more-wrapper .btn { width: auto; padding: 0.75rem 2rem; }

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(5px);
}

.lightbox-content {
  position: relative;
  z-index: 1001;
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  max-width: 900px;
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

@media(min-width: 768px) {
  .lightbox-content { flex-direction: row; }
  .lightbox-image-container { flex: 1.5; }
  .lightbox-details { width: 320px; border-left: 1px solid var(--border); }
}

.lightbox-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--white);
  font-size: 2rem;
  line-height: 1;
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1002;
}

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

.lightbox-image-container img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 1rem;
  cursor: pointer;
  font-size: 1.5rem;
  transition: background 0.2s;
  z-index: 1003;
}

.lightbox-nav:hover { background: rgba(0,0,0,0.8); }
.lightbox-prev { left: 0; }
.lightbox-next { right: 0; }

.lightbox-details {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  background: var(--white);
  overflow-y: auto;
}

.lightbox-header { flex: 1; margin-bottom: 2rem; }
.lightbox-header h3 { font-size: 1.25rem; margin-bottom: 0.5rem; font-family: 'Inter', sans-serif; font-weight: 400; }
.lightbox-author { color: var(--text-light); font-size: 0.9rem; }

.lightbox-actions { border-top: 1px solid var(--border); padding-top: 1.5rem; }
.lightbox-vote-container { margin-bottom: 1rem; }
.lightbox-vote-container .vote-btn { width: 100%; padding: 0.75rem; font-size: 1rem; }

.share-btn-icon {
  background: #f1f5f9; border: none; width: 40px; height: 40px;
  border-radius: 50%; cursor: pointer; font-size: 1.2rem; transition: background 0.2s;
}
.share-btn-icon:hover { background: #e2e8f0; }

#wbx-powered-by-slot { margin-top: auto; padding-top: 3rem; display: flex; justify-content: center; }

@media (max-width: 768px) {
  .hero { padding: 40px 15px; }
  .tabs { flex-direction: column; }
  .tab-btn { text-align: center; }
  .lightbox { padding: 0; }
  .lightbox-content { border-radius: 0; max-height: 100vh; height: 100vh; }
  .lightbox-close { color: #333; background: #fff; }
}