/**
 * Proxy Tools Hub - Custom Styles
 * 
 * Glassmorphism design system, animations, and component styles.
 * Works alongside Tailwind CSS CDN.
 */

/* ─── CSS Custom Properties ─────────────────────────────────────── */
:root {
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    --glass-blur: 16px;
    --purple-glow: rgba(124, 58, 237, 0.15);
    --transition-speed: 0.2s;
}

/* Light mode overrides */
html:not(.dark) {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --purple-glow: rgba(124, 58, 237, 0.08);
}

/* ─── Light Mode Body ───────────────────────────────────────────── */
html:not(.dark) body {
    background: #f5f3ff;
    color: #1e1b2e;
}

html:not(.dark) .bg-surface-950 {
    background: #f5f3ff !important;
}

/* ─── Glassmorphism Components ──────────────────────────────────── */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    transition: all var(--transition-speed) ease;
}

.glass-card:hover {
    border-color: rgba(124, 58, 237, 0.2);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.08);
}

.glass-nav {
    background: rgba(15, 13, 26, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

html:not(.dark) .glass-nav {
    background: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.glass-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    transition: all var(--transition-speed) ease;
}

.glass-input:focus {
    border-color: rgba(124, 58, 237, 0.5);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
    outline: none;
}

html:not(.dark) .glass-input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.12);
    color: #1e1b2e;
}

/* ─── Navigation Styles ─────────────────────────────────────────── */
.nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

html:not(.dark) .nav-link {
    color: rgba(0, 0, 0, 0.5);
}

html:not(.dark) .nav-link:hover {
    color: #1e1b2e;
    background: rgba(0, 0, 0, 0.04);
}

.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    min-width: 200px;
    padding: 0.5rem;
    background: rgba(20, 18, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s ease;
}

html:not(.dark) .nav-dropdown {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.group\/net:hover .nav-dropdown,
.group\/gen:hover .nav-dropdown,
.group\/dev:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
    transition: all var(--transition-speed) ease;
}

.nav-dropdown-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

html:not(.dark) .nav-dropdown-item {
    color: rgba(0, 0, 0, 0.6);
}

html:not(.dark) .nav-dropdown-item:hover {
    color: #1e1b2e;
    background: rgba(0, 0, 0, 0.04);
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 0.5rem;
    transition: all var(--transition-speed) ease;
}

.mobile-nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
    transition: all var(--transition-speed) ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(124, 58, 237, 0.45);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.btn-secondary:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

html:not(.dark) .btn-secondary {
    color: rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

.btn-icon:hover {
    color: white;
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.3);
}

/* ─── Tool Page Layout ──────────────────────────────────────────── */
.tool-hero {
    padding: 3rem 0 2rem;
    margin-bottom: 2rem;
}

.tool-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

html:not(.dark) .tool-hero h1 {
    background: linear-gradient(135deg, #1e1b2e, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
}

.tool-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .tool-container {
        padding: 0 1.5rem;
    }
}

/* ─── Status Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-success {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-danger {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-info {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.2);
}

.badge-protocol {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.08);
    border: 1px solid rgba(192, 132, 252, 0.15);
}

/* ─── Skeleton Loading ──────────────────────────────────────────── */
.skeleton {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04), transparent);
    animation: skeleton-shimmer 1.5s infinite;
}

@keyframes skeleton-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ─── Toast Notifications ───────────────────────────────────────── */
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    pointer-events: auto;
    animation: toast-slide-in 0.3s ease-out;
    background: rgba(20, 18, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    color: white;
    max-width: 400px;
}

.toast-success { border-left: 3px solid #22c55e; }
.toast-error { border-left: 3px solid #ef4444; }
.toast-info { border-left: 3px solid #818cf8; }

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-slide-out {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ─── Proxy Table ───────────────────────────────────────────────── */
.proxy-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.proxy-table th {
    padding: 0.75rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    background: rgba(15, 13, 26, 0.95);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.proxy-table th:hover {
    color: rgba(255, 255, 255, 0.7);
}

html:not(.dark) .proxy-table th {
    color: rgba(0, 0, 0, 0.4);
    background: rgba(245, 243, 255, 0.95);
}

.proxy-table td {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    white-space: nowrap;
}

.proxy-table tbody tr {
    transition: background var(--transition-speed) ease;
}

.proxy-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

html:not(.dark) .proxy-table tbody tr:hover {
    background: rgba(124, 58, 237, 0.03);
}

/* ─── Stat Cards ────────────────────────────────────────────────── */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--stat-color, #7c3aed), transparent);
    opacity: 0.6;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, #fff, #c4b5fd);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html:not(.dark) .stat-card .stat-value {
    background: linear-gradient(135deg, #1e1b2e, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
}

/* ─── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Filter Panel ──────────────────────────────────────────────── */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    user-select: none;
}

.filter-chip:hover {
    border-color: rgba(124, 58, 237, 0.3);
    color: white;
}

.filter-chip.active {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(124, 58, 237, 0.4);
    color: #c084fc;
}

html:not(.dark) .filter-chip {
    color: rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
}

/* ─── Code Block ────────────────────────────────────────────────── */
.code-output {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.8125rem;
    line-height: 1.6;
    padding: 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #e2e8f0;
}

html:not(.dark) .code-output {
    background: rgba(0, 0, 0, 0.03);
    color: #1e1b2e;
}

/* ─── Pulse Dot ─────────────────────────────────────────────────── */
.pulse-dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    animation: pulse-ring 2s infinite;
}

.pulse-dot.green {
    background: #22c55e;
}

.pulse-dot.green::after {
    border: 2px solid rgba(34, 197, 94, 0.4);
}

.pulse-dot.red {
    background: #ef4444;
}

.pulse-dot.red::after {
    border: 2px solid rgba(239, 68, 68, 0.4);
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* ─── Hero Gradient Text ────────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #c084fc, #818cf8, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Responsive Helpers ────────────────────────────────────────── */
@media (max-width: 640px) {
    .tool-hero h1 {
        font-size: 1.75rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* ─── Line Clamp ────────────────────────────────────────────────── */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Animations ────────────────────────────────────────────────── */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.5s ease-out;
}

/* Staggered animations for cards */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ─── Light Mode Text Overrides ─────────────────────────────────── */
html:not(.dark) .text-white {
    color: #1e1b2e !important;
}

html:not(.dark) .text-gray-200 {
    color: #374151 !important;
}

html:not(.dark) .text-gray-400 {
    color: #6b7280 !important;
}

html:not(.dark) .text-gray-500 {
    color: #9ca3af !important;
}

html:not(.dark) .text-gray-600 {
    color: #4b5563 !important;
}

html:not(.dark) .border-white\/5 {
    border-color: rgba(0, 0, 0, 0.06) !important;
}

/* ─── Light Mode Background Blobs ───────────────────────────────── */
html:not(.dark) .bg-purple-900\/20 {
    background-color: rgba(243, 232, 255, 0.5) !important;
}

html:not(.dark) .bg-indigo-900\/15 {
    background-color: rgba(224, 231, 255, 0.4) !important;
}

html:not(.dark) .bg-cyan-900\/10 {
    background-color: rgba(207, 250, 254, 0.3) !important;
}
