/* Root Variables - Liquid Glass Theme */
:root {
  /* Liquid Glass Color Palette */
  --bg-primary: #0b1a3d;
  --bg-secondary: #1b2969;
  --bg-glass: rgba(11, 26, 61, 0.85);
  --bg-card: rgba(27, 41, 105, 0.7);
  --bg-accent: rgba(92, 139, 246, 0.15);

  /* Vibrant Gradients */
  --gradient-primary: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-secondary: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
  --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-accent: #74b9ff;

  /* Glass Effects */
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --glass-backdrop: blur(20px);

  /* Enhanced Shadows */
  --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.3);
  --shadow-intense: 0 20px 60px rgba(0, 0, 0, 0.4);

  /* Border Radius */
  --radius-glass: 20px;
  --radius-card: 24px;
  --radius-button: 16px;

  /* Transitions */
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Universal Mobile Background Fix */
html, body {
    background: #0b1a3d !important;
    background: linear-gradient(135deg, #0b1a3d 0%, #1b2969 50%, #1d4c95 100%) !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    width: 100% !important;
}

/* Mobile-first participation page styles */
.participate-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
    /* Fallback solid background for mobile compatibility */
    background: #0b1a3d;
    /* Enhanced gradient background with mobile fallbacks */
    background: linear-gradient(135deg, #0b1a3d 0%, #1b2969 50%, #1d4c95 100%);
    background: radial-gradient(circle at 20% 80%, rgba(116, 185, 255, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(79, 172, 254, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 40% 40%, rgba(0, 242, 254, 0.2) 0%, transparent 50%),
      linear-gradient(135deg, #0b1a3d 0%, #1b2969 50%, #1d4c95 100%);
    min-height: 100vh;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
}

/* Animated Background Elements */
.participate-page::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%),
    radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
  animation: float 20s ease-in-out infinite;
  z-index: -1;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}

.participate-container {
    width: 100vw;
    height: 100dvh; /* Dynamic viewport height */
    display: grid;
    grid-template-rows: auto 1fr auto; /* header, content, footer */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none; /* Remove border to prevent overflow */
    overflow: hidden;
    margin: 0; /* Remove margin to prevent overflow */
    border-radius: 0; /* Remove border-radius to prevent overflow */
    box-shadow: none; /* Remove box-shadow to prevent overflow */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Header - Compact mobile-first design */
.participate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 8px 12px; /* Reduced padding */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    min-height: 44px; /* Minimum touch target */
}

.back-btn {
    width: 44px;
    height: 44px;
    border: 1px solid var(--glass-border);
    background: var(--gradient-glass);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-primary);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
    box-shadow: var(--shadow-glow);
}

.page-title {
    font-size: 16px; /* Smaller for mobile */
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

/* Header Check Numbers Button */
.header-check-btn {
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--glass-border);
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: white;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-glass);
}

.header-check-btn:hover {
    background: var(--gradient-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.header-check-btn:active {
    transform: translateY(0px);
    box-shadow: var(--shadow-glass);
}

/* Brand styling - matches buyer-whp */
.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border-radius: var(--radius-button);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.brand-icon i {
    color: white;
    font-size: 1.75rem;
}

.brand-text h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main content area that scrolls */
.participate-main {
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px; /* 8px vertical rhythm */
    padding: 8px 8px 80px 8px; /* Added 80px bottom padding for safety */
}

/* Product Section - Compact for mobile */
.product-details {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    text-align: left;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 50%, rgba(0, 0, 0, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px;
    margin: 0;
    max-height: 30%;
    overflow: hidden;
}

.product-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

/* Responsive Aspect Ratios */
/* Small screens - more square for better mobile viewing */
@media (max-width: 480px) {
    .product-section {
        aspect-ratio: 4 / 3; /* More square for mobile */
        padding-bottom: 75%; /* Fallback: 3/4 * 100% */
    }
}

/* Medium screens - balanced ratio */
@media (min-width: 481px) and (max-width: 768px) {
    .product-section {
        aspect-ratio: 16 / 10; /* Balanced ratio */
        padding-bottom: 62.5%; /* Fallback: 10/16 * 100% */
    }
}

/* Large screens - original wide ratio */
@media (min-width: 769px) {
    .product-section {
        aspect-ratio: 4411 / 2482; /* Original image ratio */
        padding-bottom: 56.27%; /* Fallback */
        max-width: 600px; /* Larger on desktop */
    }
}

.product-image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.8);
}

/* Product details styling removed - title moved to separate section */

/* Old product-title styles removed - replaced by product-title-section */

.product-subtitle {
    font-size: 14px;
    color: var(--text-accent);
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.purchase-feed-mobile {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-button);
    padding: 8px; /* Compact mobile padding */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px; /* Smaller for mobile */
    color: var(--text-secondary);
}

.buyer-name {
    font-weight: 500;
    color: #1e293b;
}

.tickets-bought {
    color: #1e293b;
}

.time-ago {
    margin-left: auto;
    color: #94a3b8;
}

/* Stats Section */
.stats-section {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    flex-shrink: 0;
}

.stat-card {
    flex: 1;
    background: var(--gradient-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-glass);
}

.stat-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}

.stat-content {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.price-card {
    background: var(--gradient-secondary);
    color: white;
}

.price-card .stat-content {
    text-align: center;
}

.price-label {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.price-value {
    font-size: 18px;
    font-weight: 700;
}

/* Prize Info */
.prize-info {
    padding: 0 16px 12px;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.prizes-btn {
    background: var(--gradient-secondary);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    font-size: 12px;
    color: white;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex: 1;
    box-shadow: var(--shadow-glass);
}

.prizes-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.chances-info {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    font-size: 11px;
    color: var(--text-accent);
    flex: 2;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Quick Selection */
.quick-selection {
    padding: 8px; /* Reduced padding */
    display: flex;
    flex-direction: column;
    gap: 8px; /* 8px vertical rhythm */
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.quantity-grid-mobile {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px; /* 8px consistent spacing */
    flex: 1;
}

.quantity-btn-mobile {
    background: var(--gradient-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 8px;
    border-radius: var(--radius-button);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 44px; /* 44px minimum touch target */
    justify-content: center;
    box-shadow: var(--shadow-glass);
}

.quantity-btn-mobile:hover,
.quantity-btn-mobile.active {
    background: var(--gradient-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.quantity-number {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.quantity-price {
    font-size: 10px;
    color: var(--text-accent);
    font-weight: 500;
}

/* Custom Amount */
.custom-amount-section {
    padding: 8px; /* Consistent 8px padding */
    flex-shrink: 0;
}

.amount-controls {
    background: var(--gradient-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-button);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-glass);
    min-height: 44px; /* Touch target */
}

.counter-btn {
    width: 44px; /* 44px minimum touch target */
    height: 44px;
    border: 1px solid var(--glass-border);
    background: var(--gradient-primary);
    border-radius: var(--radius-button);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: white;
    box-shadow: var(--shadow-glass);
}

.counter-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.counter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.amount-display {
    text-align: center;
}

.amount-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.amount-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.amount-input {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    background: transparent;
    border: none;
    outline: none;
    text-align: center;
    width: 100px;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.amount-input:focus {
    background-color: rgba(255, 255, 255, 0.1);
    outline: 2px solid var(--accent-color);
}

.amount-input::-webkit-outer-spin-button,
.amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.amount-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Action Section - Always visible footer */
.action-section {
    padding: 8px 12px; /* Compact mobile padding */
    background: var(--gradient-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
    /* Keep visible when keyboard opens on mobile */
    position: sticky;
    bottom: 0;
    z-index: 100;
}

.participate-btn-mobile {
    width: 100%;
    background: var(--gradient-secondary);
    border: 1px solid var(--glass-border);
    padding: 12px; /* Ensure 44px+ height for touch */
    border-radius: var(--radius-button);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
    color: white;
    font-weight: 600;
    font-size: 16px; /* 16px to prevent iOS zoom */
    box-shadow: var(--shadow-glow);
    min-height: 44px; /* Ensure touch target */
}

.participate-btn-mobile:hover {
    background: var(--gradient-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-intense);
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-text {
    font-size: 14px;
}

.btn-price {
    font-size: 16px;
    font-weight: 700;
}

/* Support Section */
.support-section {
    padding: 0 20px 12px;
}

.whatsapp-btn {
    width: 100%;
    background: var(--gradient-accent);
    border: 1px solid var(--glass-border);
    padding: 10px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-glass);
}

.whatsapp-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

/* Success Modal */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.success-overlay.active {
    display: flex;
}

.success-content {
    background: white;
    border-radius: 20px;
    padding: 32px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    animation: successSlideIn 0.3s ease-out;
}

@keyframes successSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: white;
}

.success-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.success-content p {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 24px 0;
    line-height: 1.4;
}

.continue-btn {
    width: 100%;
    background: #3b82f6;
    border: none;
    padding: 14px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.continue-btn:hover {
    background: #2563eb;
}

/* Responsive adjustments */
@media (max-width: 375px) {
    /* Product section removed - height handled by product-carousel */
    
    /* Product title responsive styling handled by product-title-section */
    
    .quantity-grid-mobile {
        grid-template-columns: 1fr;
    }
    
    .stats-section {
        flex-direction: column;
    }
}

/* Manual Number Selection Styles */
.manual-selection-toggle {
    margin-top: 16px;
    text-align: center;
}

.manual-toggle-btn {
    background: var(--gradient-glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-button);
    padding: 12px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    box-shadow: var(--shadow-glass);
}

.manual-toggle-btn:hover {
    background: var(--gradient-accent);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.manual-toggle-btn.active {
    background: var(--gradient-primary);
    color: var(--text-primary);
}

.manual-numbers-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    box-shadow: var(--shadow-glass);
}

.manual-help-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.manual-input-area {
    margin-bottom: 16px;
}

.manual-numbers-input {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-button);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
}

.manual-numbers-input::placeholder {
    color: var(--text-muted);
}

.manual-numbers-input:focus {
    outline: none;
    border-color: var(--text-accent);
    box-shadow: 0 0 20px rgba(116, 185, 255, 0.3);
}

.manual-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.manual-action-btn {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-button);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition-smooth);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
}

.generate-btn {
    background: rgba(255, 193, 7, 0.1);
}

.generate-btn:hover {
    background: rgba(255, 193, 7, 0.2);
    color: var(--text-primary);
}

.validate-btn {
    background: rgba(34, 197, 94, 0.1);
}

.validate-btn:hover {
    background: rgba(34, 197, 94, 0.2);
    color: var(--text-primary);
}

.manual-info {
    padding: 12px;
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid rgba(116, 185, 255, 0.3);
    border-radius: var(--radius-button);
    text-align: center;
}

.manual-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.manual-count {
    color: var(--text-secondary);
    font-size: 14px;
}

.manual-price {
    color: var(--text-accent);
    font-weight: 600;
    font-size: 16px;
}

/* Direct Input Section */
.direct-input-section {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-card);
    backdrop-filter: var(--glass-backdrop);
}

.input-label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.quantity-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-button);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
}

.quantity-input::placeholder {
    color: var(--text-muted);
}

.quantity-input:focus {
    outline: none;
    border-color: #74b9ff;
    box-shadow: 0 0 20px rgba(116, 185, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.apply-btn {
    padding: 12px 20px;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-button);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-glass);
}

.apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(79, 172, 254, 0.4);
}

.apply-btn:active {
    transform: translateY(0);
}

.input-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    text-align: center;
}

.min-tickets-text {
    color: #ffc107;
    font-weight: 500;
}

/* Sold out button styles */
.participate-btn-mobile.sold-out {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    cursor: not-allowed;
    opacity: 0.8;
}

.participate-btn-mobile.sold-out:hover {
    transform: none;
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.3);
}

.participate-btn-mobile:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Availability display styles */
.availability-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-button);
    color: #22c55e;
    font-weight: 500;
    font-size: 14px;
}

.availability-display i {
    width: 16px;
    height: 16px;
}

/* Warning message styles */
.warning-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 12px 16px;
    border-radius: var(--radius-button);
    margin: 12px 16px;
    text-align: center;
    font-weight: 500;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* Disabled quantity buttons */
.quantity-btn-mobile:disabled,
.quantity-btn-mobile.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(100, 116, 139, 0.3);
}

.quantity-btn-mobile:disabled:hover,
.quantity-btn-mobile.disabled:hover {
    transform: none;
    box-shadow: none;
}

@media (min-width: 768px) {
    .participate-container {
        max-width: 400px;
        margin: 0 auto;
        min-height: 100vh;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .quantity-grid-mobile {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 🔍 Check Numbers Section */
.check-numbers-section {
    margin: 20px 0;
    padding: 0 20px;
}

.check-numbers-btn {
    width: 100%;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-glass);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--text-primary);
    box-shadow: var(--shadow-glass);
}

.check-numbers-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-intense);
    background: rgba(255, 255, 255, 0.1);
}

.check-numbers-btn .btn-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.check-numbers-btn .btn-content {
    flex: 1;
    text-align: left;
}

.check-numbers-btn .btn-title {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.check-numbers-btn .btn-subtitle {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
}

/* 📋 Check Numbers Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 26, 61, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-glass);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-glass);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-intense);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.modal-header h3 {
    color: var(--text-primary);
    margin: 0;
    font-size: 18px;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--transition-smooth);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 20px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.cpf-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-button);
    color: var(--text-primary);
    font-size: 16px;
    transition: var(--transition-smooth);
    box-sizing: border-box;
}

.cpf-input:focus {
    outline: none;
    border-color: var(--text-accent);
    background: rgba(255, 255, 255, 0.15);
}

.cpf-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    width: 100%;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-button);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Results Display */
.results-section {
    border-top: 1px solid var(--glass-border);
    padding: 20px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.results-header h4 {
    color: var(--text-primary);
    margin: 0;
}

.total-tickets {
    color: var(--text-accent);
    font-weight: 600;
}

.tickets-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.ticket-number {
    padding: 8px 4px;
    background: rgba(116, 185, 255, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    text-align: center;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
}

/* Loading State */
.loading-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-primary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(116, 185, 255, 0.3);
    border-top: 3px solid var(--text-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

/* Empty State */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-primary);
}

.empty-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-muted);
    margin: 0;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-content {
        max-height: 90vh;
    }
    
    .check-numbers-section {
        padding: 0 15px;
    }
    
    /* Mobile Background Fix - Force background on all mobile browsers */
    html, body, .participate-page {
        background: #0b1a3d !important;
        background-color: #0b1a3d !important;
        background-image: linear-gradient(135deg, #0b1a3d 0%, #1b2969 50%, #1d4c95 100%) !important;
        min-height: 100vh !important;
        height: 100% !important;
    }
    
    /* Force background on WebKit mobile browsers */
    body {
        -webkit-background-clip: border-box !important;
        background-clip: border-box !important;
        background-attachment: scroll !important;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    html, body, .participate-page {
        background: #0b1a3d !important;
        background-image: linear-gradient(135deg, #0b1a3d 0%, #1b2969 50%, #1d4c95 100%) !important;
        background-attachment: scroll !important;
        min-height: -webkit-fill-available !important;
    }
}

/* Chrome Mobile specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    html, body, .participate-page {
        background: #0b1a3d !important;
        background-image: linear-gradient(135deg, #0b1a3d 0%, #1b2969 50%, #1d4c95 100%) !important;
    }
}

/* 🎠 Product Image Carousel */
.product-carousel {
    position: relative;
    width: 100%;
    
    margin: 0 auto;
    
    /* Fallback for older browsers */
    height: 0;
    padding-bottom: 56.27%; /* 2482/4411 * 100% = 56.27% (more precise) */
    
    /* Modern browsers override the fallback */
    aspect-ratio: 4411 / 2482; /* Exact ratio for your images */
}

/* Override padding for browsers that support aspect-ratio */
@supports (aspect-ratio: 1) {
    .product-carousel {
        height: auto;
        padding-bottom: 0;
    }
}

.carousel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-glass);
    overflow: visible; /* Allow images to overflow */
    background: var(--bg-glass);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-glass);
}

/* For browsers with aspect-ratio support */
@supports (aspect-ratio: 1) {
    .carousel-container {
        position: relative;
    }
}

.carousel-slides {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease-in-out;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    display: block;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Allow overflow to fill container */
    border-radius: var(--radius-glass);
    display: block;
}

/* First carousel image should not overflow but touch the top */
.carousel-slide:first-child .carousel-image {
    object-fit: contain; /* Fit entirely within container without overflow */
    object-position: top; /* Align image to the top of container */
}

/* Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

/* Dots Indicator */
.carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--gradient-primary);
    width: 24px;
    border-radius: 4px;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Mobile Carousel Responsiveness */
@media (max-width: 768px) {
    .product-carousel {
        
        aspect-ratio: 16/10; /* Slightly taller for mobile */
    }
    
    .carousel-nav {
        width: 35px;
        height: 35px;
    }
    
    .carousel-prev {
        left: 8px;
    }
    
    .carousel-next {
        right: 8px;
    }
    
    .carousel-dots {
        bottom: 12px;
    }
    
    
}

@media (min-width: 769px) {
    .product-carousel {
        max-width: 445px;
        aspect-ratio: 16/9; /* Balanced ratio for tablets */
    }
    
    
}

@media (min-width: 1024px) {
    .product-carousel {
        max-width: 534px;
        aspect-ratio: 4411/2482; /* Original image ratio for desktop */
    }
    
    
}