/* ===================================
   KOPERASI MERAH PUTIH MEJAGONG
   Home Page Stylesheet - FIXED
   =================================== */

:root {
    --primary-red: #C41E3A;
    --primary-white: #FFFFFF;
    --accent-green: #2E7D32;
    --dark-gray: #424242;
    --light-gray: #F5F5F5;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--dark-gray);
    overflow-x: hidden;
    background: #fafafa;
    padding-top: 76px;
}

@media (max-width: 991px) {
    body {
        padding-top: 70px;
    }
}

/* Background Pattern untuk Section */
.bg-light {
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%) !important;
    position: relative;
}

.bg-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23C41E3A" fill-opacity="0.03"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    opacity: 0.5;
    pointer-events: none;
}

/* ===================================
   NAVBAR
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
    transition: all 0.3s ease;
    padding: 1rem 0;
}

.navbar-scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: var(--shadow-md);
}

.navbar-brand {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--dark-gray) !important;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-red);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-red) !important;
}

/* Mobile Navbar Brand - Lebih Compact */
@media (max-width: 991px) {
    .navbar-brand {
        font-size: 0.85rem !important;
    }
    
    .navbar-brand i {
        font-size: 20px !important;
    }
    
    .navbar-brand span {
        font-size: 0.75rem !important;
    }
    
    .navbar-brand small {
        font-size: 0.65rem !important;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        margin-right: 8px !important;
    }
    
    .navbar-toggler-icon {
        width: 22px;
        height: 22px;
    }
    
    .navbar-brand {
        padding: 0;
        margin: 0;
    }
    
    .navbar .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ===================================
   DROPDOWN BERITA - FIXED WITH CSS ONLY!
   =================================== */

/* Desktop Dropdown - Full Width Centered */
@media (min-width: 992px) {
    .mega-dropdown {
        position: static !important;
    }
    
    /* IMPORTANT: Override Bootstrap dropdown-menu */
    .navbar .mega-dropdown .dropdown-menu.mega-menu {
        position: fixed !important;
        left: 50% !important;
        top: 76px !important;
        transform: translateX(-50%) !important;
        width: 90vw !important;
        max-width: 1100px !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: 0 15px 50px rgba(0,0,0,0.3) !important;
        border-radius: 16px !important;
        padding: 2.5rem 2rem !important;
        background: white !important;
        z-index: 9999 !important;
        display: none !important;
        inset: auto !important;
    }
    
    .navbar .mega-dropdown .dropdown-menu.mega-menu.show {
        display: block !important;
    }
    
    .mega-menu-content {
        width: 100% !important;
    }
    
    .mega-menu-content .row {
        margin: 0 !important;
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 2rem;
    }
    
    .mega-menu-content .col-md-4 {
        flex: 1 !important;
        max-width: none !important;
        padding: 0 !important;
        min-width: 0 !important;
    }
    
    .mega-menu-section {
        padding: 1.5rem !important;
        height: 100% !important;
        background: #f8f9fa;
        border-radius: 12px;
    }
    
    .col-md-4:first-child .mega-menu-section {
        background: #fff5f5;
    }
    
    .col-md-4:nth-child(2) .mega-menu-section {
        background: #f0fff4;
    }
    
    .col-md-4.bg-light .mega-menu-section {
        background: linear-gradient(135deg, #fff9e6 0%, #fff5cc 100%) !important;
        border-radius: 12px !important;
        padding: 1.5rem !important;
        margin: 0 !important;
    }
    
    .mega-menu-title {
        font-size: 0.95rem !important;
        font-weight: 700 !important;
        color: #dc3545 !important;
        margin-bottom: 1rem !important;
        padding-bottom: 0.75rem !important;
        border-bottom: 2px solid currentColor !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        white-space: nowrap !important;
    }
    
    .mega-menu-title i {
        font-size: 1.1rem !important;
        flex-shrink: 0;
    }
    
    .mega-menu-item {
        display: flex !important;
        align-items: center !important;
        padding: 0.75rem 1rem !important;
        color: #333 !important;
        text-decoration: none !important;
        border-radius: 8px !important;
        margin-bottom: 0.5rem !important;
        transition: all 0.3s ease !important;
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        background: white !important;
    }
    
    .mega-menu-item:hover {
        background: #dc3545 !important;
        color: white !important;
        padding-left: 1.5rem !important;
        text-decoration: none !important;
        box-shadow: 0 3px 10px rgba(220, 53, 69, 0.3) !important;
    }
    
    .mega-menu-item i {
        width: 24px !important;
        min-width: 24px !important;
        margin-right: 10px !important;
        flex-shrink: 0 !important;
        font-size: 1rem !important;
    }
    
    .mega-menu-item.featured {
        background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%) !important;
        border-left: 4px solid #ffc107 !important;
        padding: 1rem !important;
        margin-bottom: 0.75rem !important;
        box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2) !important;
    }
    
    .mega-menu-item.featured:hover {
        background: #ffc107 !important;
        color: #000 !important;
        border-left-color: #ffb300 !important;
    }
    
    .mega-menu-item.featured i {
        font-size: 1.2rem !important;
    }
    
    .mega-menu-item.featured strong {
        display: block !important;
        margin-bottom: 0.3rem !important;
        font-size: 0.95rem !important;
        font-weight: 600 !important;
    }
    
    .mega-menu-item.featured small {
        font-size: 0.75rem !important;
        opacity: 0.85 !important;
        display: block !important;
    }
    
    .mega-menu-item.featured div {
        flex: 1 !important;
    }
    
    /* Backdrop overlay saat dropdown terbuka */
    body.dropdown-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 9998;
    }
}

/* Mobile Dropdown */
@media (max-width: 991px) {
    .mega-dropdown .dropdown-menu {
        position: relative;
        width: 100%;
        border: none;
        box-shadow: none;
        background: #f8f9fa;
        padding: 1rem;
        border-radius: 10px;
        margin-top: 0.5rem;
    }
    
    .mega-menu-content .row {
        flex-direction: column;
    }
    
    .mega-menu-content .col-md-4 {
        width: 100%;
        max-width: 100%;
        padding: 0;
    }
    
    .mega-menu-section {
        padding: 1rem 0;
        border-bottom: 1px solid #dee2e6;
    }
    
    .mega-menu-section:last-child {
        border-bottom: none;
    }
    
    .col-md-4.bg-light .mega-menu-section {
        background: #fffbf0;
        border-radius: 8px;
        padding: 1rem;
        margin-top: 0.5rem;
    }
    
    .mega-menu-title {
        font-size: 0.9rem;
        font-weight: 700;
        color: #dc3545;
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid #dc3545;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .mega-menu-item {
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
        color: #333;
        text-decoration: none;
        border-radius: 8px;
        margin-bottom: 0.4rem;
        transition: all 0.2s;
        background: white;
    }
    
    .mega-menu-item i {
        width: 24px;
        min-width: 24px;
        margin-right: 10px;
        flex-shrink: 0;
    }
    
    .mega-menu-item:hover,
    .mega-menu-item:active {
        background: #dc3545;
        color: white !important;
        padding-left: 1.5rem;
        text-decoration: none;
    }
    
    .mega-menu-item.featured {
        background: #fffbf0;
        border-left: 3px solid #ffc107;
        margin: 0.5rem 0;
        padding: 1rem;
    }
    
    .mega-menu-item.featured:hover {
        background: #ffc107;
        color: #000 !important;
    }
    
    .mega-menu-item.featured strong {
        display: block;
        margin-bottom: 0.3rem;
        font-size: 0.9rem;
    }
    
    .mega-menu-item.featured small {
        font-size: 0.75rem;
        color: #666;
    }
}

/* ===================================
   HERO SECTION
   =================================== */
.hero-section {
    position: relative;
    background: linear-gradient(135deg, var(--primary-red) 0%, #8B0000 100%);
    background-image: 
        url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23ffffff" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E'),
        linear-gradient(135deg, var(--primary-red) 0%, #8B0000 100%);
    padding-top: 76px;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    line-height: 1.2;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero-section .lead {
    font-size: clamp(1rem, 2vw, 1.25rem);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2rem;
    animation: bounce 2s infinite;
    z-index: 2;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-20px);
    }
    60% {
        transform: translateX(-50%) translateY(-10px);
    }
}

/* Mobile Hero - Lebih Pendek */
@media (max-width: 991px) {
    .hero-section {
        min-height: 70vh;
        padding-top: 100px;
        padding-bottom: 40px;
    }
    
    .hero-section .display-4 {
        font-size: 1.8rem !important;
    }
    
    .hero-section .lead {
        font-size: 0.95rem !important;
    }
    
    .hero-content {
        padding-top: 40px;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* ===================================
   CARDS & SERVICES
   =================================== */
.service-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    background: #ffffff;
}

.service-icon,
.feature-icon {
    transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    border-radius: 50px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border-width: 2px;
}

.btn-lg {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
}

.btn-danger {
    background: var(--primary-red);
    border-color: var(--primary-red);
}

.btn-danger:hover {
    background: #8B0000;
    border-color: #8B0000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196, 30, 58, 0.3);
}

.btn-outline-danger {
    color: var(--primary-red);
    border-color: var(--primary-red);
}

.btn-outline-danger:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    transform: translateY(-2px);
}

.btn-warning {
    background: #FFC107;
    border-color: #FFC107;
    color: #000;
}

.btn-warning:hover {
    background: #FFB300;
    border-color: #FFB300;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 193, 7, 0.3);
}

/* ===================================
   WHATSAPP FLOAT BUTTON
   =================================== */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    background: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
}

.whatsapp-float i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===================================
   FOOTER
   =================================== */
footer {
    background-color: #212529 !important;
}

footer * {
    color: rgba(255, 255, 255, 0.7) !important;
}

footer h5,
footer .fw-bold {
    color: #ffffff !important;
}

footer a {
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.7) !important;
}

footer a:hover {
    color: var(--primary-red) !important;
    padding-left: 5px;
}

footer .text-white-50,
footer small,
footer p,
footer li,
footer span {
    color: rgba(255, 255, 255, 0.7) !important;
}

footer .text-danger,
footer i.text-danger {
    color: #C41E3A !important;
}

footer hr {
    border-color: rgba(255, 255, 255, 0.2) !important;
    opacity: 1 !important;
}

/* ===================================
   BERITA CARDS
   =================================== */
.hover-lift {
    transition: all 0.3s ease;
    cursor: pointer;
}

.hover-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(196, 30, 58, 0.2) !important;
}

.card-img-top {
    transition: all 0.3s ease;
}

.hover-lift:hover .card-img-top {
    transform: scale(1.05);
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .hero-section {
        padding-top: 60px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 24px;
        bottom: 20px;
        right: 20px;
    }
    
    .service-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 576px) {
    .btn-lg {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
    
    section {
        padding: 3rem 0 !important;
    }
}

/* ===================================
   UTILITIES
   =================================== */
.bg-pattern {
    background-image: 
        url('data:image/svg+xml,%3Csvg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="%239C92AC" fill-opacity="0.05" fill-rule="evenodd"%3E%3Ccircle cx="3" cy="3" r="3"/%3E%3Ccircle cx="13" cy="13" r="3"/%3E%3C/g%3E%3C/svg%3E');
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: var(--shadow-lg);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: var(--primary-red);
    color: white;
}

::-moz-selection {
    background: var(--primary-red);
    color: white;
}