/* CSS Variables */
:root {
    --primary: #092994;
    --primary-dark: #0056b3;
    --secondary: #6c757d;
    --dark: #343a40;
    --light: #f8f9fa;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
}

/* Loading Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

/* Promo Header Styles */
.promo-header {
    margin-bottom: 2rem;
}

.promo-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 250px;
}

.promo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.promo-link {
    display: block;
    height: 100%;
    text-decoration: none;
    position: relative;
}

.promo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.promo-card:hover .promo-image {
    transform: scale(1.05);
}

.promo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.promo-card:hover .promo-overlay {
    background: linear-gradient(transparent, rgba(9, 41, 148, 0.9));
}

.promo-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.promo-desc {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    color: white;
}

.promo-cta {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.promo-card:hover .promo-cta {
    background: white;
    color: var(--primary);
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
    .promo-card {
        height: 200px;
        margin-bottom: 1rem;
    }
    
    .promo-title {
        font-size: 1.25rem;
    }
    
    .promo-overlay {
        padding: 1rem;
    }
}

/* Artikel Card Styles */
.artikel-card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    background: white;
    border: 1px solid #e9ecef;
}

.artikel-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.image-container {
    position: relative;
    overflow: hidden;
}

.artikel-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.artikel-card:hover img {
    transform: scale(1.05);
}

.artikel-card-body {
    padding: 1.5rem;
}

.artikel-card-body h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--dark);
    line-height: 1.4;
}

.artikel-card-body p {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.artikel-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.artikel-meta .badge {
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.artikel-meta .date,
.artikel-meta .read-time {
    color: #888;
    font-size: 0.8rem;
}

.artikel-meta .views {
    color: #888;
    font-size: 0.8rem;
}

/* Image Loading States */
.image-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, #f0f0f0 8%, #e0e0e0 18%, #f0f0f0 33%);
    background-size: 800px 104px;
    animation: shimmer 1.5s infinite linear;
    display: none;
}

.image-loaded + .image-loading,
.image-fallback + .image-loading {
    display: none;
}

img:not([src]) + .image-loading,
img[src=""] + .image-loading {
    display: block;
}

.image-fallback {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Artikel List Styles */
.artikel-list {
    margin-bottom: 2rem;
}

.artikel-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1.5rem 0;
    animation: fadeIn 0.6s ease;
    transition: all 0.3s ease;
}

.artikel-item:hover {
    background-color: var(--light);
    border-radius: 8px;
    padding: 1.5rem;
}

.artikel-item:first-child {
    padding-top: 0;
}

.artikel-item-body {
    padding: 0 1rem;
}

.artikel-item-body h5 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.artikel-item-body h5 a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.artikel-item-body h5 a:hover {
    color: var(--primary);
}

.artikel-item-body p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Sidebar Styles */
.artikel-sidebar {
    padding-left: 2rem;
}

@media (max-width: 991.98px) {
    .artikel-sidebar {
        padding-left: 0;
        margin-top: 3rem;
    }
}

.sidebar-widget {
    margin-bottom: 2.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
    color: var(--dark);
    position: relative;
    font-weight: 600;
}

.widget-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 50px;
    height: 2px;
    background: var(--primary);
}

/* Popular Articles */
.popular-articles {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-articles li {
    margin-bottom: 1rem;
    transition: transform 0.2s ease;
}

.popular-articles li:hover {
    transform: translateX(5px);
}

.popular-articles li:last-child {
    margin-bottom: 0;
}

.popular-articles a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--light);
}

.popular-articles a:hover {
    background: var(--primary);
    color: white;
    transform: translateX(5px);
}

.popular-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.popular-title {
    flex-grow: 1;
    font-size: 0.95rem;
    margin-right: 0.5rem;
    font-weight: 500;
}

.popular-views {
    font-size: 0.8rem;
    color: #888;
    white-space: nowrap;
}

.popular-articles a:hover .popular-views {
    color: rgba(255,255,255,0.8);
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0.5rem;
    text-align: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: var(--dark);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.category-card:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.category-card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.category-card span {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Tags Cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    color: #555;
    border-radius: 25px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
    cursor: pointer;
}

.tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

/* Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    color: white;
}

.newsletter-widget .widget-title {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.newsletter-widget .widget-title::after {
    background: white;
}

.newsletter-widget p {
    color: rgba(255,255,255,0.9);
}

.newsletter-form .form-control {
    border-radius: 8px;
    padding: 0.75rem;
    border: none;
    margin-bottom: 1rem;
}

.newsletter-form .btn {
    border-radius: 8px;
    padding: 0.75rem;
    background: white;
    color: var(--primary);
    font-weight: 600;
    border: none;
    transition: all 0.3s ease;
}

.newsletter-form .btn:hover {
    background: var(--dark);
    color: white;
    transform: translateY(-2px);
}

/* Video Thumbnails */
.video-thumbnail {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.video-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.video-thumbnail iframe {
    width: 100%;
    height: 180px;
    border: none;
}

.video-caption {
    padding: 1rem;
    background: white;
    text-align: center;
    font-weight: 600;
    color: var(--dark);
    border-top: 1px solid #e9ecef;
}

.video-fallback {
    display: none;
}

.video-fallback .bg-light {
    border-radius: 12px 12px 0 0;
}

/* Section Titles */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
    color: var(--dark);
    font-weight: 600;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 60px;
    height: 2px;
    background: var(--primary);
}

/* Search Section */
.search-section {
    margin-bottom: 2rem;
}

.search-section .form-control {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.search-section .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(9, 41, 148, 0.25);
}

/* Modal Styles */
.modal-article-item {
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 -0.5rem;
    padding: 1rem 0.5rem;
}

.modal-article-item:hover {
    background-color: var(--light);
    padding-left: 1rem;
    padding-right: 1rem;
}

.modal-article-item:last-child {
    border-bottom: none;
}

.modal-article-item h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.modal-article-item p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #666;
}

/* Category Filters */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.category-filters .btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.category-filters .btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Scrollbar Styling for Modal */
.all-articles-list {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.all-articles-list::-webkit-scrollbar {
    width: 6px;
}

.all-articles-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.all-articles-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.all-articles-list::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Button Styles */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Social Sharing */
.social-sharing {
    padding: 1.5rem;
    background: var(--light);
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.social-sharing .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

/* Quick Contact Widget */
.quick-contact-widget {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white;
}

.quick-contact-widget .widget-title {
    color: white;
    border-bottom-color: rgba(255,255,255,0.3);
}

.quick-contact-widget .widget-title::after {
    background: white;
}

.quick-contact-widget p {
    color: rgba(255,255,255,0.9);
}

/* Responsive Design */
@media (max-width: 767.98px) {
    .artikel-header {
        padding: 1.5rem 0;
    }
    
    .artikel-header h1 {
        font-size: 1.75rem;
    }
    
    .artikel-item .row {
        flex-direction: column;
    }
    
    .artikel-item .col-md-4 {
        margin-bottom: 1rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .popular-articles a {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .popular-rank {
        margin-bottom: 0.5rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
    
    .social-sharing .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .social-sharing .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Featured Section Enhancement */
.featured-section {
    position: relative;
}

.featured-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -1rem;
    width: 4px;
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

/* Video Section Enhancement */
.video-section {
    background: var(--light);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 3rem;
}

/* Alert Notifications */
.alert.position-fixed {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 8px;
}

.alert .btn-close {
    padding: 0.75rem;
}

/* Optimasi Tombol Muat Lebih Banyak dan Lihat Semua */
.btn-text-only {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--primary) !important;
    font-size: clamp(0.9rem, 2vw, 1rem);
    font-weight: 600;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-text-only:hover {
    color: var(--primary-dark) !important;
    background: transparent !important;
    transform: none;
    text-decoration: underline;
}

.btn-text-only i {
    font-size: 0.9em;
}

/* Container tombol untuk memastikan posisi konsisten */
.artikel-buttons-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    padding: 1rem;
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .artikel-buttons-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-text-only {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}