/* Quizbids Main Stylesheet */

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

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background: var(--bg-light);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
}

.logo {
    text-decoration: none;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.user-menu {
    position: relative;
}

.user-menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.user-menu-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    min-width: 150px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.user-menu:hover .user-menu-dropdown {
    display: block;
}

.user-menu-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-color);
}

.user-menu-dropdown a:hover {
    background: var(--bg-light);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

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

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

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

.btn-secondary:hover {
    background: #4b5563;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 1.125rem;
}

.btn-link {
    background: none;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.search-form input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

/* Draws Grid */
.draws-grid {
    padding: 2rem 0;
}

.draws-grid h2 {
    margin-bottom: 1.5rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.draw-card {
    background: var(--bg-white);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.draw-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.draw-card a {
    text-decoration: none;
    color: inherit;
}

.draw-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.no-image {
    width: 100%;
    height: 200px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.draw-card-content {
    padding: 1rem;
}

.draw-card h3 {
    margin-bottom: 0.5rem;
}

.draw-stats {
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 0.375rem;
}

.stat {
    text-align: center;
}

.stat .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat .value {
    display: block;
    font-weight: 600;
    font-size: 1rem;
}

.progress-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: var(--success-color);
    transition: width 0.3s;
}

.draw-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.featured {
    background: var(--warning-color);
    color: white;
}

/* Forms */
.auth-form {
    max-width: 500px;
    margin: 2rem auto;
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
}

/* Footer */
.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--text-color);
    color: white;
    z-index: 100;
}

/* Add padding to main content so it doesn't get hidden behind fixed footer */
main.container {
    padding-bottom: 4rem;
}

.footer-expanded {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.site-footer.expanded .footer-expanded {
    max-height: 400px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.footer-section p {
    font-size: 0.85rem;
    color: #d1d5db;
    margin-bottom: 0.25rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.25rem;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bar {
    border-top: 1px solid #374151;
}

.footer-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
}

.footer-bar p {
    margin: 0;
    font-size: 0.85rem;
    color: #9ca3af;
}

.footer-toggle {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: color 0.2s, background 0.2s;
}

.footer-toggle:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.footer-toggle-icon {
    display: inline-block;
    transition: transform 0.3s;
}

.site-footer.expanded .footer-toggle-icon {
    transform: rotate(180deg);
}

.site-footer.expanded .footer-toggle-text {
    display: none;
}

.site-footer.expanded .footer-toggle::after {
    content: 'Less info';
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .footer-bar .container {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .site-footer.expanded .footer-expanded {
        max-height: 500px;
    }
}

/* Dashboard */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.dashboard-section {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 0.75rem;
    background: var(--bg-light);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.positive {
    color: var(--success-color);
}

.negative {
    color: var(--error-color);
}

/* Admin */
.admin-nav {
    display: flex;
    gap: 1rem;
    margin: 1rem 0 2rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-nav a {
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.admin-nav a.active,
.admin-nav a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.admin-section {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.admin-section.urgent {
    border-left: 4px solid var(--error-color);
}

.admin-section.warning {
    border-left: 4px solid var(--warning-color);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 2rem 0;
}

/* How It Works Section */
.how-it-works {
    padding: 3rem 0;
    margin-top: 2rem;
}

.how-it-works h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.75rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.step {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.step:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.step-number {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step h3 {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.step p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Buy Tokens Page */
.buy-tokens-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.buy-tokens-page h1 {
    text-align: center;
    margin-bottom: 1rem;
}

.current-balance {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 2rem;
}

.current-balance p {
    margin: 0;
    font-size: 1.1rem;
}

.current-balance strong {
    font-size: 1.5rem;
}

.token-packages {
    margin-bottom: 2rem;
}

.token-packages h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.package-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.package-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.package-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05), transparent);
}

.package-tokens {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.package-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.package-savings {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1rem;
}

.package-card .btn {
    width: 100%;
}

.custom-amount {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    margin-bottom: 2rem;
}

.custom-amount h3 {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.custom-amount .form-group {
    max-width: 300px;
    margin: 0 auto 1rem;
}

.custom-amount input {
    text-align: center;
    font-size: 1.25rem;
}

.price-display {
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

.price-display strong {
    color: var(--primary-color);
    font-size: 1.25rem;
}

/* Payment Section */
#payment-section {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

#payment-section h2 {
    margin-bottom: 1.5rem;
}

.payment-summary {
    background: var(--bg-light);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.payment-summary p {
    margin: 0.25rem 0;
}

#card-element {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: white;
    margin-bottom: 1rem;
}

#payment-form .btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* Draw Detail Page */
.draw-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem 0;
}

@media (max-width: 900px) {
    .draw-detail {
        grid-template-columns: 1fr;
    }
}

.draw-media .media-gallery img {
    width: 100%;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.draw-media .no-media {
    background: var(--bg-light);
    padding: 4rem;
    text-align: center;
    border-radius: 0.5rem;
    color: var(--text-muted);
}

.draw-info h1 {
    margin-bottom: 0.5rem;
}

.seller-info {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.badges {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.badge.ended {
    background: var(--text-muted);
    color: white;
}

.badge.reserve-met {
    background: var(--success-color);
    color: white;
}

.draw-stats-large {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.draw-stats-large .stat {
    flex: 1;
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    text-align: center;
}

.draw-stats-large .stat .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.draw-stats-large .stat .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
}

.progress-bar-large {
    height: 12px;
    background: var(--bg-light);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.time-remaining {
    background: var(--bg-light);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.countdown {
    color: var(--primary-color);
    font-weight: 600;
}

/* Entry Section */
.entry-section {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.user-tokens {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.user-entries {
    background: var(--success-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.entry-info {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.start-entry-form {
    text-align: center;
}

/* Question Box */
.question-box {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.question-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.question-box label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.question-box .question {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.entry-form .form-group input {
    font-size: 1.1rem;
    padding: 0.75rem;
}

.entry-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.entry-actions .btn-large {
    flex: 1;
}

.login-prompt {
    text-align: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
}

.draw-description {
    margin-top: 1.5rem;
}

.draw-description h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

/* Form Sections */
.form-section {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-section h2 {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

/* Badge colors for difficulty/status */
.badge-easy {
    background: var(--success-color);
    color: white;
}

.badge-medium {
    background: var(--warning-color);
    color: white;
}

.badge-hard {
    background: var(--error-color);
    color: white;
}

.badge-active {
    background: var(--success-color);
    color: white;
}

.badge-inactive {
    background: var(--text-muted);
    color: white;
}

.badge-succeeded {
    background: var(--success-color);
    color: white;
}

.badge-pending {
    background: var(--warning-color);
    color: white;
}

.badge-failed {
    background: var(--error-color);
    color: white;
}

/* Info grid for admin details */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 0.375rem;
}

/* Honeypot spam protection - hide from humans but bots will fill */
.form-contact-field {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

