/* YouTube Video Styling - Single Column Layout */
.youtube-video-container {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    background: #fff;
}

.youtube-video-container iframe {
    border: none;
    display: block;
    width: 100%;
}

/* Main Layout */
#home-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Section */
.youtube-header-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 50px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9f5e9 100%);
    border-radius: 15px;
}

.youtube-header-section h1 {
    color: #2d5016;
    font-size: 2.5em;
    margin-bottom: 15px;
    font-weight: 700;
}

.youtube-header-section h1 i {
    color: #FF0000;
    margin-right: 15px;
}

.youtube-header-section p {
    color: #666;
    font-size: 1.2em;
    max-width: 600px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

.youtube-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #4CAF50;
}

.stat-label {
    color: #666;
    font-size: 0.9em;
}

/* Desktop Filter Section - REVISI SATU BARIS */
.desktop-filter-section {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    border: 1px solid #e8e8e8;
}

.filter-container {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.filter-group.search-group {
    flex: 2;
    max-width: 400px;
}

.filter-label {
    font-weight: 600;
    color: #2d5016;
    white-space: nowrap;
    font-size: 14px;
    margin-bottom: 0;
}

.filter-label i {
    margin-right: 5px;
    color: #4CAF50;
}

.filter-select {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    flex: 1;
    min-width: 150px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.filter-select:hover {
    border-color: #4CAF50;
}

/* Search Box Styles - REVISI */
.search-box {
    display: flex;
    gap: 8px;
    flex: 1;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    flex: 1;
    transition: all 0.3s ease;
    min-width: 200px;
}

.search-input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

.search-button {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 14px;
}

.search-button:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Category Header */
.category-header {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
    border-left: 4px solid #4CAF50;
}

.category-header h2 {
    color: #2d5016;
    font-size: 1.8em;
    margin-bottom: 10px;
    font-weight: 600;
}

.category-header p {
    color: #666;
    font-size: 1.1em;
    margin: 0;
    line-height: 1.5;
}

/* Video Tags Styling - BARU */
.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.video-tag-link {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.video-tag-link:hover {
    background: linear-gradient(135deg, #495057, #6c757d);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Main Content Grid - DIUBAH: 3 KOLOM DI DESKTOP */
.youtube-main-content {
    width: 100%;
}

.youtube-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 kolom tetap di desktop */
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.youtube-video-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: fit-content;
}

.youtube-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #4CAF50;
}

.video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    width: 70px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
    opacity: 1;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4);
    border: none;
}

.video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    width: 70px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
    opacity: 1;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    width: 70px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 3;
    opacity: 1;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 0, 0, 0.4);
}

/* Hover pada card mempengaruhi badge dan overlay */
.youtube-video-card:hover .video-badge {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.youtube-video-card:hover .play-button-overlay {
    opacity: 1;
}

.video-thumbnail-container {
    position: relative;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    margin: 0;
}

.play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    z-index: 2;
}

.play-button-overlay i {
    font-size: 64px;
    margin-bottom: 10px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.7);
    transition: transform 0.3s ease;
}

.youtube-video-card:hover .play-button-overlay i {
    transform: scale(1.1);
}

.play-button-overlay span {
    font-weight: 600;
    font-size: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* batas play button overlay */ */

.video-thumbnail-link:hover .play-button-overlay {
    opacity: 1;
}

.video-thumbnail-container {
    position: relative;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    margin: 0;
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.video-thumbnail-link:hover .video-thumbnail {
    transform: scale(1.05);
}

.play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
}

.video-thumbnail-link:hover .play-button-overlay {
    opacity: 1;
}

.play-button-overlay i {
    font-size: 48px;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.play-button-overlay span {
    font-weight: 600;
    font-size: 14px;
}

.video-thumbnail-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.video-thumbnail-placeholder i {
    font-size: 48px;
    margin-bottom: 10px;
}

.video-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-title {
    margin: 0 0 12px 0 !important;
}

.video-title a {
    text-decoration: none !important;
    color: #2d5016 !important;
    font-weight: 600;
    font-size: 16px !important;
    line-height: 1.4;
    transition: color 0.3s ease;
    display: block;
}

.video-title a:hover {
    color: #4CAF50 !important;
}

.video-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.video-meta-tags {
    margin-bottom: 15px;
}

.video-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.video-cat-badge {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
}

.video-detail-button {
    text-align: center;
    margin-top: auto;
}

.video-detail-link {
    display: inline-block;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    border: none;
}

.video-detail-link:hover {
    background: linear-gradient(135deg, #45a049, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    color: white;
}

/* Pagination */
.youtube-pagination {
    text-align: center;
    margin: 50px 0 30px 0;
}

.youtube-pagination .page-numbers {
    display: inline-flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.youtube-pagination .page-numbers li {
    margin: 0;
}

.youtube-pagination .page-numbers a,
.youtube-pagination .page-numbers span {
    display: inline-block;
    padding: 12px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.youtube-pagination .page-numbers a:hover {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.youtube-pagination .page-numbers .current {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* No Videos Found */
.no-videos-found {
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 20px 0;
}

.no-videos-icon {
    font-size: 64px;
    color: #6c757d;
    margin-bottom: 20px;
}

.no-videos-found h2 {
    color: #666;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.no-videos-found p {
    color: #888;
    margin-bottom: 25px;
    font-size: 1.1em;
}

/* Education Section */
.education-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 60px 20px;
    margin: 60px 0 40px 0;
    border-radius: 15px;
}

.education-header {
    text-align: center;
    margin-bottom: 40px;
}

.education-header h2 {
    color: #2d5016;
    font-size: 2.2em;
    margin-bottom: 15px;
    font-weight: 700;
}

.education-header p {
    color: #666;
    font-size: 1.1em;
    max-width: 600px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

.education-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.education-benefit-item {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.education-benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.education-benefit-item .benefit-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 1.8em;
}

.education-benefit-item h4 {
    color: #2d5016;
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: 600;
}

.education-benefit-item p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 12px 25px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
    color: white;
}

/* Responsive Design - DIUBAH untuk 3 kolom */
@media only screen and (max-width: 1200px) {
    .youtube-videos-grid {
        grid-template-columns: repeat(3, 1fr); /* Tetap 3 kolom */
        gap: 20px;
    }
    
    .filter-container {
        gap: 10px;
    }
    
    .filter-group {
        flex: 1;
    }
    
    .filter-label {
        font-size: 13px;
    }
    
    .filter-select {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 120px;
    }
    
    .search-button {
        padding: 8px 15px;
        font-size: 13px;
    }
}

@media only screen and (max-width: 1024px) {
    .youtube-videos-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 kolom di tablet landscape */
        gap: 20px;
    }
    
    .filter-container {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .filter-group {
        flex: 1 1 calc(50% - 12px);
        min-width: 200px;
    }
    
    .filter-group.search-group {
        flex: 1 1 100%;
        max-width: 100%;
        order: 3;
    }
    
    .search-box {
        width: 100%;
    }
}

@media only screen and (max-width: 768px) {
    #home-content {
        padding: 15px;
    }
    
    .youtube-header-section {
        padding: 30px 15px !important;
    }
    
    .youtube-header-section h1 {
        font-size: 2em !important;
    }
    
    .youtube-stats {
        gap: 30px;
    }
    
    .desktop-filter-section {
        display: none;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
        width: 100%;
    }
    
    .filter-select {
        min-width: auto;
        flex: 1;
    }
    
    .youtube-videos-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 kolom di tablet portrait */
        gap: 15px;
    }
    
    .video-thumbnail {
        height: 160px;
    }
}

@media only screen and (max-width: 600px) {
    .youtube-videos-grid {
        grid-template-columns: 1fr; /* 1 kolom di mobile */
        gap: 15px;
    }
    
    .youtube-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .filter-label {
        text-align: left;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .education-benefits {
        grid-template-columns: 1fr;
    }
}

/* Popular Tags Section - BARU */
.popular-tags-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin: 40px 0;
    border: 1px solid #e9ecef;
}

.popular-tags-header {
    text-align: center;
    margin-bottom: 25px;
}

.popular-tags-header h3 {
    color: #2d5016;
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 600;
}

.popular-tags-header p {
    color: #666;
    font-size: 1em;
    margin: 0;
}

.popular-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
}

.popular-tag {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.popular-tag:hover {
    background: linear-gradient(135deg, #495057, #6c757d);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    color: white;
    text-decoration: none;
}

/* Additional CSS untuk Related Videos */
.related-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 kolom untuk video terkait */
    gap: 20px;
    margin-top: 20px;
}

.related-video-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.related-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.related-video-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.related-video-card:hover .related-video-thumbnail::before {
    opacity: 1;
}

/* Responsive untuk Related Videos */
@media (max-width: 1024px) {
    .related-videos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .related-videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .related-videos-grid {
        grid-template-columns: 1fr;
    }
}