/* ==========================================================================
   CSS RESET & VARIABLES
   ========================================================================== */
   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  :root {
    --primary: #10b981; /* Emerald green */
    --primary-hover: #059669;
    --secondary: #f59e0b; /* Amber */
    --secondary-hover: #d97706;
    --accent: #0ea5e9; /* Sky blue */
    --dark: #1e293b;
    --text: #334155;
    --text-light: #64748b;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --error: #ef4444;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    
    --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);
    
    --font-heading: 'Nunito', sans-serif;
    --font-body: 'Quicksand', sans-serif;
  }
  
  html, body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  
  .hidden {
    display: none !important;
  }
  
  /* ==========================================================================
     TYPOGRAPHY
     ========================================================================== */
  h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--dark);
    line-height: 1.2;
  }
  
  /* ==========================================================================
     HERO SECTION
     ========================================================================== */
  .hero {
    position: relative;
    padding: 80px 20px;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
  }
  
  .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(16, 185, 129, 0.6), rgba(30, 41, 59, 0.8));
    z-index: 1;
  }
  
  .hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
  }
  
  .hero .badge {
    display: inline-block;
    background-color: var(--secondary);
    color: white;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
  }
  
  .hero h1 {
    color: white;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: 16px;
    text-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }
  
  .hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    font-weight: 500;
  }
  
  /* ==========================================================================
     MAIN CONTAINER & TABS
     ========================================================================== */
  .main-container {
    flex: 1;
    max-width: 1100px;
    margin: -40px auto 40px;
    width: 100%;
    padding: 0 20px;
    position: relative;
    z-index: 10;
  }
  
  .tabs-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
  }
  
  .tab-btn {
    background: var(--surface);
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-pill);
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
  }
  
  .tab-btn:hover {
    color: var(--primary);
    transform: translateY(-2px);
  }
  
  .tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
  }
  
  .tab-content {
    animation: fadeIn 0.4s ease forwards;
  }
  
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* ==========================================================================
     UPLOAD SECTION GRID
     ========================================================================== */
  .upload-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 30px;
    align-items: flex-start;
  }
  
  @media (max-width: 768px) {
    .upload-grid {
      grid-template-columns: 1fr;
    }
  }
  
  .info-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  
  .bingo-card-preview img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: block;
  }
  
  .instructions-card {
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border-top: 4px solid var(--secondary);
  }
  
  .instructions-card h3 {
    margin-bottom: 12px;
    color: var(--secondary);
    font-size: 1.5rem;
  }
  
  .perks-list {
    list-style: none;
    margin-top: 20px;
  }
  
  .perks-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    color: var(--dark);
  }
  
  .perks-list li:last-child {
    border-bottom: none;
  }
  
  /* ==========================================================================
     FORMS & INPUTS
     ========================================================================== */
  .card-form {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
  }
  
  .card-form h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: var(--primary);
  }
  
  .form-group {
    margin-bottom: 24px;
  }
  
  .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  
  @media (max-width: 500px) {
    .form-row { grid-template-columns: 1fr; }
  }
  
  label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--dark);
  }
  
  .req {
    color: var(--error);
  }
  
  input[type="text"],
  input[type="email"],
  textarea,
  select {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    transition: all 0.3s ease;
  }
  
  input[type="text"]:focus,
  input[type="email"]:focus,
  textarea:focus,
  select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  }
  
  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='%23334155' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
  }

  .field-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 6px;
    font-weight: 600;
  }
  
  /* Custom File Input */
  .file-upload-wrapper {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
  }
  
  .file-upload-wrapper:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.05);
  }
  
  .file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
  }
  
  .file-upload-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
  }
  
  .file-icon {
    font-size: 2.5rem;
  }
  
  .file-text {
    font-weight: 700;
    color: var(--text-light);
  }
  
  /* Buttons */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 28px;
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 800;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
  }
  
  .btn-block { width: 100%; }
  .btn-center { margin: 0 auto; display: flex; }
  
  .btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
  }
  
  .btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  }
  
  .btn-secondary {
    background: var(--secondary);
    color: white;
  }
  
  .btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
  }
  
  .btn-icon { margin-left: 8px; }
  
  /* Alerts */
  .alert {
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-weight: 700;
  }
  
  .alert.error {
    background: #fef2f2;
    color: #b91c1c;
    border-left: 4px solid var(--error);
  }
  
  /* Success State */
  .success-state {
    text-align: center;
  }
  
  .success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
  }
  
  #share-panel {
    background: var(--bg);
    padding: 24px;
    border-radius: var(--radius-sm);
    margin: 24px 0;
  }
  
  .share-input-group {
    display: flex;
    margin-top: 10px;
  }
  
  .share-input-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    background: #fff;
  }
  
  .share-input-group button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    white-space: nowrap;
  }
  
  .success-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  /* ==========================================================================
     GALLERY GRID
     ========================================================================== */
  .gallery-header {
    text-align: center;
    margin-bottom: 30px;
  }
  
  .gallery-header h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 10px;
  }
  
  #category-filter-container {
    max-width: 400px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    gap: 16px;
  }
  
  #category-filter-container label { margin-bottom: 0; white-space: nowrap; }
  
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
  }
  
  .gallery-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
  }
  
  .gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
  }
  
  .gc-img-wrap {
    width: 100%;
    padding-bottom: 100%; /* 1:1 Aspect ratio */
    position: relative;
    background: #e2e8f0;
  }
  
  .gc-img-wrap img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover;
  }
  
  .gc-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .gc-caption {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .gc-author {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 16px;
  }
  
  .gc-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .vote-btn-small {
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
  }
  
  .vote-btn-small:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
  }
  
  .vote-btn-small.voted {
    background: var(--primary);
    color: white;
    cursor: default;
    opacity: 0.8;
  }
  
  .vote-count-small {
    font-weight: 700;
    color: var(--text-light);
    font-size: 0.875rem;
  }
  
  .empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }
  
  .empty-icon { font-size: 4rem; margin-bottom: 20px; }
  .empty-state h3 { font-size: 2rem; margin-bottom: 10px; }
  .empty-state p { color: var(--text-light); margin-bottom: 24px; }
  
  #gallery-loading { text-align: center; padding: 40px; color: var(--text-light); font-weight: 700; }
  
  /* ==========================================================================
     LIGHTBOX
     ========================================================================== */
  .lightbox {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  
  .lightbox-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(5px);
  }
  
  .lightbox-content {
    position: relative;
    background: var(--surface);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  }
  
  .lightbox-close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(0,0,0,0.1);
    border: none;
    color: var(--dark);
    width: 40px; height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
  }
  
  .lightbox-close:hover {
    background: var(--error);
    color: white;
  }
  
  .lightbox-body {
    display: flex;
    height: 100%;
    overflow-y: auto;
  }
  
  @media (max-width: 768px) {
    .lightbox-body { flex-direction: column; }
  }
  
  .lightbox-image-container {
    flex: 1.5;
    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-sidebar {
    flex: 1;
    padding: 30px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    overflow-y: auto;
  }
  
  .lightbox-meta { margin-bottom: 30px; }
  .lightbox-meta h3 { font-size: 1.5rem; margin-bottom: 10px; word-wrap: break-word; }
  .lightbox-author { color: var(--text-light); font-weight: 700; }
  
  .lightbox-vote-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border);
  }
  
  .lightbox-vote-section .vote-btn { width: 100%; margin-bottom: 12px; }
  .lightbox-vote-section .vote-btn.voted { background: #10b981; pointer-events: none; }
  
  .lightbox-vote-section .vote-count {
    text-align: center;
    font-weight: 800;
    color: var(--text-light);
  }
  
  .lightbox-share h4 { margin-bottom: 16px; color: var(--dark); }
  .social-btns { display: flex; gap: 10px; }
  .social-btn {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.875rem;
    transition: opacity 0.2s;
  }
  .social-btn:hover { opacity: 0.9; }
  .social-btn.fb { background: #1877f2; }
  .social-btn.tw { background: #000000; }
  
  body.modal-open { overflow: hidden; }

  /* ==========================================================================
     POWERED BY
     ========================================================================== */
  #wbx-powered-by-slot {
    margin-top: auto;
    padding: 20px;
    text-align: center;
  }