/* VILLAIN VPN ADMIN PANEL - PAYMENTS MONITOR */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #16161f;
    --bg-card-hover: #1c1c28;
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --accent-secondary: #a78bfa;
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(139, 92, 246, 0.2);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --blue: #3b82f6;
    --content-width: 600px;
    --content-padding: 1rem;
    
    /* Light colors for indicators */
    --light-off: #3f3f46;
    --light-blue: #3b82f6;
    --light-green: #22c55e;
    --light-red: #ef4444;
}

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

html, body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    -webkit-touch-callout: none;
    position: relative;
}

/* Animated background */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background-image: 
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.bg-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background: 
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 60%, rgba(167, 139, 250, 0.06) 0%, transparent 40%);
}

#app {
    position: relative;
    z-index: 10;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Loading state */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 1rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Error state */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    text-align: center;
    gap: 1rem;
}

.error-icon {
    font-size: 4rem;
}

.error-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.error-text {
    color: var(--text-secondary);
    max-width: 300px;
}

.error-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    margin-top: 1rem;
    transition: all 0.2s;
}

.error-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

/* Admin Header */
.admin-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem var(--content-padding);
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-emoji {
    font-size: 1.75rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text span {
    color: var(--accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.refresh-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.refresh-indicator i {
    font-size: 0.75rem;
}

.refresh-indicator.refreshing i {
    animation: spin 1s linear infinite;
    color: var(--accent);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: var(--bg-card-hover);
    color: var(--danger);
}

/* Stats bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem var(--content-padding);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-item i {
    font-size: 1rem;
}

.stat-item i.fa-clock { color: var(--warning); }
.stat-item i.fa-check-circle { color: var(--success); }
.stat-item i.fa-times-circle { color: var(--danger); }

.stat-item span:first-of-type {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-muted);
}

/* Orders container */
.orders-container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--content-padding);
    padding-bottom: 100px;
}

/* Date group */
.date-group {
    margin-bottom: 1.5rem;
}

.date-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Order card */
.order-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.order-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.order-card.new-order {
    animation: pulse-border 2s ease-in-out;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--border); }
    50% { border-color: var(--accent); box-shadow: 0 0 20px var(--accent-glow); }
}

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

.order-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-id {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.order-id {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--accent);
    background: rgba(139, 92, 246, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.order-id:hover {
    background: rgba(139, 92, 246, 0.2);
}

.order-id.copied {
    background: var(--success);
    color: white;
}

.order-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.order-amount {
    font-weight: 600;
    color: var(--success);
}

.order-time {
    color: var(--text-muted);
}

/* Status lights */
.status-lights {
    display: flex;
    gap: 0.75rem;
}

.status-light {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.light-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--light-off);
    transition: all 0.3s;
}

.light-dot.on-blue {
    background: var(--light-blue);
    box-shadow: 0 0 8px var(--light-blue);
}

.light-dot.on-green {
    background: var(--light-green);
    box-shadow: 0 0 8px var(--light-green);
}

.light-dot.on-red {
    background: var(--light-red);
    box-shadow: 0 0 8px var(--light-red);
}

/* Load more trigger */
.load-more-trigger {
    display: none;
    justify-content: center;
    padding: 2rem;
}

.load-more-trigger.visible {
    display: flex;
}

/* Order drawer */
.order-drawer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.drawer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.drawer-content {
    position: relative;
    width: 100%;
    max-width: var(--content-width);
    max-height: 85vh;
    background: var(--bg-secondary);
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.drawer-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.drawer-close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

/* Drawer details */
.detail-section {
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    min-width: 80px;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.detail-value.mono {
    font-family: monospace;
    color: var(--accent);
}

.detail-value.copyable {
    cursor: pointer;
    background: rgba(139, 92, 246, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s;
}

.detail-value.copyable:hover {
    background: rgba(139, 92, 246, 0.2);
}

.detail-value.copyable.copied {
    background: var(--success);
    color: white;
}

/* Plan transition */
.plan-transition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.plan-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    font-weight: 500;
}

.plan-badge.from {
    opacity: 0.6;
}

.plan-badge.to {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent);
}

.plan-arrow {
    color: var(--accent);
    font-size: 1.25rem;
}

/* Drawer status lights */
.drawer-lights {
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
}

.drawer-light {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.drawer-light .light-dot {
    width: 16px;
    height: 16px;
}

.drawer-light-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Status message */
.status-message {
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 0.75rem;
    text-align: center;
    margin-bottom: 1rem;
}

.status-message.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-message.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.status-message.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.countdown-timer {
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* Action buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.approve {
    background: var(--success);
    color: white;
}

.action-btn.approve:hover:not(:disabled) {
    background: #16a34a;
    transform: translateY(-2px);
}

.action-btn.decline {
    background: var(--danger);
    color: white;
}

.action-btn.decline:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
}

.action-btn.identify {
    background: var(--blue);
    color: white;
}

.action-btn.identify:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
}

.action-btn.close {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    margin-top: 0.5rem;
}

.action-btn.close:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* Empty state */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-text {
    color: var(--text-secondary);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    z-index: 2000;
    animation: fadeInUp 0.3s ease-out;
}

.toast.success {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.toast.error {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .stats-bar {
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .stat-item {
        font-size: 0.8rem;
    }
    
    .stat-label {
        display: none;
    }
    
    .order-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .order-meta {
        width: 100%;
        justify-content: flex-end;
    }
    
    .drawer-lights {
        flex-wrap: wrap;
        justify-content: center;
    }
}
