/* ========================================
   PROFIL KAWASAN - Fungsi Utama Section
   Premium Conservation Redesign
   ======================================== */

/* Section Background - Atmospheric Depth */
.fungsi-utama-section {
    position: relative;
    background: linear-gradient(180deg, 
        rgba(248, 250, 248, 0.8) 0%, 
        rgba(240, 245, 240, 0.6) 50%, 
        rgba(235, 242, 235, 0.4) 100%
    );
    overflow: hidden;
}

/* Subtle ambient decorative blur */
.fungsi-utama-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, 
        rgba(40, 167, 69, 0.06) 0%, 
        rgba(40, 167, 69, 0.02) 40%, 
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

.fungsi-utama-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, 
        rgba(32, 100, 50, 0.04) 0%, 
        rgba(32, 100, 50, 0.01) 50%, 
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

/* Section Container */
.fungsi-utama-section .container {
    position: relative;
    z-index: 1;
}

/* ========================================
   Section Header Styling
   ======================================== */

.fungsi-section-header {
    position: relative;
    padding-bottom: 1.5rem;
    margin-bottom: 3rem;
}

.fungsi-section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(40, 167, 69, 0.3) 0%, 
        rgba(40, 167, 69, 0.8) 50%, 
        rgba(40, 167, 69, 0.3) 100%
    );
    border-radius: 2px;
}

.fungsi-main-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: #1a3d1f;
    letter-spacing: -0.3px;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.fungsi-subtitle {
    font-size: 1.1rem;
    color: #5a6b5c;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   Premium Function Cards
   ======================================== */

.fungsi-card {
    position: relative;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(250, 252, 250, 0.9) 100%
    );
    border-radius: 20px;
    padding: 2.5rem 2rem;
    border: 1px solid rgba(40, 167, 69, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04),
                0 8px 40px rgba(40, 167, 69, 0.06);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

/* Subtle top border gradient */
.fungsi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(40, 167, 69, 0.6) 0%, 
        rgba(46, 125, 50, 0.9) 50%, 
        rgba(40, 167, 69, 0.6) 100%
    );
    opacity: 0.7;
    transition: opacity 0.4s ease;
}

/* Glassmorphism effect on hover */
.fungsi-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, 
        rgba(255, 255, 255, 0.85) 0%, 
        rgba(245, 250, 245, 0.75) 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Hover State */
.fungsi-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08),
                0 20px 60px rgba(40, 167, 69, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.4);
    border-color: rgba(40, 167, 69, 0.25);
}

.fungsi-card:hover::before {
    opacity: 1;
    height: 4px;
}

/* ========================================
   Icon Container Design
   ======================================== */

.fungsi-icon-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Background circle */
.fungsi-icon-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, 
        rgba(40, 167, 69, 0.12) 0%, 
        rgba(32, 100, 50, 0.08) 100%
    );
    border-radius: 50%;
    border: 2px solid rgba(40, 167, 69, 0.15);
    transition: all 0.5s ease;
}

/* Subtle glow on hover */
.fungsi-icon-wrapper::before {
    content: '';
    position: absolute;
    inset: -8px;
    background: radial-gradient(circle, 
        rgba(40, 167, 69, 0.08) 0%, 
        transparent 70%
    );
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.fungsi-card:hover .fungsi-icon-wrapper::before {
    opacity: 1;
}

.fungsi-card:hover .fungsi-icon-bg {
    background: linear-gradient(135deg, 
        rgba(40, 167, 69, 0.18) 0%, 
        rgba(32, 100, 50, 0.12) 100%
    );
    border-color: rgba(40, 167, 69, 0.3);
    transform: scale(1.05);
}

/* Icon styling */
.fungsi-icon {
    font-size: 2.25rem;
    color: #2e7d32;
    transition: all 0.5s ease;
}

.fungsi-card:hover .fungsi-icon {
    color: #1b5e20;
    transform: scale(1.1);
}

/* ========================================
   Typography
   ======================================== */

.fungsi-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    font-weight: 600;
    color: #1a3d1f;
    margin-bottom: 1rem;
    line-height: 1.35;
    text-align: center;
}

.fungsi-card-description {
    font-size: 0.95rem;
    color: #5a6b5c;
    line-height: 1.7;
    text-align: center;
    max-width: 280px;
    margin: 0 auto;
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet */
@media (max-width: 992px) {
    .fungsi-main-title {
        font-size: 2.1rem;
    }
    
    .fungsi-subtitle {
        font-size: 1rem;
    }
    
    .fungsi-card {
        padding: 2rem 1.5rem;
    }
    
    .fungsi-icon-wrapper {
        width: 80px;
        height: 80px;
    }
    
    .fungsi-icon {
        font-size: 2rem;
    }
    
    .fungsi-card-title {
        font-size: 1.2rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .fungsi-utama-section {
        padding: 3rem 0;
    }
    
    .fungsi-section-header {
        margin-bottom: 2rem;
    }
    
    .fungsi-main-title {
        font-size: 1.85rem;
    }
    
    .fungsi-subtitle {
        font-size: 0.95rem;
        max-width: 100%;
    }
    
    .fungsi-card {
        padding: 1.75rem 1.25rem;
    }
    
    .fungsi-icon-wrapper {
        width: 70px;
        height: 70px;
        margin-bottom: 1.25rem;
    }
    
    .fungsi-icon {
        font-size: 1.75rem;
    }
    
    .fungsi-card-title {
        font-size: 1.1rem;
    }
    
    .fungsi-card-description {
        font-size: 0.875rem;
    }
    
    .fungsi-card:hover {
        transform: translateY(-8px);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .fungsi-main-title {
        font-size: 1.6rem;
    }
    
    .fungsi-card {
        padding: 1.5rem 1rem;
    }
}

/* ========================================
   Animation Keyframes
   ======================================== */

@keyframes fungsiFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fungsiIconFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Stagger animation for cards */
.fungsi-card {
    opacity: 0;
    animation: fungsiFadeInUp 0.6s ease forwards;
}

.fungsi-card:nth-child(1) {
    animation-delay: 0.1s;
}

.fungsi-card:nth-child(2) {
    animation-delay: 0.25s;
}

.fungsi-card:nth-child(3) {
    animation-delay: 0.4s;
}

/* Base animate-on-scroll override for fungsi cards */
.fungsi-card.animate-on-scroll.visible {
    animation: fungsiFadeInUp 0.6s ease forwards;
}

/* ========================================
   Accessibility & Performance
   ======================================== */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .fungsi-card,
    .fungsi-card::before,
    .fungsi-card::after,
    .fungsi-icon,
    .fungsi-icon-bg {
        transition: none;
        animation: none;
    }
    
    .fungsi-card:hover {
        transform: none;
    }
    
    .fungsi-card:hover .fungsi-icon-wrapper::before,
    .fungsi-card:hover .fungsi-icon-bg,
    .fungsi-card:hover .fungsi-card::before {
        opacity: 1;
    }
}

/* Focus states for accessibility */
.fungsi-card:focus-within {
    outline: 2px solid rgba(40, 167, 69, 0.5);
    outline-offset: 2px;
}
