/* Topic Pages Specific Styles - Optimized Version */

/* Topic Header */
.topic-header {
    width: 100%;
    padding: 80px 0 50px;
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
}

/* AI Header Background */
#ai-header {
    background: linear-gradient(to right, rgba(10, 10, 10, 0.95), rgba(10, 10, 10, 0.8)), 
                url('/api/placeholder/1200/400');
    background-size: cover;
    background-position: center;
    position: relative;
}

#ai-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 50%, rgba(76, 201, 240, 0.1) 0%, rgba(10, 10, 10, 0) 70%);
    z-index: 1;
}

.topic-title-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.topic-title {
    font-size: 3.5rem;
    margin-bottom: 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    background: linear-gradient(to right, #4cc9f0, #7209b7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.breadcrumb {
    display: flex;
    gap: 10px;
    color: var(--text-color-muted);
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

/* Topic Content Section */
.topic-content-section {
    background-color: var(--bg-color-alt);
    padding: 50px 0;
    min-height: calc(100vh - 300px);
}

.topic-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sidebar Styles */
.topic-sidebar {
    position: sticky;
    top: 30px;
    height: fit-content;
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 25px;
    border-left: 4px solid #4cc9f0;
    transition: all 0.3s ease;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 15px;
}

.sidebar-nav li a {
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    color: var(--text-color-muted);
    transition: all 0.3s ease;
    font-size: 1rem;
}

.sidebar-nav li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    transform: translateX(5px);
}

.sidebar-nav li.active a {
    background-color: rgba(76, 201, 240, 0.1);
    color: #4cc9f0;
    font-weight: 500;
    border-left: 3px solid #4cc9f0;
}

/* Main Content Styles */
.topic-main-content {
    background-color: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 35px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.topic-article {
    display: none;
    animation: fadeInFast 0.2s ease forwards; /* Animasi lebih cepat */
}

.topic-article.active {
    display: block;
}

.topic-article h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    color: #4cc9f0;
    font-family: 'Montserrat', sans-serif;
    position: relative;
    padding-bottom: 10px;
}

.topic-article h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #4cc9f0, #7209b7);
}

.topic-article p {
    margin-bottom: 20px;
    font-size: 1.05rem;
    line-height: 1.7;
}

.topic-image {
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.topic-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.topic-image caption {
    display: block;
    padding: 10px 15px;
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--text-color-muted);
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
}

/* Optimized Animations */
@keyframes fadeInFast {
    from {
        opacity: 0;
        transform: translateY(8px); /* Gerakan lebih kecil */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alternative instant show for immediate content display */
.topic-article.instant {
    animation: none;
    opacity: 1;
    transform: none;
}

/* Quick fade for individual elements */
.quick-fade {
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.15s ease;
}

.quick-fade.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Footer khusus halaman topik agar selalu rata tengah dan tidak terpengaruh grid */
footer {
    grid-column: 1 / -1; /* Supaya footer selalu full width di grid */
    text-align: center;
    padding: 30px 0;
    background-color: var(--bg-color-alt);
    color: var(--text-color-muted);
    font-size: 0.9rem;
    width: 100%;
    margin: 0 auto;
    display: block;
}      

@media (max-width: 900px) {
    footer {
        padding: 24px 0;
        font-size: 0.95rem;
    }
}

/* Responsive Styles */
@media (max-width: 900px) {
    .topic-container {
        grid-template-columns: 1fr;
    }
    
    .topic-sidebar {
        position: relative;
        top: 0;
        margin-bottom: 30px;
    }
    
    .topic-title {
        font-size: 2.5rem;
    }
    
    /* Disable complex animations on mobile for better performance */
    .topic-article {
        animation: none;
    }
    
    .topic-article.active {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 600px) {
    .topic-main-content {
        padding: 20px;
    }
    
    .topic-article h2 {
        font-size: 1.8rem;
    }
    
    .topic-title {
        font-size: 2rem;
    }
}