/* Dark theme variables (default) */
:root {
    --bg-primary: #1a2332;
    --bg-secondary: #2a3647;
    --bg-tertiary: #1e2936;
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --accent-purple: #7c3aed;
    --accent-purple-hover: #6d28d9;
    --success-green: #166534;
    --success-green-light: #22c55e;
    --border-color: #374151;
}

/* Light theme variables */
:root.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-purple: #7c3aed;
    --accent-purple-hover: #6d28d9;
    --success-green: #dcfce7;
    --success-green-light: #16a34a;
    --border-color: #e2e8f0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.app-subtitle {
    font-size: 1rem;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.latest-draw-date {
    font-size: 0.875rem;
    text-align: center;
    color: var(--accent-purple);
    margin-bottom: 2.5rem;
    font-weight: 500;
}

.search-card {
    background-color: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.search-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: block;
}

.search-input-group {
    display: flex;
    gap: 1rem;
}

.search-input {
    flex: 1;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-input:focus {
    border-color: var(--accent-purple);
}

.search-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-button {
    background-color: var(--accent-purple);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-button:hover:not(:disabled) {
    background-color: var(--accent-purple-hover);
}

.search-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.search-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.success-banner {
    background-color: var(--success-green);
    color: var(--success-green-light);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.error-alert {
    background-color: #7f1d1d;
    color: #fca5a5;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.warning-alert {
    background-color: #854d0e;
    color: #fef08a;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid #a16207;
}

:root.light-theme .warning-alert {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.database-status {
    margin-bottom: 2rem;
    text-align: center;
}

.cache-status {
    text-align: center;
    margin-top: 0.25rem;
}

.results-card {
    background-color: var(--bg-secondary);
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table thead {
    background-color: var(--bg-tertiary);
}

.results-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.results-table td {
    padding: 1.25rem 1.5rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-table tbody tr:hover {
    background-color: rgba(124, 58, 237, 0.05);
}

.combination-cell {
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Number chips for individual numbers */
.number-chips {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.number-chip {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background-color: rgba(156, 163, 175, 0.2);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.number-chip.matched {
    background-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.no-results {
    background-color: #1e3a5f;
    color: #93c5fd;
    padding: 1.5rem;
    border-radius: 0.75rem;
    text-align: center;
}

.no-results-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.app-footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 2rem;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Theme toggle button */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--bg-tertiary);
}

/* Blazor error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #7c3aed;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    color: var(--text-primary);
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* Search progress overlay */
.search-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.search-progress-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.search-progress-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--accent-purple);
    animation: spin 0.8s linear infinite;
}

.search-progress-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* Match summary section */
.match-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.match-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    border: 2px solid;
    font-size: 0.875rem;
}

.match-badge strong {
    font-size: 1.5rem;
}

.match-badge.match-6 {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: #22c55e;
    color: #22c55e;
}

.match-badge.match-5 {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #3b82f6;
}

.match-badge.match-4 {
    background-color: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #fbbf24;
}

.match-badge.match-3 {
    background-color: rgba(156, 163, 175, 0.1);
    border-color: #9ca3af;
    color: #9ca3af;
}

/* Match indicator in table */
.match-indicator {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
}

.match-indicator.match-6 {
    background-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.match-indicator.match-5 {
    background-color: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.match-indicator.match-4 {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.match-indicator.match-3 {
    background-color: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

/* Tip section */
.tip-section {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

.tip-card {
    background-color: var(--bg-secondary);
    border: 2px solid var(--accent-purple);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.tip-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tip-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.tip-qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.tip-qrcode img {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.tip-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Thank You page */
.thank-you-card {
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid var(--border-color);
    max-width: 600px;
    margin: 3rem auto;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.thank-you-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--accent-purple);
}

.thank-you-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.thank-you-message {
    text-align: left;
    margin-bottom: 2rem;
}

.thank-you-message p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.thank-you-signature {
    text-align: center;
    margin-top: 2rem;
    font-style: italic;
    color: var(--text-primary);
}

.thank-you-signature strong {
    color: var(--accent-purple);
    font-style: normal;
}

.back-button {
    background-color: var(--accent-purple);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.back-button:hover {
    background-color: var(--accent-purple-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .search-input-group {
        flex-direction: column;
    }

    .search-button {
        width: 100%;
        justify-content: center;
    }

    .results-table {
        font-size: 0.875rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.75rem 1rem;
    }

    .app-title {
        font-size: 2rem;
    }

    .match-summary {
        flex-direction: column;
    }

    .tip-card {
        padding: 1.5rem;
    }

    .tip-qrcode img {
        max-width: 250px;
    }

    .thank-you-card {
        padding: 2rem 1.5rem;
        margin: 2rem 1rem;
    }

    .thank-you-title {
        font-size: 2rem;
    }
}
