/* ========================================
   KOPERASI DESA MERAH PUTIH - KNOWLEDGE CENTER
   File: assets/css/pengetahuan.css
   Deskripsi: Styling khusus untuk halaman Pusat Pengetahuan
   ======================================== */

/* --- 1. PAGE HEADER EXTENSIONS --- */
.page-header {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1524995997946-a1c2e315a42f?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
    background-size: cover;
    background-position: center;
    padding: 140px 0 100px;
    margin-bottom: 0;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    text-align: center;
}

.page-header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.page-header .breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    display: inline-block;
    padding: 10px 25px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* --- 2. SEARCH SECTION --- */
.knowledge-search {
    margin-top: -60px;
    position: relative;
    z-index: 10;
    background: var(--white);
    padding: 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.search-box {
    display: flex;
    gap: 15px;
    max-width: 700px;
    margin: 0 auto 25px;
    position: relative;
}

.search-box input {
    flex: 1;
    padding: 18px 25px;
    border-radius: 50px;
    border: 2px solid #eee;
    font-size: 1.1rem;
    padding-left: 55px;
    /* Space for icon if we added one inside */
    transition: all 0.3s ease;
    background: #fdfdfd;
}

.search-box input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 5px rgba(220, 20, 60, 0.1);
    background: var(--white);
}

.search-box .btn {
    padding: 0 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.search-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.search-tags .tag {
    background: var(--white);
    color: var(--gray);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid #eee;
    transition: all 0.3s ease;
    font-weight: 500;
}

.search-tags .tag:hover {
    background: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 20, 60, 0.2);
}

/* --- 3. TABS NAVIGATION --- */
.knowledge-tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 50px;
}

.tab-btn:hover {
    color: var(--primary-red);
    background: rgba(220, 20, 60, 0.05);
}

.tab-btn.active {
    color: var(--white);
    background: var(--primary-red);
    box-shadow: 0 10px 20px rgba(220, 20, 60, 0.2);
}

.tab-btn i {
    margin-right: 8px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.tab-pane.active {
    display: block;
}

/* --- 4. RESOURCE CARDS (General) --- */
.resource-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.resource-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    width: calc(25% - 23px);
    /* 4 column layout */
    min-width: 250px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #f0f0f0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.resource-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

/* E-Book Specific */
.resource-cover {
    position: relative;
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    aspect-ratio: 2/3;
}

.resource-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.resource-card:hover .resource-cover img {
    transform: scale(1.05);
}

.resource-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(3px);
}

.resource-card:hover .resource-overlay {
    opacity: 1;
}

.resource-info h4 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--dark);
    line-height: 1.4;
    height: 3.2em;
    /* Limit to 2 lines approx */
    overflow: hidden;
}

.resource-info .author {
    font-size: 0.85rem;
    color: var(--primary-red);
    margin-bottom: 10px;
    font-weight: 600;
}

.resource-info .description {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 15px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.resource-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: 20px;
    padding-top: 15px;
    border-top: 1px solid #f5f5f5;
    margin-top: auto;
    /* Push to bottom if content short */
}

/* Modul specific styles - reused resource-card but simpler */
#modul .resource-card {
    text-align: center;
    border-top: 4px solid var(--primary-red);
}

/* --- 5. VIDEO CARDS --- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.video-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.video-thumbnail {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.1);
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-card:hover .play-button {
    background: var(--primary-red);
    border-color: var(--primary-red);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
}

.video-card h4 {
    padding: 20px 20px 10px;
    font-size: 1.1rem;
    line-height: 1.4;
}

.video-meta {
    padding: 0 20px 20px;
    font-size: 0.9rem;
    color: var(--gray);
    display: flex;
    justify-content: space-between;
}

/* --- 6. ARTICLE CARDS --- */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.article-card {
    display: flex;
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    align-items: center;
}

.article-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    transform: translateX(5px);
}

.article-image {
    width: 250px;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.article-content {
    padding: 25px;
    flex: 1;
}

.article-content h3 {
    margin-bottom: 10px;
    color: var(--dark);
    font-size: 1.3rem;
}

.article-meta {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 15px;
}

.article-meta i {
    color: var(--primary-red);
    margin-right: 5px;
}

.read-more {
    color: var(--primary-red);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
}

.read-more:hover {
    text-decoration: underline;
}

/* --- 7. LEARNING PATHS --- */
.learning-paths {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.path-card {
    background: var(--white);
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.4s ease;
    border: 1px solid #f0f0f0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.path-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--primary-red);
    z-index: 2;
    transition: height 0.3s ease;
}

.path-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.path-card:hover::before {
    height: 10px;
}

.path-header {
    margin-bottom: 30px;
}

.path-header i {
    font-size: 3rem;
    color: var(--primary-red);
    margin-bottom: 20px;
    background: rgba(220, 20, 60, 0.1);
    width: 80px;
    height: 80px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.path-modules {
    list-style: none;
    text-align: left;
    margin-bottom: 30px;
}

.path-modules li {
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
    color: var(--gray);
    display: flex;
    align-items: center;
}

.path-modules li i {
    color: var(--success);
    margin-right: 15px;
    font-size: 1.1rem;
}

/* --- 8. FAQ SECTION --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background: var(--white);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.faq-item.active {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.faq-question {
    width: 100%;
    padding: 20px 25px;
    text-align: left;
    background: var(--white);
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--dark);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #fafafa;
    color: var(--primary-red);
}

.faq-item.active .faq-question {
    color: var(--primary-red);
    background: #fafafa;
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fafafa;
}

.faq-item.active .faq-answer {
    max-height: 500px;
    /* Arbitrary large height */
    padding-bottom: 25px;
    /* Add padding when open */
    border-top: 1px dashed #eee;
}

.faq-answer p {
    padding: 0 25px;
    padding-top: 15px;
    /* Add padding top to separate from border */
    color: var(--gray);
    margin-bottom: 0;
    line-height: 1.6;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 992px) {
    .resource-card {
        width: calc(33.333% - 20px);
    }
}

@media (max-width: 768px) {
    .resource-card {
        width: calc(50% - 15px);
    }

    .article-card {
        flex-direction: column;
    }

    .article-image {
        width: 100%;
        height: 200px;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input {
        width: 100%;
        margin-bottom: 10px;
    }

    .search-box .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .resource-card {
        width: 100%;
    }

    .tab-buttons {
        gap: 10px;
    }

    .tab-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        flex: 1 0 40%;
    }
}

/* --- MOBILE OPTIMIZATION EXTRA --- */
@media (max-width: 576px) {
    .page-header {
        padding: 100px 0 60px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .knowledge-search {
        padding: 25px;
        margin-top: -40px;
        margin-left: 15px;
        margin-right: 15px;
    }

    .search-box input {
        font-size: 1rem;
        padding: 15px 20px 15px 45px;
    }

    .search-tags {
        display: none;
        /* Hide tags on very small screens to save space, or limit them */
    }

    .learning-paths {
        grid-template-columns: 1fr;
    }

    .faq-question {
        font-size: 0.95rem;
        padding: 15px;
    }

    .faq-answer p {
        padding: 0 15px 15px;
    }
}