/* CSS Reset & Base Variables */
:root {
  --primary: #6c1a35; /* Rich Burgundy */
  --primary-light: #8e2b4b;
  --primary-dark: #4a0f23;
  --accent: #98bf64; /* Vine Green */
  --bg-color: #faf7f2;
  --card-bg: #ffffff;
  --text-main: #2d3748;
  --text-muted: #718096;
  --border: #e2e8f0;
  --error: #e53e3e;
  --success: #38a169;
  
  --font-head: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-hover: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
}

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

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

/* Utilities */
.hidden {
  display: none !important;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--primary-dark);
  font-weight: 700;
  line-height: 1.2;
}

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

.hero::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg-color);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  color: #fff;
}

.subtitle {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: #ffffff;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  margin: 0 auto;
}

/* Main App Container */
.app-container {
  max-width: 1200px;
  margin: -40px auto 40px;
  padding: 0 20px;
  flex: 1;
  width: 100%;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* Tabs */
.tabs-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2rem;
}

.tab-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 600px;
  margin: 0 auto;
}

.card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.card-header h2 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

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

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

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

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

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 26, 53, 0.1);
  background: #fff;
}

/* Custom File Upload */
.file-upload-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  color: var(--text-muted);
}

.file-upload-label:hover {
  border-color: var(--primary-light);
  background: #fff0f5;
  color: var(--primary);
}

.file-upload-label input[type="file"] {
  display: none;
}

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

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

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
  box-shadow: 0 4px 14px rgba(108, 26, 53, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 26, 53, 0.4);
}

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

.btn-secondary:hover {
  background: #1a202c;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

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

/* Social Buttons */
.social-shares {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}
.btn-social {
  flex: 1;
  padding: 10px;
  font-size: 0.9rem;
}
.btn-fb { background: #1877f2; color: #fff; }
.btn-tw { background: #000000; color: #fff; }
.btn-fb:hover { background: #166fe5; }
.btn-tw:hover { background: #333333; }

/* Share UI */
.share-card {
  text-align: center;
}
.success-icon {
  width: 64px;
  height: 64px;
  background: #e6fffa;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.share-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 2rem;
}
.share-url-container {
  display: flex;
  margin-top: 1rem;
  gap: 8px;
}
.share-url-container input {
  flex: 1;
  background: #fff;
}

/* Gallery Header */
.gallery-header {
  text-align: center;
  margin-bottom: 3rem;
}
.gallery-header h2 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

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

.gallery-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.gallery-img-container {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #eee;
}

.gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

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

.gallery-caption {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  flex: 1;
}

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

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

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

.btn-vote {
  background: rgba(108, 26, 53, 0.1);
  color: var(--primary);
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.btn-vote:disabled {
  background: #e2e8f0;
  color: #a0aec0;
  cursor: not-allowed;
}
.btn-vote.voted {
  background: var(--primary);
  color: white;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.lightbox-content {
  position: relative;
  z-index: 1001;
  max-width: 90%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  color: white;
  text-align: center;
  padding: 1rem;
  font-size: 1.1rem;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}

/* Loader */
.loader {
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top: 3px solid #fff;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
}
.loader.dark {
  border: 3px solid rgba(108, 26, 53, 0.2);
  border-top: 3px solid var(--primary);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Message Banner */
.message-banner {
  margin-bottom: 2rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
}
.message-banner.error {
  background: #fff5f5;
  color: var(--error);
  border: 1px solid #feb2b2;
}

#wbx-powered-by-slot {
  margin-top: auto;
  padding: 2rem 0;
}

@media (max-width: 768px) {
  .hero {
    padding: 3rem 1rem;
    min-height: 35vh;
  }
  .card {
    padding: 1.5rem;
  }
  .gallery-header h2 {
    font-size: 2rem;
  }
}
