/* News Section Refinement */
.berita-section {
    background: linear-gradient(135deg, #a65ce6 0%, #9042d6 100%);
    padding: 80px 0;
}

/* Glassmorphism Lite for Search */
.search-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 8px 8px 25px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    box-shadow: none;
    padding-left: 0;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    background: transparent;
    color: white;
    box-shadow: none;
}

.btn-search {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: rgba(255, 255, 255, 0.4);
    color: white;
    transform: scale(1.1);
}

.banner-box {
    width: 100%;
    transition: all 0.3s ease;
}

.banner-box:hover {
    transform: scale(1.02);
}

/* Featured News Card Styles */
.featured-news-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: #fff;
}

.featured-image-wrapper {
    position: relative;
    overflow: hidden;
}

.featured-label {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 133, 165, 0.9);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(255, 133, 165, 0.4);
    z-index: 2;
}

/* Date Badge for Regular News */
.card-date-badge {
    position: absolute;
    bottom: -15px;
    right: 20px;
    background: #fff;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

.card-date-badge .day {
    font-weight: 800;
    font-size: 1.2rem;
    color: #9C51EA;
    line-height: 1;
}

.card-date-badge .month {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
}

/* News cards enhancements */
.news-card {
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15) !important;
}

.news-card:hover .illustration-image {
    transform: scale(1.1);
}

.hover-primary:hover {
    color: #9C51EA !important;
}

/* Badges & Utility */
.bg-purple-light {
    background-color: rgba(156, 81, 234, 0.1);
}

.text-purple {
    color: #9C51EA;
}

.fw-600 {
    font-weight: 600;
}

/* Popular Sidebar refinement */
.news-pop-hover {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.news-pop-hover:hover {
    background-color: rgba(156, 81, 234, 0.05) !important;
    transform: translateX(10px);
}

.popular-sidebar-container {
    border-radius: 20px !important;
    padding: 30px !important;
}

.popular-sidebar-container h5 {
    font-size: 1.25rem;
    letter-spacing: 0.5px;
}

/* Entrance Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-item,
.news-item-featured {
    animation: fadeInUp 0.8s ease backwards;
}

/* Staggered animation for grid */
.news-item:nth-child(2) {
    animation-delay: 0.1s;
}

.news-item:nth-child(3) {
    animation-delay: 0.2s;
}

.news-item:nth-child(4) {
    animation-delay: 0.3s;
}

.news-item:nth-child(5) {
    animation-delay: 0.4s;
}

.featured-label {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(45deg, #FF85A5, #ff6b91);
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(255, 133, 165, 0.4);
    z-index: 2;
    overflow: hidden;
}

.featured-label::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(30deg);
    animation: labelShine 3s infinite;
}

@keyframes labelShine {
    0% {
        left: -60%;
    }

    20% {
        left: 120%;
    }

    100% {
        left: 120%;
    }
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 81, 234, 0.4);
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Mobile devices (up to 768px) */
@media (max-width: 768px) {

    /* Section padding reduction */
    .berita-section {
        padding: 30px 0;
    }

    .berita-section .p-5,
    .berita-detail-section.p-5 {
        padding: 1rem 8px !important;
        /* Vertical 1rem, Horizontal 8px for wider reading area */
    }

    /* Container horizontal padding - maximize content area on mobile */
    .berita-detail-section .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    /* Typography - Font size adjustments */
    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3,
    .h3 {
        font-size: 1.25rem !important;
    }

    h4,
    .h4 {
        font-size: 1.1rem !important;
    }

    h5,
    .h5 {
        font-size: 1rem !important;
    }

    h6,
    .h6 {
        font-size: 0.9rem !important;
    }

    /* Body text */
    body,
    p,
    .card-text {
        font-size: 0.9rem;
    }

    .small,
    small {
        font-size: 0.8rem !important;
    }

    .x-small {
        font-size: 0.7rem !important;
    }

    /* Card adjustments */
    .card-body {
        padding: 1rem !important;
    }

    .card-title {
        font-size: 1rem !important;
        line-height: 1.4;
    }

    /* Banner heights */
    .banner-box {
        height: 100px !important;
        min-height: 100px !important;
    }

    /* Image heights for news detail */
    .carousel-inner img,
    .illustration-image {
        height: 250px !important;
    }

    /* Search bar */
    .search-container {
        max-width: 100%;
        padding: 4px 4px 4px 15px;
    }

    .search-input {
        font-size: 0.9rem;
    }

    .btn-search {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }

    /* Spacing reductions */
    .mb-5 {
        margin-bottom: 1.5rem !important;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .pt-4,
    .py-4 {
        padding-top: 1rem !important;
    }

    .pb-4 {
        padding-bottom: 1rem !important;
    }

    /* Breadcrumb */
    .breadcrumb {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    .breadcrumb-item {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Popular sidebar */
    .popular-sidebar-container {
        max-height: 400px;
    }

    /* Badge sizing */
    .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }

    /* News content - better line height for readability */
    .news-content {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .news-content p {
        margin-bottom: 1rem;
    }

    .news-content h1,
    .news-content h2,
    .news-content h3 {
        margin-top: 1.5rem;
        margin-bottom: 0.75rem;
    }

    /* Button adjustments */
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    /* Icon sizing */
    .fa-2x {
        font-size: 1.5em !important;
    }

    .fa-3x {
        font-size: 2em !important;
    }

    /* Ad container in sidebar */
    .iklan-small-container .mb-3 {
        margin-bottom: 0.75rem !important;
    }
}

/* Extra small devices (up to 576px) */
@media (max-width: 576px) {

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.3rem !important;
    }

    .card-title {
        font-size: 0.95rem !important;
    }

    /* Further reduce image heights on very small screens */
    .carousel-inner img {
        height: 200px !important;
    }

    .illustration-image {
        height: 140px !important;
    }

    /* Tighten spacing even more */
    .berita-section .p-5,
    .berita-detail-section.p-5 {
        padding: 0.75rem 8px !important;
        /* Keep 8px horizontal padding */
    }

    /* Popular news thumbnail smaller */
    .popular-item img {
        width: 50px !important;
        height: 50px !important;
    }

    .popular-item .ms-3 {
        margin-left: 0.75rem !important;
    }
}