:root {
  --primary: #c1121f; /* Festive Red */
  --primary-hover: #780000;
  --secondary: #003049; /* Winter Night Blue */
  --accent: #669bbc; /* Frost Blue */
  --text-dark: #1e293b;
  --text-light: #f8fafc;
  --text-muted: #64748b;
  --bg-color: #f0f4f8; /* Soft winter background */
  --surface: #ffffff;
  --border: #e2e8f0;
  --error: #ef4444;
  --success: #22c55e;
  
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 25px rgba(0,0,0,0.08);
  --shadow-hover: 0 15px 35px rgba(0,0,0,0.12);
  
  --font-head: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at top right, rgba(255,255,255,0.8), transparent), 
                    linear-gradient(135deg, #e0eaf5 0%, #f4f7fb 100%);
  background-attachment: fixed;
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* Main Container */
.main-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Hero Section */
.hero-header {
  position: relative;
  background: #fff;
}

.hero-image-wrapper {
  width: 100%;
  height: 380px;
  overflow: hidden;
  position: relative;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-image-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 150px;
  background: linear-gradient(to top, rgba(255,255,255,1), transparent);
}

.logos-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  margin-bottom: 24px;
  padding: 0 20px;
}

.sponsor-logo {
  height: 100px;
  object-fit: contain;
  display: block;
  max-width: 100%;
}

.hero-content {
  text-align: center;
  padding: 20px 40px 40px 40px;
  background: #fff;
  position: relative;
  z-index: 2;
}

.campaign-title {
  font-family: var(--font-head);
  font-size: 3rem;
  font-weight: 800;
  color: var(--secondary);
  line-height: 1.1;
}

/* Navigation Tabs */
.contest-nav {
  display: flex;
  flex-wrap: wrap;
  background: #fff;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-btn {
  flex: 1;
  padding: 20px 15px;
  font-size: 1.125rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 4px solid transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.3s ease;
  font-family: inherit;
}

.nav-btn:hover {
  color: var(--secondary);
  background-color: #f8fafc;
}

.nav-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background-color: #fffafb;
}

/* Tab Content */
.content-wrapper {
  background: #fff;
}

.tab-content {
  padding: 40px;
}

/* Contest Info, FAQs, & Rules Tabs */
.lead-text {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--secondary);
  margin-bottom: 16px;
}

.sponsor-credit {
  font-weight: 600;
  color: var(--primary);
  margin-top: 16px;
}

.info-section, .long-rules, .faq-section {
  color: var(--text-dark);
}

.info-section h3, .long-rules h3, .faq-section h3 {
  font-family: var(--font-head);
  color: var(--secondary);
  font-size: 1.5rem;
  margin: 32px 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.long-rules h2, .faq-section h2 {
  font-family: var(--font-head);
  color: var(--primary);
  font-size: 2rem;
  margin-bottom: 24px;
  line-height: 1.2;
}

.long-rules h4, .faq-section h4 {
  font-family: var(--font-head);
  color: var(--primary);
  font-size: 1.25rem;
  margin: 24px 0 12px 0;
}

.info-section p, .long-rules p, .faq-section p {
  margin-bottom: 16px;
}
.info-section p:last-child, .long-rules p:last-child, .faq-section p:last-child {
  margin-bottom: 0;
}

.rules-meta {
  background: #f8fafc;
  padding: 24px;
  border-radius: var(--radius-md);
  border-left: 6px solid var(--accent);
  margin-bottom: 32px;
}

.rules-meta p {
  margin-bottom: 8px;
}
.rules-meta p:last-child {
  margin-bottom: 0;
}

.info-section ul, .long-rules ul, .faq-section ul {
  padding-left: 24px;
  margin-bottom: 20px;
}
.info-section ol, .faq-section ol {
  padding-left: 24px;
  margin-bottom: 20px;
}
.info-section li, .long-rules li, .faq-section li {
  margin-bottom: 8px;
}

.inline-link {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}
.inline-link:hover {
  color: var(--primary-hover);
}

/* Form Styles */
.form-header {
  text-align: center;
  margin-bottom: 32px;
}

.form-header h2 {
  font-family: var(--font-head);
  font-size: 2.25rem;
  color: var(--secondary);
  margin-bottom: 8px;
}

.form-row {
  display: flex;
  gap: 24px;
}

.form-row > * {
  flex: 1;
}

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

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--secondary);
}

input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: #f8fafc;
  color: var(--text-dark);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(102, 155, 188, 0.2);
}

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

.file-input {
  background: #fff;
  padding: 10px;
}

/* Checkbox Group */
.checkbox-group {
  background: #f8fafc;
  padding: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 32px 0;
}

.checkbox-group h4 {
  margin-bottom: 16px;
  color: var(--secondary);
}

.checkbox-group label {
  display: flex;
  align-items: flex-start;
  font-weight: 400;
  margin-bottom: 16px;
  color: var(--text-dark);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-group label:last-child {
  margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 4px;
  margin-right: 12px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  font-size: 1.125rem;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(193, 18, 31, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(193, 18, 31, 0.3);
}

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

.btn-secondary:hover:not(:disabled) {
  background-color: #001f30;
}

.btn-full {
  width: 100%;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

/* Status & Error Messages */
.error-message {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--error);
  padding: 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-weight: 500;
  text-align: center;
}

.status-message {
  text-align: center;
  padding: 60px 20px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  margin: 40px 0;
}

.status-message h2 {
  font-family: var(--font-head);
  font-size: 2.25rem;
  color: var(--secondary);
  margin-bottom: 12px;
}

.success-icon {
  width: 80px;
  height: 80px;
  background-color: #dcfce7;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
  font-size: 2.5rem;
  font-weight: bold;
}

.status-notice {
  background: #fff3cd;
  color: #856404;
  padding: 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  margin-top: 24px;
}

/* Gallery Controls & Grid */
.gallery-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 20px;
}

.gallery-controls h2 {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--secondary);
}

.gallery-controls select {
  width: auto;
  min-width: 240px;
  background-color: #fff;
}

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

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

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.gallery-media {
  height: 260px;
  background: #f1f5f9;
  position: relative;
}

.gallery-media img, .gallery-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-info {
  padding: 16px;
  flex-grow: 1;
}

.gallery-caption {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
  font-size: 1.05rem;
  line-height: 1.4;
}

.gallery-author {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.gallery-vote {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.vote-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s;
}

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

.vote-btn:disabled {
  background: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
}

.vote-btn.voted {
  background: var(--success);
  color: #fff;
}

.vote-count {
  font-weight: 700;
  color: var(--secondary);
  font-size: 0.95rem;
}

.load-more-container {
  text-align: center;
  margin-top: 40px;
}

/* Powered By Placeholder */
#wbx-powered-by-slot {
  margin-top: auto;
  padding: 24px;
  background: #fff;
}

/* Responsive */
@media (max-width: 768px) {
  body { padding: 0; }
  .main-container {
    border-radius: 0;
    margin: 0;
  }
  .hero-image-wrapper { height: 260px; }
  
  .logos-container {
    gap: 20px;
    flex-wrap: wrap;
  }
  .sponsor-logo {
    height: 70px;
  }
  
  .campaign-title { font-size: 2.25rem; }
  .hero-content { padding: 20px; }
  
  .contest-nav { flex-direction: column; }
  .nav-btn {
    border-bottom: none;
    border-left: 4px solid transparent;
    text-align: left;
    padding: 16px 24px;
  }
  .nav-btn.active {
    border-bottom-color: transparent;
    border-left-color: var(--primary);
  }
  
  .tab-content { padding: 24px 20px; }
  .form-row { flex-direction: column; gap: 0; }
  
  .gallery-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  .gallery-controls select { width: 100%; }
}
