/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --card-bg: #1e1e1e;
    --accent-green: #00ff41;
    --accent-blue: #00d4ff;
    --accent-purple: #8b5cf6;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --border-color: #333333;
    --danger-color: #ff4444;
    --warning-color: #ffaa00;
    --success-color: #00ff41;
    --font-mono: 'JetBrains Mono', monospace;
    --font-display: 'Orbitron', monospace;
}

body {
    font-family: var(--font-mono);
    background: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Matrix Background Animation */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(45deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.matrix-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 255, 65, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    animation: matrixPulse 8s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes matrixPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

/* Glitch Overlay */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 65, 0.03) 2px,
        rgba(0, 255, 65, 0.03) 4px
    );
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Glitch Text Effect */
.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: var(--accent-blue);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: var(--danger-color);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% {
        transform: translate(0);
    }
    15%, 49% {
        transform: translate(-2px, -1px);
    }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% {
        transform: translate(0);
    }
    21%, 62% {
        transform: translate(2px, 1px);
    }
}

/* Header Styles */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-green);
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-text:hover {
    text-shadow: 0 0 10px var(--accent-green);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-blue);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-blue);
}

.nav-link:hover::after {
    width: 100%;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    width: 200px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.search-btn {
    background: var(--accent-green);
    border: none;
    color: var(--primary-bg);
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--accent-blue);
    transform: scale(1.05);
}

/* Main Content */
main {
    margin-top: 100px;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 1.5rem;
    background: linear-gradient(45deg, var(--accent-green), var(--accent-blue), var(--accent-purple));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientText 3s ease infinite;
}

@keyframes gradientText {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filters Section */
.filters {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-green);
    color: var(--primary-bg);
    border-color: var(--accent-green);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 65, 0.3);
}

.sort-select {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-green);
}

/* Category Sections */
.category-section {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 2rem;
}

.category-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 1rem;
    text-align: center;
}

.category-description {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* Resources Grid */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

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

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.1), transparent);
    transition: left 0.5s ease;
}

.resource-card:hover::before {
    left: 100%;
}

.resource-card:hover {
    border-color: var(--accent-green);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.2);
}

.resource-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.resource-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.status-online {
    background: rgba(0, 255, 65, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-offline {
    background: rgba(255, 68, 68, 0.2);
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
}

.status-unknown {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.resource-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.resource-links {
    margin-bottom: 1rem;
}

.main-link {
    display: inline-block;
    background: var(--accent-green);
    color: var(--primary-bg);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.main-link:hover {
    background: var(--accent-blue);
    transform: scale(1.05);
}

.mirror-links {
    margin-top: 0.5rem;
}

.mirrors-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.mirror-link {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.9rem;
    margin-right: 1rem;
    transition: color 0.3s ease;
}

.mirror-link:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

.resource-meta {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Footer */
footer {
    background: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: var(--accent-green);
    margin-bottom: 1rem;
    font-family: var(--font-display);
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .search-container {
        order: 2;
    }
    
    .search-input {
        width: 150px;
    }
    
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-container {
        justify-content: center;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .resource-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 1.5rem 1rem;
    }
    
    .category-section {
        padding: 0 1rem;
    }
    
    .resource-card {
        padding: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .filter-container {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Hidden class for filtering */
.hidden {
    display: none !important;
}

/* Loading animation */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}
