:root {
  --primary: #FF5A00;
  --primary-hover: #E65100;
  --secondary: #00A651;
  --tertiary: #222222;
  --bg-main: #F4F7F6;
  --bg-card: #FFFFFF;
  --text-main: #2C3E50;
  --text-muted: #606F7B;
  --border-color: rgba(0, 0, 0, 0.08);
  --success: #00A651;
  --error: #E74C3C;
  --radius: 16px;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

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

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

.hidden { display: none !important; }

/* Utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mt-4 { margin-top: 1rem; }

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 60px;
  padding-top: 80px;
  overflow: hidden;
}

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

.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(244, 247, 246, 0.85) 0%, rgba(244, 247, 246, 1) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-logo {
  max-width: 100%;
  width: 450px;
  height: auto;
  margin: 0 auto 24px auto;
  display: block;
}

.tagline {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(0, 166, 81, 0.1);
  border: 1px solid rgba(0, 166, 81, 0.2);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tagline:hover {
  background: rgba(0, 166, 81, 0.2);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--tertiary);
  text-transform: uppercase;
  letter-spacing: -1px;
}

.pre-heading {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  display: inline-block;
  margin-bottom: 4px;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px auto;
}

/* Tabs */
.nav-tabs {
  display: inline-flex;
  background: rgba(0,0,0,0.05);
  border-radius: 999px;
  padding: 6px;
  border: 1px solid rgba(0,0,0,0.05);
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 10px 24px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background: rgba(0,0,0,0.05);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 90, 0, 0.3);
}

/* Main Content */
.main-container {
  flex: 1;
  padding: 40px 0 80px 0;
  display: flex;
  flex-direction: column;
}

.main-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.card-header {
  text-align: center;
  margin-bottom: 30px;
}

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.card-header p {
  color: var(--text-muted);
}

/* Forms */
.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-main);
}

input[type="text"],
input[type="email"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  background: #FFFFFF;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s ease;
}

textarea {
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 90, 0, 0.15);
}

select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  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='%232C3E50' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

select option {
  background: #FFFFFF;
  color: var(--text-main);
}

.media-upload-section {
  background: rgba(0,0,0,0.02);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
  border: 1px dashed rgba(0,0,0,0.15);
}

.media-toggle {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-main);
}

.file-drop-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: rgba(0,0,0,0.01);
  border: 2px dashed rgba(0,0,0,0.15);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}

.file-drop-area:hover, .file-drop-area.dragover {
  background: rgba(255, 90, 0, 0.05);
  border-color: var(--primary);
}

.file-drop-area svg {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.file-msg {
  font-weight: 600;
  color: var(--text-muted);
}

.file-input {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

.help-text {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 90, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
  box-shadow: 0 8px 25px rgba(255, 90, 0, 0.4);
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid rgba(0,0,0,0.15);
}

.btn-secondary:hover {
  background: #F4F7F6;
}

.btn-block {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
}

/* Status / Errors */
.error-msg {
  background: rgba(231, 76, 60, 0.1);
  border-left: 4px solid var(--error);
  padding: 16px;
  margin-bottom: 20px;
  border-radius: 4px;
  color: var(--error);
}

.status-panel {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  margin-bottom: 40px;
  border: 1px solid var(--border-color);
}

/* Success Card */
.success-card {
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 166, 81, 0.1);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
}

.success-icon svg {
  width: 40px; height: 40px;
}

.share-panel {
  margin: 30px 0;
  padding: 24px;
  background: #F9F9F9;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
}

.share-controls {
  display: flex;
  gap: 10px;
  margin: 16px 0;
}

.social-shares {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-social {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  color: white;
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-fb { background: #1877f2; }
.btn-tw { background: #000; border: 1px solid #333; }

/* Rules Section */
.rules-card h2 {
  font-family: var(--font-heading);
  margin-bottom: 30px;
  text-align: center;
  color: var(--secondary);
}

.rule-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.rule-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.rule-section h3 {
  color: var(--text-main);
  margin-bottom: 12px;
  font-size: 1.2rem;
}

.rule-content {
  color: var(--text-muted);
}

.rule-content p {
  margin-bottom: 12px;
}

.rule-content p:last-child {
  margin-bottom: 0;
}

.rule-content h4 {
  color: var(--text-main);
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.rule-content ul {
  margin-left: 24px;
  margin-bottom: 16px;
}

.rule-content li {
  margin-bottom: 6px;
}

.rule-content a { color: var(--secondary); }


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

.gallery-header h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  margin-bottom: 10px;
}

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

.gallery-item {
  background: #FFFFFF;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.12);
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #F4F7F6;
}

.gallery-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gallery-caption {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
  font-size: 1.05rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex: 1;
}

.vote-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.btn-vote {
  background: rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.1);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-vote:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-vote:disabled {
  background: rgba(0, 166, 81, 0.1);
  border-color: rgba(0, 166, 81, 0.3);
  color: var(--success);
  cursor: default;
}

.vote-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state svg {
  width: 64px; height: 64px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.load-more-container {
  text-align: center;
}

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

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

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

.lightbox-media-container {
  width: 100%;
  height: 45vh;
  background: #F4F7F6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media-container img,
.lightbox-media-container iframe,
.lightbox-media-container video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.lightbox-info {
  padding: 24px;
  display: flex;
  flex-wrap: nowrap;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--bg-card);
  max-height: 45vh;
}

.lightbox-header { 
  flex: 1; 
  min-width: 250px; 
  max-height: 100%;
  display: flex;
  flex-direction: column;
}
.lightbox-header h3 { font-size: 1.5rem; margin-bottom: 4px; color: var(--text-main); }
.lightbox-author { color: var(--text-muted); margin-bottom: 12px; }

.lightbox-desc {
  flex: 1;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
  overflow-y: auto;
  padding-right: 10px;
}

.lightbox-essay {
  margin-top: 12px;
  padding: 16px;
  background: rgba(0,0,0,0.03);
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

.external-link {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
  word-break: break-all;
}

.lightbox-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 200px;
}

.lightbox-share p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.share-icons {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  border: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover { background: var(--primary); color: #fff; }
.btn-icon svg { width: 18px; height: 18px; }

.lightbox-close {
  position: absolute;
  top: 20px; right: 20px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: white;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover { background: var(--primary); }
.lightbox-close svg { width: 24px; height: 24px; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: none;
  color: white;
  width: 50px; height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.lightbox-nav:hover { background: var(--primary); }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }
.lightbox-nav svg { width: 30px; height: 30px; }

/* Loader */
.btn-loader {
  display: inline-block;
  width: 20px; height: 20px;
  border: 3px solid rgba(255, 90, 0, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Powered By slot container logic */
#wbx-powered-by-slot {
  margin-top: auto;
  padding-top: 40px;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .form-row { flex-direction: column; gap: 0; }
  .nav-tabs { flex-direction: column; width: 100%; border-radius: 12px; }
  .tab-btn { border-radius: 8px; }
  .lightbox-nav { top: auto; bottom: 20px; }
  .lightbox-nav.prev { left: 30%; }
  .lightbox-nav.next { right: 30%; }
  .lightbox-content { max-height: 85vh; }
  .lightbox-media-container { height: 35vh; }
  .lightbox-info { flex-wrap: wrap; max-height: none; overflow-y: auto; }
}