/* Guest Page Specific Styles - Vibrant Glassmorphism */

:root {
    --glass-surface: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.12);
    --neon-primary: #6366f1;
    --neon-secondary: #8b5cf6;
    --neon-accent: #38bdf8;
}

body {
    background-color: #0f172a;
    background-image:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 25%);
    min-height: 100vh;
}

/* Header Enhancements */
header {
    background: rgba(15, 23, 42, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.site-logo {
    filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.6));
    transition: filter 0.3s ease;
}

header:hover .site-logo {
    filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.8));
}

/* Controls Area */
.controls {
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
    justify-content: flex-end;
}

.controls button.primary {
    background: linear-gradient(135deg, var(--neon-primary), var(--neon-secondary));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.controls button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
    filter: brightness(1.1);
}

.controls button.primary:active {
    transform: translateY(0);
}

/* Table Container redesign */
.table-container {
    background: transparent;
    /* Remove default bg to show individual rows or main glass pane */
    border: none;
    box-shadow: none;
    overflow: visible;
    /* Allow glows to bleed out */
}

.table-inner-wrapper {
    background: rgba(30, 41, 59, 0.3);
    /* Main glass pane */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    padding-bottom: 8px;
    /* Spacing for bottom */
}

/* Table Header */
.table-header {
    background: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--glass-border);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.header-cell {
    padding: 18px 20px;
}

/* Table Rows */
.table-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
    background: transparent;
}

.table-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.table-row:last-child {
    border-bottom: none;
}

/* Data Enhancements */
.table-row>div {
    font-size: 0.95rem;
    /* Slightly larger text for readability */
}

/* Proxy Pool/ID Column */
.table-row>div:first-child {
    color: var(--neon-accent);
    font-weight: 500;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    position: relative;
    /* For absolute badge */
    overflow: hidden;
    /* optional, to crop if needed, but badge might stick out? No, keep inside. */
}

.top-badge {
    position: absolute;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #fbbf24, #ef4444);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 4px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    line-height: 1.2;
    z-index: 5;
}

/* Copy Button */
.btn-refresh {
    background: rgba(56, 189, 248, 0.1);
    color: var(--neon-accent);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: rgba(56, 189, 248, 0.2);
    color: white;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

/* Count Column */
div[id^="count-"] {
    font-family: 'Fira Code', monospace;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    min-width: 32px;
    text-align: center;
}

/* Usage Bar */
.usage-container {
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.progress-track {
    background: rgba(255, 255, 255, 0.05);
    height: 8px;
}

.progress-fill {
    background: linear-gradient(90deg, var(--neon-accent), var(--neon-primary));
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.progress-fill.warning {
    background: linear-gradient(90deg, #fcd34d, #f59e0b);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #fca5a5, #ef4444);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* Grid Layout Fixes for Guest */
.table-header-guest,
.table-row-guest {
    /* Optimized Grid: Compact Link button, Wide Usage Bar for better visual balance */
    grid-template-columns: 100px 130px 80px 140px 140px minmax(280px, 1fr) 220px;
    gap: 0;
}

/* Remove ellipsis from Link column and reduce padding to fit button */
.table-row-guest>div:nth-child(2) {
    text-overflow: clip;
    padding-left: 8px;
    padding-right: 8px;
}

/* Animation */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-row-guest {
    animation: fadeInSlide 0.3s ease-out forwards;
}

/* Stagger animation delay */
.table-row-guest:nth-child(1) {
    animation-delay: 0.05s;
}

.table-row-guest:nth-child(2) {
    animation-delay: 0.1s;
}

.table-row-guest:nth-child(3) {
    animation-delay: 0.15s;
}

.table-row-guest:nth-child(4) {
    animation-delay: 0.2s;
}

.table-row-guest:nth-child(5) {
    animation-delay: 0.25s;
}

.table-row-guest:nth-child(6) {
    animation-delay: 0.3s;
}

.table-row-guest:nth-child(7) {
    animation-delay: 0.35s;
}

.table-row-guest:nth-child(8) {
    animation-delay: 0.4s;
}

.table-row-guest:nth-child(9) {
    animation-delay: 0.45s;
}

.table-row-guest:nth-child(10) {
    animation-delay: 0.5s;
}

/* Responsive tweaks */
/* Responsive tweaks */
@media (max-width: 768px) {
    body {
        height: auto;
        overflow-y: auto;
        /* Enable page scroll */
        background-attachment: scroll;
    }

    .container {
        padding: 10px;
        gap: 12px;
        height: auto;
        /* Remove fixed height */
        display: block;
        overflow: visible;
    }

    /* Adjust table wrapper */
    .table-inner-wrapper {
        min-width: 900px;
        /* Force horizontal scroll on small screens */
        border-radius: 12px;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 20px;
        /* Add spacing below table */
        height: 60vh;
        /* Give table plenty of vertical space */
        min-height: 400px;
    }

    /* Reduce font sizes and padding in table */
    .table-header {
        font-size: 0.75rem;
    }

    .header-cell {
        padding: 14px 12px;
    }

    .table-row>div {
        font-size: 0.9rem;
        padding: 12px 12px;
    }

    .controls {
        padding: 16px;
        gap: 12px;
        flex-wrap: wrap;
        margin-bottom: 16px;
    }

    .controls button {
        height: 40px;
        font-size: 0.9rem;
        padding: 0 16px;
        flex: 1;
        min-width: 120px;
    }

    /* Site Title/Header */
    header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(15, 23, 42, 0.9);
        backdrop-filter: blur(10px);
    }

    h1 {
        font-size: 1.25rem;
    }

    /* Progress bar adjustments */
    .usage-container {
        padding: 6px;
    }

    .progress-track {
        height: 8px;
    }
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    pointer-events: none;
}

.toast {
    background: rgba(16, 185, 129, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #4ade80;
    padding: 12px 28px;
    border-radius: 50px;
    box-shadow: 0 10px 40px -10px rgba(16, 185, 129, 0.3);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast i {
    font-size: 1.2em;
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.5));
}