/* CSS Variables untuk konsistensi */
:root {
    --main-color: #00e5ff;
    --main-color-shadow: rgba(0, 229, 255, 0.5);
    --main-color-glow: rgba(0, 229, 255, 0.8);
    --main-color-bg: rgba(0, 229, 255, 0.1);
    --main-color-border: rgba(0, 229, 255, 0.3);
    --navbar-bg: rgba(22, 28, 36, 0.8);
    --footer-bg: rgba(22, 28, 36, 0.8);
    --card-bg: rgba(0, 0, 0, 0.4);
    --card-hover-bg: rgba(0, 0, 0, 0.5);
    --category-post-bg: rgba(0, 0, 0, 0.3);
    --overlay-bg: rgba(0, 0, 0, 0.5);
    --text-color: #fff;
    --text-light: rgba(255, 255, 255, 0.8);
    --text-lighter: rgba(255, 255, 255, 0.7);
    --text-lightest: rgba(255, 255, 255, 0.6);
    --text-border: rgba(255, 255, 255, 0.3);
    --text-border-light: rgba(255, 255, 255, 0.1);
    --text-border-lighter: rgba(255, 255, 255, 0.08);
    --box-shadow-sm: 0 5px 15px rgba(0, 0, 0, 0.2);
    --box-shadow-md: 0 10px 25px rgba(0, 0, 0, 0.3);
    --box-shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.4);
    --transition-fast: all 0.3s ease;
    --transition-regular: all 0.4s ease;
    --transition-slow: all 0.6s ease;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #000; /* Warna dasar sebelum background dimuat */
    background-image: url('/img/Backround\ \(1\).png');
    background-repeat: no-repeat;
    background-position: top center; /* Ubah ke top center agar background dimulai dari atas */
    background-attachment: fixed;
    background-size: cover;
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-bg);
    z-index: -1;
}

/* ===== EFEK HUJAN ===== */
.rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    will-change: opacity;
}

.rain-drop {
    position: absolute;
    width: 1px;
    height: 15px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 100%);
    opacity: 0.6;
    animation: rain-fall linear infinite;
    will-change: transform;
}
  
@keyframes rain-fall {
    from {
        transform: translateY(-100vh);
    }
    to {
        transform: translateY(100vh);
    }
}

/* ===== EFEK HUJAN PADA POST ===== */
.post-image-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    z-index: 3;
    pointer-events: none;
}

.post-rain-drop {
    position: absolute;
    width: 1px;
    height: 8px;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 100%);
    opacity: 0.7;
    animation: post-rain-fall linear infinite;
    will-change: transform;
}

@keyframes post-rain-fall {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(100%);
    }
}

/* ===== EFEK KILAT ===== */
.lightning-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    z-index: 4;
    pointer-events: none;
}

.lightning {
    position: absolute;
    width: 20px;
    height: 70px;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.6) 30%,
        rgba(200, 220, 255, 0) 70%
    );
    filter: blur(2px);
    opacity: 0;
    animation: lightning-flash 0.2s ease-in-out;
    z-index: 5;
    will-change: opacity;
}

@keyframes lightning-flash {
    0% {
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
    }
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--navbar-bg);
    padding: 0.5rem 2rem; /* Kurangi padding atas bawah */
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--box-shadow-sm);
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 100px;
    right: 100px;
    height: 1px;
    background-color: var(--text-border);
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--main-color);
    text-decoration: none;
    text-shadow: 0 0 10px var(--main-color-shadow);
    transition: var(--transition-fast);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0 15px;
    position: relative;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--main-color);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--main-color);
}

.nav-links a:hover::after {
    width: 100%;
}

/* ===== HERO SECTION ===== */
.hero-section {
    text-align: center;
    padding: 1rem 1rem; /* Kurangi padding signifikan */
    margin-bottom: 0.8rem; /* Kurangi margin-bottom signifikan */
    position: relative;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.3rem; /* Kurangi margin */
    letter-spacing: 3px;
    text-shadow: 0 0 15px var(--main-color-shadow);
    position: relative;
    display: inline-block;
}

.hero-section h1::after {
    content: '';
    position: absolute;
    bottom: -5px; /* Geser ke atas */
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--main-color), transparent);
}

.hero-section h2 {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5; /* Kurangi line-height */
}

/* ===== BLOG CONTAINER ===== */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== BLOG POSTS ===== */
.blog-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.2rem; /* Kurangi gap signifikan */
    margin-bottom: 1.5rem; /* Kurangi margin-bottom signifikan */
}

.blog-post {
    background-color: var(--card-bg);
    border-radius: 10px; /* Kurangi radius sedikit */
    overflow: hidden;
    box-shadow: var(--box-shadow-md);
    transition: var(--transition-regular);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    will-change: transform, opacity;
}

.blog-post:hover {
    transform: translateY(-5px); /* Kurangi efek hover */
    box-shadow: var(--box-shadow-lg);
}

.post-image {
    position: relative;
    width: 100%;
    height: 180px; /* Kurangi height lagi */
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-post:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 1.2rem; /* Kurangi padding */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.category {
    color: var(--main-color);
    font-size: 0.85rem; /* Kurangi font-size */
    font-weight: 600;
    margin-bottom: 0.4rem; /* Kurangi margin */
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    position: relative;
    padding-bottom: 3px; /* Kurangi padding */
    overflow: hidden;
}

.category::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--main-color);
    transition: width 0.3s ease;
}

.blog-post:hover .category::after {
    width: 50px;
}

.blog-post h3 {
    font-size: 1.3rem; /* Kurangi font-size */
    color: var(--text-color);
    margin-bottom: 0.5rem; /* Kurangi margin */
    line-height: 1.3; /* Kurangi line-height */
    transition: var(--transition-fast);
}

.description {
    color: var(--text-light);
    margin-bottom: 1rem; /* Kurangi margin */
    flex-grow: 1;
    line-height: 1.5; /* Kurangi line-height */
    font-size: 0.9rem; /* Kurangi font-size */
}

/* ===== READ MORE BUTTON ===== */
.read-more {
    display: inline-flex;
    align-items: center;
    color: var(--main-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem; /* Kurangi font-size */
    transition: var(--transition-fast);
    margin-top: auto;
    padding: 6px 14px; /* Kurangi padding */
    border-radius: 30px;
    background: var(--main-color-bg);
    border: 1px solid var(--main-color-border);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.read-more svg {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.read-more-text {
    position: relative;
    z-index: 2;
}

.read-more:hover {
    background: rgba(0, 229, 255, 0.2);
    transform: translateY(-3px);
}

/* ===== CARD EXPANDED CONTENT ===== */
.card-full-content {
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: var(--transition-regular);
    color: var(--text-light);
    line-height: 1.5; /* Kurangi line-height */
    margin-top: 0;
}

.card.expanded .card-full-content {
    height: auto;
    opacity: 1;
    margin-top: 10px; /* Kurangi margin */
}

.card.expanded .read-more svg {
    transform: rotate(180deg);
}

.card.expanded {
    transform: scale(1.02);
    z-index: 10;
}

/* ===== CATEGORIES SECTION ===== */
.categories-section {
    margin-bottom: 1.5rem; /* Kurangi margin */
}

.category-card {
    background-color: var(--card-bg);
    border-radius: 10px; /* Kurangi radius */
    padding: 1.2rem; /* Kurangi padding */
    box-shadow: var(--box-shadow-md);
    position: relative;
    overflow: hidden;
    transition: var(--transition-regular);
    will-change: transform, opacity;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.category-card h3 {
    color: var(--main-color);
    font-size: 1.4rem; /* Kurangi font-size */
    margin-bottom: 0.8rem; /* Kurangi margin */
    position: relative;
    display: inline-block;
}

.category-card h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -5px; /* Kurangi */
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--main-color), transparent);
}

.category-posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem; /* Kurangi gap */
    justify-content: center;
    max-width: 1200px;
}

.category-post {
    background-color: var(--category-post-bg);
    border-radius: 8px; /* Kurangi radius */
    overflow: hidden;
    transition: var(--transition-regular);
    cursor: pointer;
    box-shadow: var(--box-shadow-sm);
    position: relative;
}

.category-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

.category-post:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-md);
}

.category-post img {
    width: 100%;
    height: 150px; /* Kurangi height */
    object-fit: cover;
    transition: transform 0.6s ease;
}

.category-post:hover img {
    transform: scale(1.05);
}

.category-post h4 {
    padding: 0.8rem; /* Kurangi padding */
    font-size: 1rem; /* Kurangi font-size */
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* ===== WEATHER WIDGET ===== */
.weather {
    position: fixed;
    bottom: 20px;
    right: 20px;
    font-size: 1.3rem;
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.6);
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    z-index: 90;
    transition: var(--transition-fast);
    box-shadow: var(--box-shadow-sm);
    border: 1px solid var(--text-border-light);
}

.weather:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-md);
    background-color: rgba(0, 0, 0, 0.7);
}

.weather i {
    color: var(--main-color);
    margin-right: 8px;
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--footer-bg);
    color: var(--text-color);
    padding: 1.2rem 0 0.8rem; /* Kurangi padding */
    margin-top: 1.5rem; /* Kurangi margin */
    border-top: 1px solid var(--text-border-light);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--main-color-bg), transparent);
    pointer-events: none;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.8rem; /* Kurangi margin */
}

.footer-logo h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--main-color);
    margin-bottom: 0.3rem;
    text-shadow: 0 0 10px var(--main-color-shadow);
}

.footer-logo p {
    font-size: 0.8rem;
    color: var(--text-lighter);
}

.footer-social {
    display: flex;
    gap: 0.8rem;
}

.footer-social .social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; /* Kurangi ukuran */
    height: 32px; /* Kurangi ukuran */
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.footer-social .social-btn:hover {
    background-color: var(--main-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--main-color-shadow);
}

.footer-social .social-btn i {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.footer-social .social-btn:hover i {
    transform: scale(1.2);
}

.footer-bottom {
    display: flex;
    justify-content: center;
    padding-top: 0.6rem; /* Kurangi padding */
    border-top: 1px solid var(--text-border-lighter);
}

.footer-bottom p {
    font-size: 0.8rem;
    color: var(--text-lightest);
}

.rain-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 768px) {
    .blog-posts {
        grid-template-columns: 1fr;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section h2 {
        font-size: 1rem;
    }
    
    .post-image {
        height: 170px;
    }
    
    .category-posts {
        grid-template-columns: 1fr;
    }
    
    .navbar {
        flex-direction: column;
        padding: 0.5rem;
    }
    
    .navbar::after {
        left: 20px;
        right: 20px;
    }
    
    .logo {
        margin-bottom: 0.5rem;
    }
    
    .nav-links {
        margin: 0.5rem 0;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0 8px;
    }
    
    .footer-top {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-logo {
        text-align: center;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 1rem 1rem;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .blog-post {
        margin-bottom: 1rem;
    }
    
    .post-content {
        padding: 1rem;
    }
}

/* ===== KELAS OPTIMASI PERFORMA ===== */
.animation-paused * {
    animation-play-state: paused !important;
}

.low-performance .blog-post:hover,
.low-performance .category-post:hover,
.low-performance .category-card:hover,
.low-performance .weather:hover {
    transform: none;
}

.low-performance .post-image img,
.low-performance .category-post img {
    transition: none;
}

.low-performance .blog-post:hover .post-image img,
.low-performance .category-post:hover img {
    transform: none;
}

/* ===== KELAS ANIMASI ===== */
.reveal {
    position: relative;
    opacity: 0;
    transform: translateY(20px); /* Kurangi jarak animasi */
    transition: var(--transition-slow);
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Delay animasi */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* ===== TRANSISI HALAMAN ===== */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.page-transition-overlay.active {
    opacity: 0.8;
}

/* Loading indicator */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    display: none;
}

.loading-indicator.active {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 229, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--main-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {transform: rotate(360deg);}
}

/* Optimasi: Scroll animation styles */
.reveal {
    position: relative;
    opacity: 0;
    transform: translateY(20px); /* Kurangi jarak animasi */
    transition: all 0.5s ease-out; /* Percepat transisi */
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Optimasi: Menyederhanakan delay animasi */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* Optimasi: Blog card animations */
.blog-post {
    opacity: 0;
    transform: translateY(15px); /* Kurangi jarak animasi */
    transition: all 0.4s ease-out; /* Percepat transisi */
    will-change: opacity, transform;
}

.blog-post.active {
    opacity: 1;
    transform: translateY(0);
}

/* Optimasi: Category card animations */
.category-card {
    opacity: 0;
    transform: translateY(15px); /* Kurangi jarak animasi */
    transition: all 0.4s ease-out; /* Percepat transisi */
    will-change: opacity, transform;
}

.category-card.active {
    opacity: 1;
    transform: translateY(0);
}

/* Optimasi: Glowing badge effect */
.category::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.2), transparent);
    transition: left 0.7s ease;
}

/* Static Navbar Styles */
.navbar {
    position: static;
    z-index: 100;
}

/* Optimasi: Kelas untuk performa rendah */
.low-performance .rain-drop,
.low-performance .post-rain-drop {
    display: none;
}

.low-performance .rain-drop:nth-child(3n),
.low-performance .post-rain-drop:nth-child(3n) {
    display: block;
}

/* Optimasi: Animasi yang paused saat tidak visible */
.animation-paused * {
    animation-play-state: paused !important;
}