/* UTILITY CLASSES */
.min-vh-70 { min-height: 70vh; }

/* ANIMATIONS */
.animate-fade-in { animation: fadeIn 1s ease-in-out; }
.animate-fade-in-delay { animation: fadeIn 1s ease-in-out 0.3s both; }
.animate-fade-in-delay-2 { animation: fadeIn 1s ease-in-out 0.6s both; }
.animate-float { animation: float 3s ease-in-out infinite; }

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

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

@keyframes slideInError {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes counterScale {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes autoSlide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 2px 8px var(--hover-overlay); }
    50% { box-shadow: 0 8px 20px var(--hover-overlay); }
}

/* HERO SECTION BACKGROUND */
.hero-section {
    position: relative;
    overflow: hidden;
}
.hero-bg-overlay{
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 2;
}
.hero-bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: opacity 1.2s cubic-bezier(0.4,0,0.2,1);
    pointer-events: none;
    will-change: opacity, background-image;
}
.hero-bg-main {
    opacity: 1;
}
.hero-bg-next {
    opacity: 0;
}
.hero-content {
    position: relative;
    z-index: 1;
}

/* GRADIENTS - Gunakan CSS Variables */
.bg-gradient-primary { 
    background: var(--gradient-primary) !important; 
}
.bg-gradient-success { 
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%); 
}
.bg-gradient-warning { 
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); 
}
.bg-gradient-danger { 
    background: var(--gradient-primary) !important; 
}

/* NEWS CARDS - menggunakan CSS Variables */
.news-card {
    transition: all 0.3s ease;
    border-radius: 0.75rem !important;
    overflow: hidden;
    background: var(--card-background) !important;
    border-color: var(--border-color) !important;
}

.news-card:hover {
    box-shadow: 0 15px 35px var(--hover-overlay) !important;
}

.news-card .card-img-top img:hover { transform: scale(1.05); }
.news-card .badge { font-size: 0.75rem; padding: 0.4rem 0.8rem; border-radius: 0.5rem; }
.news-card .badge.bg-danger { 
    background: var(--gradient-primary) !important; 
    border: none !important;
    color: #fff !important;
}

.news-card .card-title {
    color: var(--text-primary);
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 0.875rem;
}

.news-card .card-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* BADGE DI NEWS CARDS */
.news-card .badge.bg-danger { 
    background: var(--gradient-primary) !important; 
    border: none !important;
    color: #fff !important;
}

/* CONTACT FORM - menggunakan CSS Variables */
.contact-form .form-control {
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.contact-form .form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem var(--hover-overlay) !important;
}

.contact-form .form-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.contact-form .btn-danger {
    background: var(--gradient-primary) !important;
    border: none !important;
    border-radius: 0.5rem;
    font-weight: 600;
    padding: 1rem 2rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--hover-overlay);
}

.contact-form .btn-danger:hover {
    background: var(--primary-hover) !important;
}

/* FORM VALIDATION - menggunakan CSS Variables */
.contact-form .form-control.is-invalid {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem var(--hover-overlay) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 24 24'%3e%3ccircle cx='12' cy='12' r='10'/%3e%3cline x1='15' y1='9' x2='9' y2='15'/%3e%3cline x1='9' y1='9' x2='15' y2='15'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right calc(0.375em + 0.1875rem) center !important;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
    padding-right: calc(1.5em + 0.75rem) !important;
}

.contact-form .form-control.is-valid {
    border-color: var(--icon-success) !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 2.94-2.94.45-.45-.94-.94L3.24 4.88 2.29 3.93l-.94.94.94.94z'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right calc(0.375em + 0.1875rem) center !important;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem) !important;
    padding-right: calc(1.5em + 0.75rem) !important;
}

.contact-form .invalid-feedback {
    color: var(--primary-color);
    background: var(--hover-overlay);
    border-left: 4px solid var(--primary-color);
    display: block !important;
    width: 100%;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    animation: slideInError 0.3s ease;
}

.contact-form .mb-3 { position: relative; margin-bottom: 1.5rem !important; }

/* CAPTCHA - menggunakan CSS Variables */
.captcha-container {
    border: 2px solid var(--border-color);
    background: var(--sidebar-background);
}

.captcha-container:hover { 
    border-color: var(--primary-color); 
}

.captcha-box.error { 
    border-color: var(--primary-color) !important; 
    box-shadow: 0 0 0 0.2rem var(--hover-overlay) !important; 
}

.captcha-img {
    width: 100%;
    height: 50px;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease;
    border: none;
}

.captcha-img:hover { opacity: 0.8; }

.captcha-input {
    font-family: 'Courier New', 'Monaco', monospace !important;
    font-size: 1.25rem !important;
    font-weight: bold !important;
    letter-spacing: 4px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    background: #fff !important;
}

.captcha-input:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem var(--hover-overlay) !important;
}

/* CHARACTER COUNTER - menggunakan CSS Variables */
.contact-form .form-text {
    margin-top: 0.375rem;
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
    transition: color 0.3s ease;
}

.form-text.text-danger { 
    color: var(--primary-color) !important; 
}

/* NOTIFICATIONS - menggunakan CSS Variables */
.simple-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    min-width: 320px;
    max-width: 420px;
    border: 1px solid #e9ecef;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.simple-notification.show { opacity: 1; visibility: visible; transform: translateX(0); }

.simple-notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 4px;
}

.simple-notification.success::before { 
    background: var(--icon-success); 
}
.simple-notification.error::before { 
    background: #dc3545 !important; /* merah tetap */
}
.simple-notification.warning::before { background: #ffc107; }
.simple-notification.info::before { background: #17a2b8; }

.notification-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    padding-right: 2.5rem;
    background: white;
    position: relative;
    z-index: 2;
}

.notification-content i { font-size: 1.5rem; flex-shrink: 0; margin-top: 0.25rem; }

.simple-notification.success .notification-content i { 
    color: var(--icon-success) !important; 
}
.simple-notification.error .notification-content i {
    color: #dc3545 !important; /* merah tetap */
}
.simple-notification.warning .notification-content i { color: #ffc107 !important; }
.simple-notification.info .notification-content i { color: #17a2b8 !important; }

.notification-text { flex: 1; word-wrap: break-word; }

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529 !important;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.notification-message {
    font-size: 0.875rem;
    color: #6c757d !important;
    line-height: 1.4;
    margin: 0;
}

.notification-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #a0aec0;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-close:hover { background: #f7fafc; color: #2d3748; }

.simple-notification:hover {
    transform: translateX(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

/* LINK SLIDER - menggunakan CSS Variables */
.link-slider-container { position: relative; overflow: hidden; margin: 0 auto; max-width: 100%; }
.link-slider-wrapper { overflow: hidden; border-radius: 1rem; }

.link-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 1rem;
    animation: autoSlide 15s infinite linear;
}

.link-slide { flex: 0 0 200px; min-width: 200px; }

.link-card {
    height: 100%;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--hover-overlay), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.link-card:hover::before { left: 100%; }

.link-card:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 15px 30px var(--hover-overlay) !important;
}

.link-card .card-body { position: relative; z-index: 2; transition: all 0.3s ease; }
.link-card:hover .card-body { transform: translateY(-5px); }

.link-card .logo-img {
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: grayscale(0.3);
}

.link-card:hover .logo-img {
    transform: scale(1.2) rotate(5deg);
    filter: grayscale(0) drop-shadow(0 8px 16px var(--hover-overlay));
}

.link-card .card-title {
    transition: all 0.3s ease;
    color: #6c757d;
    font-size: 0.9rem;
}

.link-card:hover .card-title {
    color: var(--primary-color) !important;
    font-weight: bold;
    transform: translateY(-2px);
}

.link-slider:hover { animation-play-state: paused; }

/* STATISTICS - menggunakan CSS Variables */
.stat-item {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    border: none;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--card-background) !important;
    border: 1px solid var(--border-color) !important;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-item:hover::before { opacity: 1; }

.stat-item:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.stat-icon { transition: all 0.3s ease; opacity: 0.8; }
.stat-item:hover .stat-icon { transform: scale(1.2); opacity: 1; }

.stat-number { position: relative; z-index: 2; }

.stat-number .counter {
    font-size: 4.5rem !important;
    font-weight: 900 !important;
    color: #212529 !important; /* Hitam tetap, tidak pakai var(--primary-color) */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1;
}

.stat-label {
    position: relative;
    z-index: 2;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    color: var(--text-secondary) !important;
}

.counter.animate-count { animation: counterScale 0.6s ease-out; }

/* POPUP - menggunakan CSS Variables */
.simple-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.simple-popup-overlay.show { opacity: 1; pointer-events: all; }

.simple-popup-container {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    max-width: 600px;
    width: 92%;
    position: relative;
    transform: scale(0.8) translateY(30px);
    transition: transform 0.4s ease;
    overflow: hidden;
    max-height: 85vh;
    overflow-y: auto;
}

.simple-popup-overlay.show .simple-popup-container { transform: scale(1) translateY(0); }

.simple-popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    font-size: 1.1rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.simple-popup-close:hover {
    background: white;
    color: #dc3545;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.simple-popup-image {
    position: relative;
    height: 320px;
    overflow: hidden;
    background: var(--gradient-primary);
}

.popup-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.simple-popup-image:hover .popup-img { transform: scale(1.05); }

.simple-popup-content { padding: 2rem; text-align: center; }
.simple-popup-text { text-align: left; margin-bottom: 1rem; }

.announcement-detail {
    color: #495057;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0;
    text-align: justify;
}

.simple-popup-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    min-width: 160px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px var(--hover-overlay);
}

.simple-popup-btn:hover {
    box-shadow: 0 8px 20px var(--hover-overlay);
    background: var(--primary-hover);
}

.simple-popup-btn:focus { 
    animation: buttonPulse 1.5s ease-in-out infinite; 
}

.simple-popup-content * { transition: all 0.3s ease; }

/* RESPONSIVE DESIGN */
@media (max-width: 768px) {
    .simple-notification {
        top: 10px; right: 10px; left: 10px;
        min-width: auto; max-width: none;
        transform: translateY(-100%);
    }
    .simple-notification.show { transform: translateY(0); }
    .simple-notification:hover { transform: translateY(-2px); }
    
    .notification-content { padding: 0.875rem 1rem; padding-right: 2.25rem; }
    .notification-title { font-size: 0.9rem; }
    .notification-message { font-size: 0.8rem; }
    .notification-close { top: 0.625rem; right: 0.625rem; }
    
    .contact-form .card-body { padding: 1.5rem; }
    .captcha-container, .captcha-img { height: 45px; }
    .captcha-input { font-size: 1.1rem !important; letter-spacing: 3px !important; }
    
    .link-slide { flex: 0 0 180px; min-width: 180px; }
    .link-card:hover { transform: translateY(-8px) scale(1.02); }
    .link-card:hover .logo-img { transform: scale(1.1) rotate(3deg); }
    
    .stat-item { min-height: 220px; padding: 2rem !important; }
    .stat-number .counter { 
        font-size: 3.5rem !important; 
        color: #212529 !important; /* Tetap hitam di mobile */
    }
    .stat-icon i { font-size: 2rem !important; }
    .stat-label { font-size: 0.8rem; }
    
    .simple-popup-container { max-width: 500px; margin: 1rem; max-height: 80vh; }
    .simple-popup-image { height: 280px; }
    .simple-popup-content { padding: 1.5rem; }
    .simple-popup-btn { padding: 0.8rem 1.75rem; font-size: 0.9rem; width: 100%; margin-top: 0.5rem; }
}

@media (max-width: 576px) {
    .contact-form .btn-danger { width: 100%; padding: 1rem; }
    .simple-notification { top: 5px; right: 5px; left: 5px; border-radius: 0.5rem; }
    
    .notification-content { padding: 0.75rem 0.875rem; padding-right: 2rem; gap: 0.75rem; }
    .notification-content i { font-size: 1.1rem; }
    .notification-title { font-size: 0.85rem; }
    .notification-message { font-size: 0.75rem; }
    
    .link-slide { flex: 0 0 160px; min-width: 160px; }
    .link-slide .card-body { padding: 1rem; }
    .link-slide .logo-img { width: 50px !important; height: 50px !important; }
    .link-slide .card-title { font-size: 0.8rem; }
    .link-card:hover { transform: translateY(-5px) scale(1.01); }
    
    .stat-item { min-height: 180px; padding: 1.5rem !important; margin-bottom: 1rem; }
    .stat-number .counter { 
        font-size: 2.8rem !important;
        color: #212529 !important; /* Tetap hitam di mobile kecil */
    }
    .stat-icon i { font-size: 1.5rem !important; }
    .stat-icon { margin-bottom: 1rem !important; }
    .stat-label { font-size: 0.75rem; }
    
    .simple-popup-container { max-width: 380px; margin: 0.75rem; max-height: 75vh; }
    .simple-popup-image { height: 240px; }
    .simple-popup-content { padding: 1.25rem; }
    .simple-popup-btn { padding: 0.75rem 1.5rem; font-size: 0.85rem; }
}


.btn.btn-danger,
a.btn-danger,
button.btn-danger,
input.btn-danger,
div .btn-danger,
section .btn-danger,
.card .btn-danger,
.text-center .btn-danger,
#lokasi .btn-danger,
#berita .btn-danger,
.contact-form .btn-danger {
    background: var(--gradient-primary) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    font-weight: 600 !important;
}

.btn.btn-danger:hover,
a.btn-danger:hover,
button.btn-danger:hover,
input.btn-danger:hover,
div .btn-danger:hover,
section .btn-danger:hover,
.card .btn-danger:hover,
.text-center .btn-danger:hover,
#lokasi .btn-danger:hover,
#berita .btn-danger:hover,
.contact-form .btn-danger:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #fff !important;
}

.btn-outline-danger,
.card .btn-outline-danger,
.news-card .btn-outline-danger,
#berita .btn-outline-danger {
    color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    background: transparent !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-outline-danger:hover,
.card .btn-outline-danger:hover,
.news-card .btn-outline-danger:hover,
#berita .btn-outline-danger:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--hover-overlay) !important;
}

.btn-outline-danger:focus,
.card .btn-outline-danger:focus,
.news-card .btn-outline-danger:focus,
#berita .btn-outline-danger:focus {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 0 0 0.2rem var(--hover-overlay) !important;
}


.news-card .badge.bg-danger,
#berita .badge.bg-danger {
    background: var(--gradient-primary) !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600 !important;
}


.simple-notification + .simple-notification { top: 130px; }
.simple-notification + .simple-notification + .simple-notification { top: 240px; }
.simple-notification.fade-out { opacity: 0; transform: translateX(100%); transition: all 0.3s ease; }