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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0a1a 0%, #001a14 50%, #0a1628 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Matrix Rain Canvas - Very subtle */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.12;
    pointer-events: none;
}

/* Navy Blue Side Gradient Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(10, 20, 50, 0.6) 0%, 
        rgba(15, 30, 70, 0.3) 50%, 
        transparent 100%);
    z-index: 0;
    pointer-events: none;
}

/* Right side subtle warm glow */
body::after {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    width: 30%;
    height: 100%;
    background: linear-gradient(270deg, 
        rgba(0, 100, 80, 0.15) 0%, 
        transparent 100%);
    z-index: 0;
    pointer-events: none;
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 3rem 1rem;
}

@media (min-width: 640px) {
    .main-content {
        padding: 3rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 3rem 2rem;
    }
}

/* Header Section */
.header {
    max-width: 896px;
    margin: 0 auto 3rem;
    text-align: center;
}

/* Shield Logo */
.shield-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.shield-logo svg {
    color: #00ffaa;
    filter: drop-shadow(0 0 15px rgba(0, 255, 170, 0.4));
    animation: shield-pulse 4s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.shield-logo:hover svg {
    transform: scale(1.05);
}

.shield-outer {
    opacity: 0.25;
}

@keyframes shield-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(0, 255, 170, 0.3)) drop-shadow(0 0 30px rgba(0, 150, 255, 0.1));
    }
    50% {
        filter: drop-shadow(0 0 25px rgba(0, 255, 170, 0.5)) drop-shadow(0 0 50px rgba(0, 150, 255, 0.2));
    }
}

/* Glitch Effect */
.glitch-container {
    position: relative;
    display: inline-block;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.glitch-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    position: relative;
    display: inline-block;
    text-shadow: 0 0 20px rgba(0, 255, 170, 0.3);
}

@media (min-width: 640px) {
    .glitch-text {
        font-size: 2.5rem;
    }
}

@media (min-width: 768px) {
    .glitch-text {
        font-size: 3.25rem;
    }
}

.text-white {
    color: #ffffff;
}

.text-emerald {
    color: #00ffaa;
    text-shadow: 0 0 30px rgba(0, 255, 170, 0.5);
}

/* Glitch Animation */
.glitch-text.glitching {
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
}

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

.glitch-text.glitching::before {
    color: #00ffaa;
    animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    animation-delay: 0.05s;
    clip-path: inset(40% 0 61% 0);
}

.glitch-text.glitching::after {
    color: #ff0066;
    animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    clip-path: inset(25% 0 58% 0);
}

@keyframes glitch-1 {
    0% { clip-path: inset(40% 0 61% 0); transform: translate(-2px, 2px); }
    20% { clip-path: inset(92% 0 1% 0); transform: translate(2px, -2px); }
    40% { clip-path: inset(43% 0 1% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(25% 0 58% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(54% 0 7% 0); transform: translate(-2px, 2px); }
    100% { clip-path: inset(58% 0 43% 0); transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0% { clip-path: inset(25% 0 58% 0); transform: translate(2px, -2px); }
    20% { clip-path: inset(54% 0 7% 0); transform: translate(-2px, 2px); }
    40% { clip-path: inset(58% 0 43% 0); transform: translate(2px, -2px); }
    60% { clip-path: inset(40% 0 61% 0); transform: translate(-2px, 2px); }
    80% { clip-path: inset(92% 0 1% 0); transform: translate(2px, -2px); }
    100% { clip-path: inset(43% 0 1% 0); transform: translate(-2px, 2px); }
}

@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    10% { transform: skew(-2deg); }
    20% { transform: skew(2deg); }
    30% { transform: skew(0deg); }
    40% { transform: skew(-1deg); }
    50% { transform: skew(1deg); }
    60% { transform: skew(0deg); }
    70% { transform: skew(-2deg); }
    80% { transform: skew(2deg); }
    90% { transform: skew(0deg); }
    100% { transform: skew(0deg); }
}

/* Subtitle */
.subtitle {
    color: rgba(0, 255, 170, 0.85);
    font-size: 0.875rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.2);
}

@media (min-width: 640px) {
    .subtitle {
        font-size: 1rem;
    }
}

/* Channel Count */
.channel-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(100, 200, 255, 0.6);
    font-size: 0.875rem;
}

.users-icon {
    flex-shrink: 0;
}

/* Channels Container */
.channels-container {
    max-width: 896px;
    margin: 0 auto;
}

/* Channel Cards - Glassmorphism style */
.channel-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, 
        rgba(0, 60, 50, 0.25) 0%, 
        rgba(10, 30, 60, 0.2) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 255, 170, 0.15);
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

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

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

.channel-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 
        0 12px 40px rgba(0, 255, 170, 0.12),
        0 0 60px rgba(0, 100, 200, 0.08);
    border-color: rgba(0, 255, 170, 0.35);
    background: linear-gradient(135deg, 
        rgba(0, 80, 70, 0.35) 0%, 
        rgba(15, 40, 80, 0.25) 100%);
}

.channel-card.featured {
    background: linear-gradient(135deg, 
        rgba(0, 255, 170, 0.12) 0%, 
        rgba(0, 100, 150, 0.15) 50%,
        rgba(10, 30, 60, 0.2) 100%);
    border-color: rgba(0, 255, 170, 0.25);
    border-width: 1.5px;
    margin-bottom: 1rem;
}

.channel-card.featured:hover {
    border-color: rgba(0, 255, 170, 0.5);
    box-shadow: 
        0 15px 50px rgba(0, 255, 170, 0.2),
        0 0 80px rgba(0, 150, 255, 0.1);
}

.card-content {
    flex: 1;
}

/* Featured Badge */
.featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(0, 255, 170, 0.2) 0%, rgba(0, 150, 200, 0.15) 100%);
    color: #00ffaa;
    border: 1px solid rgba(0, 255, 170, 0.35);
    margin-bottom: 0.75rem;
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
}

.star {
    color: #fbbf24;
    filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.5));
}

/* Card Header */
.card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.icon-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, rgba(0, 255, 170, 0.15) 0%, rgba(0, 150, 200, 0.1) 100%);
    color: #00ffaa;
    flex-shrink: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 255, 170, 0.1);
}

.channel-card:hover .icon-box {
    background: linear-gradient(135deg, rgba(0, 255, 170, 0.25) 0%, rgba(0, 150, 200, 0.15) 100%);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.2);
}

.card-info h3,
.card-header h3 {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
    transition: color 0.3s ease;
}

.channel-card:hover .card-info h3,
.channel-card:hover .card-header h3 {
    color: #00ffcc;
}

.card-info p,
.card-description {
    color: rgba(150, 220, 255, 0.65);
    font-size: 0.8125rem;
    line-height: 1.6;
    transition: color 0.3s ease;
}

.channel-card:hover .card-info p,
.channel-card:hover .card-description {
    color: rgba(150, 230, 255, 0.8);
}

.card-description {
    padding-left: 3.375rem;
    margin-top: 0.375rem;
}

/* External Link Icon */
.external-link {
    color: rgba(100, 200, 255, 0.4);
    flex-shrink: 0;
    margin-left: 0.75rem;
    margin-top: 0.25rem;
    transition: all 0.3s ease;
}

.channel-card:hover .external-link {
    color: rgba(0, 255, 170, 0.8);
    transform: translate(2px, -2px);
}

/* Channels Grid */
.channels-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .channels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Footer */
footer {
    max-width: 896px;
    margin: 4rem auto 0;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 255, 170, 0.08);
}

footer p {
    color: rgba(100, 180, 220, 0.5);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
}

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

::-webkit-scrollbar-track {
    background: #0a0a1a;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(0, 255, 170, 0.3) 0%, rgba(0, 100, 200, 0.3) 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(0, 255, 170, 0.5) 0%, rgba(0, 100, 200, 0.5) 100%);
}

/* Selection Styling */
::selection {
    background: rgba(0, 255, 170, 0.25);
    color: #ffffff;
}

/* Focus Styling */
a:focus-visible {
    outline: 2px solid rgba(0, 255, 170, 0.5);
    outline-offset: 3px;
    border-radius: 0.5rem;
}

/* Loading animation for cards */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.channel-card {
    animation: cardFadeIn 0.6s ease forwards;
}

.channel-card:nth-child(1) { animation-delay: 0.1s; }
.channel-card:nth-child(2) { animation-delay: 0.15s; }
.channel-card:nth-child(3) { animation-delay: 0.2s; }
.channel-card:nth-child(4) { animation-delay: 0.25s; }
.channel-card:nth-child(5) { animation-delay: 0.3s; }
.channel-card:nth-child(6) { animation-delay: 0.35s; }
.channel-card:nth-child(7) { animation-delay: 0.4s; }
.channel-card:nth-child(8) { animation-delay: 0.45s; }
.channel-card:nth-child(9) { animation-delay: 0.5s; }
