/* ========================================
   KNOWLEDGE ARCHITECTURE (SECTION 7)
   ======================================== */

.knowledge-section {
    position: relative;
    padding: 0;
    min-height: auto;
    background: var(--color-darker);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Background Tech Grid */
.knowledge-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 0%, transparent 80%);
    pointer-events: none;
    z-index: 0;
}

.knowledge-container {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* Headers */
.knowledge-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 0.8s ease-out backwards;
}

.knowledge-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--color-light);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 0 40px rgba(0, 212, 255, 0.2);
}

.knowledge-subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    font-weight: 300;
    letter-spacing: 0.05em;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    display: inline-block;
}

.knowledge-subtitle::before,
.knowledge-subtitle::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40px;
    height: 1px;
    background: var(--color-primary);
    opacity: 0.3;
}

.knowledge-subtitle::before {
    right: 100%;
    margin-right: 15px;
}

.knowledge-subtitle::after {
    left: 100%;
    margin-left: 15px;
}

/* Main Grid System */
.k-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    perspective: 1000px;
}

/* Card Common Styles */
.k-card {
    background: #0a0e27;
    /* Solid background for better contrast calculation */
    border: 1px solid rgba(0, 212, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 12px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
}

.k-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.k-card:hover {
    transform: translateY(-5px);
    background: rgba(10, 14, 39, 0.8);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.k-card:hover::before {
    opacity: 1;
}

.k-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.k-card-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--color-light);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.k-desc {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.k-status {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: block;
    margin-top: auto;
}

/* Disabled State */
.k-card.locked {
    opacity: 0.7;
    filter: grayscale(0.8);
}

.k-card.locked:hover {
    filter: grayscale(0.5);
    transform: translateY(-2px);
    box-shadow: none;
    cursor: not-allowed;
}

.k-card.locked .k-status {
    color: #555;
}

/* Active State (Cloud) */
/* Active State (Cloud - Distinctive & Vibrant: Fuschia + Phosphorescent) */
/* Active State (Cloud - Distinctive & Vibrant: Fuschia + Phosphorescent) */
.k-card.active-selection {
    border-color: #ff00ff;
    /* Neon Fuschia */
    background: linear-gradient(135deg, rgba(255, 0, 255, 0.15) 0%, rgba(57, 255, 20, 0.05) 100%);
    /* Purple to Neon Green hint */
    cursor: pointer;
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.3), inset 0 0 10px rgba(57, 255, 20, 0.1);
}

.k-card.active-selection:hover {
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.5), inset 0 0 20px rgba(57, 255, 20, 0.2);
    transform: translateY(-5px) scale(1.02);
    border-color: #39ff14;
    /* Hover turns border Neon Green */
}

.k-card.active-selection .k-icon {
    filter: drop-shadow(0 0 8px rgba(255, 0, 255, 0.8));
    transform: scale(1.1);
}

.k-card.active-selection .k-card-title {
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

@supports (-webkit-background-clip: text) {
    .k-card.active-selection .k-card-title {
        background: linear-gradient(135deg, #ffffff 0%, #39ff14 100%);
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
    }
}

.k-card.active-selection .k-status {
    color: #39ff14;
    /* Text is Neon Green */
    font-weight: 700;
    position: relative;
    padding-right: 20px;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.6);
}

.k-card.active-selection .k-status::after {
    content: '→';
    position: absolute;
    right: 0;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 0 4px #39ff14);
    color: #39ff14;
}

.k-card.active-selection:hover .k-status::after {
    transform: translateX(5px);
}

/* Active & Expanded Logic */
.k-card.expanded {
    grid-column: 1 / -1;
    /* Span fully */
    min-height: auto;
    background: rgba(5, 8, 22, 0.95);
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 50px rgba(0, 212, 255, 0.1);
    z-index: 10;
}

.k-sub-system {
    display: none;
    /* Hidden by default */
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    animation: fadeIn 0.5s ease;
}

.k-card.expanded .k-sub-system {
    display: block;
}

.k-card.expanded .k-content-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Sub-Cards Grid */
.sub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.sub-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
}

.sub-card:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

.sub-title {
    color: var(--color-light);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: block;
}

.sub-desc {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    display: block;
}

.sub-cta {
    font-size: 0.75rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Locked Tooltip Animation */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake-lock {
    animation: shake 0.3s ease-in-out;
    color: #ff3366 !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .k-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .k-grid {
        grid-template-columns: 1fr;
    }

    .knowledge-title {
        font-size: 2.2rem;
    }

    .k-card.expanded .k-content-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* ========================================
   KNOWLEDGE ARCHITECTURE - SUB-DOMAINS
   ======================================== */

.knowledge-expansion-zone {
    position: relative;
    width: 100%;
    margin-top: var(--spacing-md);
    min-height: 200px;
    transition: all 0.5s ease;
}

.sub-domain-group {
    display: none;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.sub-domain-group.active-group {
    display: block;
}

.sub-domain-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    padding-bottom: 1rem;
}

.sub-domain-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-primary);
}

.sub-domain-desc {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    max-width: 600px;
}

/* Sub-Cards Grid */
.sub-grid-system {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Sub-Card Styling */
.s-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.s-card:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.1);
}

.s-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--color-text-muted);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.s-card:hover::before {
    opacity: 1;
    background: var(--color-accent);
}

/* Active Sub-Card Style (Cloud) */
.s-card.active-link::before {
    background: var(--color-primary);
    opacity: 1;
}

.s-card.active-link:hover {
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

.s-title {
    color: var(--color-light);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.s-desc {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.s-cta {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    /* Improved contrast from #666 */
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.s-card.active-link .s-cta {
    color: var(--color-primary);
}

.coming-soon-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    /* Higher contrast against text */
    color: #ffffff;
}




@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Featured Star Animation (Neon Stroke Circulation) */
.featured-star {
    width: 1.8rem;
    height: 1.8rem;
    vertical-align: middle;
    margin-left: 0.5rem;
    overflow: visible;
}

.featured-star path {
    fill: rgba(255, 215, 0, 0.2);
    /* Semi-transparent Gold */
    stroke: url(#neonGradient);
    /* Fallback or specific color if defs used, but using color here */
    stroke: #39ff14;
    /* Neon Green Base */
    stroke-width: 20;
    stroke-linejoin: round;
    stroke-linecap: round;
    paint-order: stroke;

    /* Traveling Light Effect */
    stroke-dasharray: 250 1400;
    /* Short glowing segment, long gap */
    stroke-dashoffset: 1650;
    animation: starCirculate 2s linear infinite;
    filter: drop-shadow(0 0 8px #39ff14);
}

@keyframes starCirculate {
    to {
        stroke-dashoffset: 0;
    }
}