* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.header-left h1 {
    font-size: 28px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #f87171 0%, #fb923c 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-left .subtitle {
    color: #94a3b8;
    font-size: 14px;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.scan-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.scan-label {
    color: #64748b;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.scan-value {
    color: #94a3b8;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
}

.countdown {
    color: #60a5fa;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #94a3b8;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        opacity: 0.7;
    }
    100% {
        opacity: 0;
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

.timestamp {
    font-size: 12px;
    color: #64748b;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(51, 65, 85, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card.alert-active {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.stat-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #60a5fa;
}

.stat-value.in-stock {
    color: #10b981;
}

.stat-value.out-of-stock {
    color: #f87171;
}

.stat-value.alert {
    color: #fbbf24;
}

/* Pokemon Centre Queue Banner */
.pc-queue-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.pc-countdown {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    font-family: 'Monaco', 'Menlo', monospace;
    opacity: 0.6;
}

.pc-queue-banner.hidden {
    display: none;
}

.pc-queue-banner.queue-normal {
    background: rgba(51, 65, 85, 0.4);
    border-color: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.pc-queue-banner.queue-active {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.6);
    color: #fca5a5;
    animation: urgentPulse 1s ease-in-out infinite;
}

.pc-queue-banner.queue-blocked {
    background: rgba(234, 88, 12, 0.15);
    border-color: rgba(234, 88, 12, 0.5);
    color: #fdba74;
}

.pc-queue-banner.queue-starting {
    background: rgba(51, 65, 85, 0.4);
    border-color: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}

.pc-queue-banner.queue-sleeping {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(100, 116, 139, 0.2);
    color: #475569;
}

.pc-queue-banner.queue-unknown {
    background: rgba(51, 65, 85, 0.4);
    border-color: rgba(148, 163, 184, 0.2);
    color: #64748b;
}

@keyframes urgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    50% { box-shadow: 0 0 20px 4px rgba(220, 38, 38, 0.3); }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
    padding-bottom: 0;
    flex-wrap: wrap;
}

.tab-button {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-button:hover {
    color: #cbd5e1;
}

.tab-button.active {
    color: #60a5fa;
    border-bottom-color: #60a5fa;
}

/* Tables */
.tab-content {
    display: none;
    background: rgba(51, 65, 85, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.products-table thead {
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 2px solid rgba(148, 163, 184, 0.2);
}

.products-table th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.products-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.products-table tbody tr {
    transition: background-color 0.2s ease;
}

.products-table tbody tr:hover {
    background-color: rgba(148, 163, 184, 0.1);
}

.products-table tbody tr.loading td {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 32px 16px;
}

/* State Badges */
.state-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.state-badge.qualified {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.state-badge.alerted {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.5);
}

.state-badge.unavailable {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.5);
}

.state-badge.third_party_only {
    background: rgba(168, 85, 247, 0.2);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.5);
}

.state-badge.amazon_too_expensive {
    background: rgba(248, 113, 113, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.5);
}

.state-badge.in_stock {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.5);
}

.state-badge.out_of_stock {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.5);
}

/* Product Name */
.product-name {
    font-weight: 500;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-name a {
    color: #93c5fd;
    text-decoration: none;
}

.product-name a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.product-name:hover {
    white-space: normal;
    word-break: break-word;
}

.retailer-badge {
    display: inline-block;
    background: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.price {
    color: #10b981;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', monospace;
}

.price-threshold {
    color: #94a3b8;
    font-size: 12px;
}

.seller {
    color: #94a3b8;
    font-size: 13px;
}

.time-ago {
    color: #64748b;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', monospace;
}

.check-count {
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .products-table th,
    .products-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
    }

    .header-right {
        width: 100%;
        align-items: flex-start;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .products-table {
        font-size: 12px;
    }

    .products-table th,
    .products-table td {
        padding: 8px;
    }

    .product-name {
        max-width: 150px;
    }
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 50%;
    border-top-color: #60a5fa;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ALERTED row highlight */
.products-table tbody tr.row-alerted {
    background: rgba(16, 185, 129, 0.06);
    box-shadow: inset 3px 0 0 #10b981;
    animation: alertedPulse 3s ease-in-out infinite;
}

@keyframes alertedPulse {
    0%, 100% { background: rgba(16, 185, 129, 0.06); }
    50% { background: rgba(16, 185, 129, 0.12); }
}

/* Header buttons group */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* About button */
.about-btn {
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
    color: #93c5fd;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.about-btn:hover {
    background: rgba(96, 165, 250, 0.25);
    border-color: rgba(96, 165, 250, 0.5);
    color: #bfdbfe;
}

.discord-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(88, 101, 242, 0.2);
    border: 1px solid rgba(88, 101, 242, 0.4);
    color: #a5b4fc;
    padding: 7px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.discord-btn:hover {
    background: rgba(88, 101, 242, 0.35);
    border-color: rgba(88, 101, 242, 0.6);
    color: #c7d2fe;
}

/* About modal */
.about-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.about-overlay.open {
    display: flex;
}

.about-modal {
    background: #1e293b;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 36px;
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
}

.about-modal h2 {
    font-size: 24px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #f87171 0%, #fb923c 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-tagline {
    color: #94a3b8;
    font-size: 15px;
    margin-bottom: 20px;
    font-style: italic;
}

.about-modal h3 {
    color: #60a5fa;
    font-size: 15px;
    margin: 24px 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.about-modal p {
    color: #cbd5e1;
    line-height: 1.7;
    margin-bottom: 12px;
    font-size: 14px;
}

.about-modal ul {
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.8;
    padding-left: 20px;
    margin-bottom: 12px;
}

.about-modal li {
    margin-bottom: 6px;
}

.about-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 12px;
}

.about-table th {
    background: rgba(30, 41, 59, 0.8);
    color: #94a3b8;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.about-table td {
    padding: 9px 14px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.about-table tr:nth-child(even) td {
    background: rgba(51, 65, 85, 0.3);
}

.about-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    color: #64748b !important;
    font-size: 13px !important;
    text-align: center;
}

.about-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.about-close:hover {
    color: #94a3b8;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}
