/* Resources Pages - Cyberpunk Theme */

:root {
    --cyber-bg: #0a0020;
    --cyber-bg2: #0d0030;
    --cyber-card: rgba(13, 0, 48, 0.85);
    --cyber-border: rgba(255, 0, 204, 0.15);
    --neon-pink: #ff00cc;
    --neon-cyan: #00d9ff;
    --neon-purple: #9d00ff;
    --neon-green: #00ff88;
    --neon-yellow: #ffe600;
    --text-primary: #f0f0ff;
    --text-secondary: rgba(240, 240, 255, 0.6);
    --text-dim: rgba(240, 240, 255, 0.35);
}

.resources-page {
    background: var(--cyber-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
    position: relative;
}

#bgCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Navigation */
.resources-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(10, 0, 32, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--cyber-border);
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--neon-cyan);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 217, 255, 0.2);
    min-height: 44px;
    min-width: 44px;
}

.back-link:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

.nav-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--text-primary);
}

.nav-title .accent {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hero */
.resources-hero {
    position: relative;
    text-align: center;
    padding: 8rem 2rem 4rem;
    z-index: 1;
}

.hero-glitch {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-pink) 50%, var(--neon-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    text-transform: uppercase;
    animation: glitchText 3s infinite;
}

.hero-glitch::before,
.hero-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-glitch::before {
    -webkit-text-fill-color: var(--neon-cyan);
    animation: glitchBefore 3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 33%, 0 33%);
}

.hero-glitch::after {
    -webkit-text-fill-color: var(--neon-pink);
    animation: glitchAfter 3s infinite;
    clip-path: polygon(0 66%, 100% 66%, 100% 100%, 0 100%);
}

.hero-sub {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.8rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.5em;
    margin-top: 0.5rem;
    text-transform: uppercase;
}

.hero-desc {
    max-width: 600px;
    margin: 2rem auto 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.hero-scanline {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    animation: scanline 4s linear infinite;
}

/* Main Content */
.resources-main {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* Category Cards */
.resource-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.category-card {
    position: relative;
    display: block;
    background: var(--cyber-card);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid var(--cyber-border);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    cursor: pointer;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-pink));
    opacity: 0;
    transition: opacity 0.3s;
}

.category-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 0, 204, 0.4);
    box-shadow:
        0 20px 60px rgba(157, 0, 255, 0.2),
        0 0 40px rgba(0, 217, 255, 0.1);
}

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

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(157, 0, 255, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.category-card:hover .card-glow {
    opacity: 1;
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.category-card[data-category="ai"] .card-icon {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(157, 0, 255, 0.2));
    color: var(--neon-cyan);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.15);
}

.category-card[data-category="mcu"] .card-icon {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 217, 255, 0.2));
    color: var(--neon-green);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.15);
}

.category-card[data-category="books"] .card-icon {
    background: linear-gradient(135deg, rgba(255, 0, 204, 0.2), rgba(255, 230, 0, 0.2));
    color: var(--neon-pink);
    box-shadow: 0 0 30px rgba(255, 0, 204, 0.15);
}

.card-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    position: relative;
    z-index: 1;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.card-tags span {
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.card-count {
    color: var(--text-dim);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
    z-index: 1;
}

.card-arrow {
    position: absolute;
    bottom: 2.5rem;
    right: 2.5rem;
    color: var(--text-dim);
    transition: all 0.3s;
    font-size: 1rem;
}

.category-card:hover .card-arrow {
    color: var(--neon-cyan);
    transform: translateX(4px);
}

/* Info Section */
.resources-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.info-card:hover {
    border-color: rgba(255, 0, 204, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.info-icon {
    font-size: 1.5rem;
    color: var(--neon-purple);
    margin-bottom: 1rem;
}

.info-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.info-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Footer */
.resources-footer {
    position: relative;
    z-index: 1;
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid var(--cyber-border);
}

.resources-footer .footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.logo-accent {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.resources-footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.resources-footer .footer-links a {
    color: var(--text-dim);
    font-size: 1.2rem;
    transition: all 0.3s;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resources-footer .footer-links a:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

/* ===== Sub-Page Styles ===== */

.sub-page-content {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
    padding-top: 7rem;
}

.sub-page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.sub-page-header .sub-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.sub-page-header .sub-icon.ai-color { color: var(--neon-cyan); text-shadow: 0 0 30px rgba(0, 217, 255, 0.4); }
.sub-page-header .sub-icon.mcu-color { color: var(--neon-green); text-shadow: 0 0 30px rgba(0, 255, 136, 0.4); }
.sub-page-header .sub-icon.books-color { color: var(--neon-pink); text-shadow: 0 0 30px rgba(255, 0, 204, 0.4); }

.sub-page-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.sub-page-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Resource List */
.resource-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.resource-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--cyber-card);
    border: 1px solid var(--cyber-border);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.resource-item:hover {
    transform: translateX(6px);
    border-color: rgba(0, 217, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 217, 255, 0.1);
}

.resource-item-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.resource-item-body {
    flex: 1;
    min-width: 0;
}

.resource-item-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.resource-item-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

.resource-item-url {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-top: 0.3rem;
    word-break: break-all;
}

.resource-item-arrow {
    color: var(--text-dim);
    font-size: 0.9rem;
    transition: all 0.3s;
    align-self: center;
}

.resource-item:hover .resource-item-arrow {
    color: var(--neon-cyan);
    transform: translateX(3px);
}

/* Category tags on sub-pages */
.sub-page-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
}

.sub-page-tags span {
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: default;
}

/* Animations */
@keyframes glitchText {
    0%, 100% { text-shadow: 0 0 10px rgba(0, 217, 255, 0.3); }
    2% { text-shadow: -2px 0 var(--neon-cyan), 2px 0 var(--neon-pink); }
    4% { text-shadow: 0 0 10px rgba(0, 217, 255, 0.3); }
    50% { text-shadow: 0 0 10px rgba(0, 217, 255, 0.3); }
    52% { text-shadow: 2px 0 var(--neon-pink), -2px 0 var(--neon-cyan); }
    54% { text-shadow: 0 0 10px rgba(0, 217, 255, 0.3); }
}

@keyframes glitchBefore {
    0%, 100% { transform: translate(0); }
    2% { transform: translate(3px, -1px); }
    4% { transform: translate(0); }
}

@keyframes glitchAfter {
    0%, 100% { transform: translate(0); }
    52% { transform: translate(-3px, 1px); }
    54% { transform: translate(0); }
}

@keyframes scanline {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .resources-hero {
        padding: 7rem 1.5rem 3rem;
    }

    .hero-glitch {
        font-size: 2rem;
    }

    .hero-sub {
        font-size: 1.2rem;
        letter-spacing: 0.3em;
    }

    .resource-categories {
        grid-template-columns: 1fr;
    }

    .sub-page-content {
        padding: 1.5rem;
        padding-top: 6rem;
    }

    .sub-page-header h1 {
        font-size: 1.6rem;
    }

    .resource-item {
        flex-direction: column;
        gap: 1rem;
    }

    .resource-item-arrow {
        display: none;
    }

    .nav-title {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hero-glitch {
        font-size: 2.8rem;
    }

    .resource-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}
