/* static/style.css */

:root {
    --primary: #7c3aed;
    --primary-dark: #6d28d9;
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --bg: #0c0a1d;
    --bg-card: #1a1632;
    --bg-input: #0f0d1f;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --border: #2d2a4a;
    --border-light: #3d3a5a;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
}

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

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

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Cards */
.game-card,
.purchase-card,
.verify-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    margin: 1.5rem 0;
}

.game-header,
.game-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.status {
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-pending_draw {
    background: rgba(245, 158, 11, 0.2);
    color: var(--secondary);
    border: 1px solid var(--secondary);
}

.status-completed {
    background: rgba(124, 58, 237, 0.2);
    color: var(--primary);
    border: 1px solid var(--primary);
}

/* Hash display */
.hash {
    background: rgba(124, 58, 237, 0.15);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.7rem;
    word-break: break-all;
    display: block;
    border: 1px solid var(--border);
}

.revealed {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
}

/* Info grid */
.info-item {
    margin-bottom: 1rem;
}

.info-item label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.info-item small {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.35rem;
}

.info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.prize {
    color: var(--secondary);
    font-size: 1.5rem;
    font-weight: bold;
}

/* Countdown */
.countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.countdown-item {
    text-align: center;
}

.countdown-value {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1;
}

.countdown-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

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

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

.form-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

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

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

.input-with-button {
    display: flex;
    gap: 0.75rem;
}

.input-with-button input {
    flex: 1;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-random {
    background: var(--secondary);
    color: #000;
    border: none;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: var(--border);
}

.btn-copy-large {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1rem;
}

/* Payment section */
.payment-info {
    text-align: center;
    padding: 2rem;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.payment-info h3 {
    margin-bottom: 1.5rem;
}

.payment-detail {
    margin: 1.25rem 0;
}

.payment-detail label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.payment-detail code {
    display: block;
    padding: 1rem;
    background: var(--bg);
    border-radius: 8px;
    word-break: break-all;
    font-family: 'Fira Code', monospace;
}

.payment-detail .amount {
    font-size: 1.25rem;
    color: var(--secondary);
    font-weight: bold;
}

.address-box {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.address-box code {
    flex: 1;
    margin: 0;
}

.chosen-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.expires {
    margin-top: 1.5rem;
    color: var(--text-muted);
}

.status-check {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Success message */
.success-message {
    text-align: center;
    padding: 2rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: 12px;
}

.success-message h3 {
    color: var(--success);
    margin-bottom: 1rem;
}

.good-luck {
    font-size: 1.25rem;
    margin-top: 1rem;
}

/* How it works */
.how-it-works {
    margin: 4rem 0;
}

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

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

.step {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    text-align: center;
}

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

.step h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

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

/* Detail page */
.breadcrumb {
    margin: 1rem 0;
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
}

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

.detail-section {
    margin: 2rem 0;
}

.detail-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

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

.detail-table th,
.detail-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.detail-table th {
    color: var(--text-muted);
    font-weight: 500;
    width: 180px;
}

.detail-table code {
    font-size: 0.75rem;
    word-break: break-all;
}

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

.tickets-table th,
.tickets-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.tickets-table th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 500;
}

.winner-row {
    background: rgba(245, 158, 11, 0.1);
}

.winner-row td {
    color: var(--secondary);
    font-weight: 500;
}

.winning-number {
    font-size: 1.75rem;
    color: var(--secondary);
    font-weight: bold;
}

/* Signature blocks */
.signature-block {
    margin: 1.5rem 0;
}

.signature-block h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.signature-block pre {
    background: var(--bg);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.7rem;
    border: 1px solid var(--border);
}

/* Verify section */
.verify-section {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.verify-section h2 {
    color: var(--success);
    margin-bottom: 1rem;
}

.verify-values {
    margin: 1.5rem 0;
}

.verify-item {
    margin: 1rem 0;
}

.verify-item label {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.verify-item code {
    display: block;
    padding: 0.75rem;
    background: var(--bg);
    border-radius: 6px;
    font-size: 0.75rem;
    word-break: break-all;
}

/* History */
.history-list {
    margin-top: 2rem;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.history-item:hover {
    border-color: var(--primary);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.history-header a {
    color: var(--text);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 600;
}

.history-header a:hover {
    color: var(--primary);
}

.history-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.history-details .winning {
    color: var(--secondary);
    font-weight: 600;
}

.no-games {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Verify page */
.intro {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.verify-card pre {
    background: var(--bg);
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    font-size: 0.85rem;
    border: 1px solid var(--border);
}

.verify-card code {
    font-family: 'Fira Code', 'Consolas', monospace;
}

.verify-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1.5rem;
    text-align: center;
}

.verify-success h3 {
    color: var(--success);
}

.winning-number-large {
    font-size: 3rem;
    font-weight: bold;
    color: var(--secondary);
    margin-top: 1rem;
}

.verify-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    padding: 1.5rem;
    border-radius: 10px;
    margin-top: 1.5rem;
}

.verify-error h3 {
    color: var(--danger);
}

.verify-steps {
    padding-left: 1.5rem;
}

.verify-steps li {
    margin: 1rem 0;
    padding-left: 0.5rem;
}

/* Error pages */
.error-page {
    text-align: center;
    padding: 5rem 0;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

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

/* Footer */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
}

.footer p {
    margin: 0.35rem 0;
    font-size: 0.9rem;
}

/* Fund Summary Cards */
.fund-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.fund-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.fund-card.general-fund {
    border-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), transparent);
}

.fund-card.maintenance-fund {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), transparent);
}

.fund-card.winner-fund {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
}

.fund-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.fund-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.fund-percentage {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.fund-total {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.fund-address {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.fund-address code {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    word-break: break-all;
}

/* Distributions Section */
.distributions-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.distributions-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.table-responsive {
    overflow-x: auto;
}

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

.distributions-table th,
.distributions-table td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.distributions-table th {
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.distributions-table td.amount {
    font-family: 'Fira Code', monospace;
    color: var(--secondary);
    font-weight: 500;
}

.distributions-table td.tx-hash {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
}

.distributions-table td.tx-hash code {
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.btn-copy-small {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    margin-left: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-copy-small:hover {
    opacity: 1;
}

.no-hash {
    color: var(--text-muted);
    font-style: italic;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.status-badge.status-processing {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.status-badge.status-completed {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-badge.status-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Info Section */
.info-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.info-section h2 {
    margin-bottom: 1rem;
}

.info-content {
    color: var(--text-muted);
    line-height: 1.8;
}

.info-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-content li {
    margin: 0.5rem 0;
}

.no-data {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

/* Page Header */
.page-header {
    text-align: center;
    padding: 2rem 0;
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    color: var(--text-muted);
}

/* No Game Card */
.no-game {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    margin: 2rem 0;
}

.no-game h2 {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* Price Info */
.price-info {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.price-info strong {
    color: var(--secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 1.75rem;
    }

    .countdown {
        gap: 1rem;
    }

    .countdown-value {
        font-size: 1.75rem;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .history-details {
        flex-direction: column;
        gap: 0.5rem;
    }

    .info-row {
        grid-template-columns: 1fr 1fr;
    }

    .detail-table th {
        width: 120px;
    }

    .input-with-button {
        flex-direction: column;
    }

    .fund-summary {
        grid-template-columns: 1fr;
    }

    .distributions-table {
        font-size: 0.85rem;
    }

    .distributions-table th,
    .distributions-table td {
        padding: 0.5rem;
    }
}

/* Add to static/style.css */

/* Payment Warning */
.payment-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--secondary);
}

/* UUID Box */
.uuid-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.uuid-box code,
.amount-box code {
    flex: 1;
    padding: 1rem;
    background: var(--bg);
    border: 2px dashed var(--secondary);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--secondary);
    font-weight: bold;
    text-align: center;
}

.amount-box {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.payment-uuid {
    font-family: 'Fira Code', monospace;
    letter-spacing: 1px;
}

/* Payment Steps */
.payment-steps {
    background: var(--bg);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: left;
}

.payment-steps h4 {
    margin-bottom: 1rem;
    color: var(--text);
}

.payment-steps ol {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--text-muted);
}

.payment-steps li {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.payment-steps strong {
    color: var(--secondary);
}