/* ---------- Futuristic Neon Design ---------- */
:root {
    --bg: #0a0e1a;
    --surface: #111827;
    --card-bg: #0f1629;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: #1e293b;
    --accent: #06b6d4;
    --accent-hover: #22d3ee;
    --accent-glow: rgba(6, 182, 212, 0.4);
    --neon-pink: #ec4899;
    --neon-purple: #a855f7;
    --neon-blue: #3b82f6;
    --gradient-primary: linear-gradient(135deg, #06b6d4, #a855f7);
    --gradient-card: linear-gradient(145deg, #111827, #0f1629);
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 2rem 1rem;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(236, 72, 153, 0.04) 0%, transparent 50%);
    min-height: 100vh;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 120px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
}

h1 {
    font-weight: 700;
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.site-stats {
    color: var(--text-secondary);
    font-size: 0.85rem;
    background: var(--surface);
    padding: 0.4rem 1.2rem;
    border-radius: 2rem;
    border: 1px solid var(--border);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Control panel */
.control-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.search-form {
    display: flex;
    flex: 1 1 300px;
    max-width: 600px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 46px;
    padding: 0 1rem 0 2.5rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem 0 0 0.75rem;
    font-size: 1rem;
    outline: none;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-button {
    height: 46px;
    padding: 0 1.8rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 0 0.75rem 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, box-shadow 0.3s;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.search-button:hover {
    opacity: 0.9;
    box-shadow: 0 0 20px var(--accent-glow);
}

.view-options {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
}

.view-btn i {
    font-size: 1rem;
}

.view-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.view-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 16px var(--accent-glow);
}

/* Cards grid / list */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.5rem;
}

.sites-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.site-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.site-card:hover {
    border-color: var(--accent);
    box-shadow:
        0 0 20px rgba(6, 182, 212, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.site-card:hover::before {
    opacity: 1;
}

.site-card-grid {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.site-card-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem;
    padding: 1.25rem;
    align-items: center;
}

.site-favicon {
    width: 48px;
    height: 48px;
    background: var(--surface);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: box-shadow 0.3s;
}

.site-card:hover .site-favicon {
    box-shadow: 0 0 12px var(--accent-glow);
}

.site-card-list .site-favicon {
    width: 40px;
    height: 40px;
}

.site-favicon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.site-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.site-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.site-title a:hover {
    color: var(--accent-hover);
    text-shadow: 0 0 8px var(--accent-glow);
}

.site-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.site-url {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    word-break: break-all;
    display: inline-block;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed transparent;
    transition: color 0.2s, border-bottom-color 0.2s;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

.site-url:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.site-visit {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    transition: all 0.3s;
}

.site-visit:hover {
    box-shadow: 0 0 20px var(--accent-glow);
    opacity: 0.9;
}

/* No results */
.no-results {
    text-align: center;
    padding: 4rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    color: var(--text-secondary);
}

.no-results i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
    color: var(--accent);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.6rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    cursor: pointer;
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.pagination .current {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 16px var(--accent-glow);
}

.pagination .disabled {
    opacity: 0.3;
    pointer-events: none;
    background: var(--surface);
}

/* Dots (ellipsis) styling */
.pagination span:not(.current):not(.disabled) {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    min-width: auto;
    padding: 0 0.25rem;
}

/* Notification */
.notification {
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--accent-hover);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(6, 182, 212, 0.3);
    font-weight: 500;
}

/* Refresh progress */
.refresh-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.refresh-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    padding: 2.5rem;
    min-width: 400px;
    max-width: 90vw;
    text-align: center;
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.1);
}

.refresh-modal h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--card-bg);
    border-radius: 3px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
    box-shadow: 0 0 10px var(--accent-glow);
}

.refresh-status {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.refresh-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Selection */
::selection {
    background: rgba(6, 182, 212, 0.3);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .control-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .view-options {
        margin-left: 0;
        justify-content: flex-end;
    }

    .sites-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        gap: 0.25rem;
    }

    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .refresh-modal {
        min-width: auto;
    }
}
