/* CSS Variables untuk konsistensi */
:root {
    --main-color: #00e5ff;
    --main-color-shadow: rgba(0, 229, 255, 0.5);
    --main-color-light: rgba(0, 229, 255, 0.1);
    --main-color-medium: rgba(0, 229, 255, 0.2);
    --main-color-border: rgba(0, 229, 255, 0.3);
    --navbar-bg: rgba(22, 28, 36, 0.8);
    --section-bg: rgba(44, 62, 80, 0.7);
    --card-bg: rgba(255, 255, 255, 0.1);
    --modal-bg: rgba(22, 28, 36, 0.95);
    --text-color: #fff;
    --text-light: rgba(255, 255, 255, 0.9);
    --text-lighter: rgba(255, 255, 255, 0.8);
    --text-lightest: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.3);
    --border-light: rgba(255, 255, 255, 0.2);
    --border-lighter: rgba(255, 255, 255, 0.1);
    --border-lightest: rgba(255, 255, 255, 0.08);
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    --box-shadow-medium: 0 10px 30px rgba(0, 0, 0, 0.3);
    --box-shadow-large: 0 15px 40px rgba(0, 0, 0, 0.4);
    --transition-fast: all 0.3s ease;
    --transition-medium: all 0.4s ease;
    --transition-slow: all 0.6s ease-out;
}

/* 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: center center;
    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: rgba(0, 0, 0, 0.5);
    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);
    }
}

@keyframes rain-fall-angled {
    from {
        transform: translateY(-100vh) translateX(-10px);
    }
    to {
        transform: translateY(100vh) translateX(10px);
    }
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--navbar-bg);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

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

.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%;
}

/* ===== MAIN CONTENT ===== */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 2;
}

.section {
    margin-bottom: 4rem;
    padding: 2rem;
    border-radius: 15px;
    background-color: var(--section-bg);
    position: relative;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color);
    position: relative;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    position: relative;
}

/* ===== SECTION TITLE ===== */
.section-title {
    display: inline-block;
    position: relative;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, rgba(0,229,255,0) 0%, rgba(0,229,255,1) 50%, rgba(0,229,255,0) 100%);
}

/* ===== PORTFOLIO INTRO ===== */
.portfolio-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 15px;
}

.intro-content {
    flex: 1;
    padding-right: 2rem;
}

.intro-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--main-color);
}

.intro-subtitle {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--text-lighter);
}

.intro-text {
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.intro-photo {
    flex: 0 0 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--main-color);
    box-shadow: 0 0 20px var(--main-color-shadow);
}

.intro-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== TAGS ===== */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.tag {
    background-color: var(--main-color-light);
    color: var(--main-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid var(--main-color-border);
}

/* ===== PORTFOLIO HEADER ===== */
.portfolio-header {
    margin-bottom: 3rem;
    text-align: center;
}

.header-quote {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-light);
}

/* ===== PORTFOLIO CONTAINER ===== */
.portfolio-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* ===== PORTFOLIO ITEM ===== */
.portfolio-item {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    transition: var(--transition-fast);
    will-change: transform, opacity;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-medium);
}

.portfolio-content {
    display: flex;
    flex-wrap: wrap;
    padding: 2rem;
}

.portfolio-text {
    flex: 1;
    min-width: 300px;
    padding-right: 2rem;
}

.portfolio-image {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

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

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

/* ===== VIEW MORE LINK ===== */
.view-more {
    margin-top: 1.5rem;
}

.view-more-link {
    display: inline-block;
    color: var(--main-color);
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
}

.view-more-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80%;
    height: 1px;
    background-color: var(--main-color);
}

.view-more-link:hover {
    text-shadow: 0 0 5px var(--main-color-shadow);
}

/* ===== MODAL STYLES ===== */
.portfolio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: var(--modal-bg);
    margin: 50px auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 900px;
    width: 90%;
    box-shadow: 0 0 20px var(--main-color-shadow);
    animation: modalFadeIn 0.3s;
    border: 1px solid var(--border-light);
    will-change: transform, opacity;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
}

.modal-header h2 {
    color: var(--main-color);
    margin: 0;
    font-size: 1.8rem;
}

.modal-close {
    color: var(--text-color);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--card-bg);
}

.modal-close:hover {
    color: var(--main-color);
    background-color: var(--card-bg);
    transform: rotate(90deg);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-image {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
}

.modal-description {
    line-height: 1.7;
    margin-bottom: 30px;
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 25px 0;
}

.gallery-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.gallery-image:hover {
    transform: scale(1.05);
}

.modal-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 25px 0;
}

.detail-item {
    background-color: var(--card-bg);
    padding: 15px;
    border-radius: 8px;
}

.detail-item h4 {
    font-size: 1rem;
    color: var(--main-color);
    margin-top: 0;
    margin-bottom: 10px;
}

.detail-item p {
    margin: 0;
    font-size: 0.9rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

.modal-button {
    display: inline-block;
    padding: 10px 24px;
    background-color: var(--main-color-medium);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    transition: var(--transition-fast);
    border: 1px solid var(--main-color-border);
    cursor: pointer;
}

.modal-button:hover {
    background-color: rgba(0, 229, 255, 0.4);
    transform: translateY(-3px);
}

/* ===== FOOTER ===== */
.footer {
    background-color: var(--navbar-bg);
    color: var(--text-color);
    padding: 2rem 0 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-lighter);
}

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

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

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

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

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

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: var(--transition-fast);
}

.footer-social a:hover {
    background-color: var(--main-color);
    transform: translateY(-3px);
}

.footer-bottom {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-lightest);
}

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

/* ===== ANIMATION CLASSES ===== */
.reveal {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-slow);
    will-change: opacity, transform;
}

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

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

.portfolio-item {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition-medium);
    will-change: opacity, transform;
}

.portfolio-item.active {
    opacity: 1;
    transform: translateY(0);
}

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

/* ===== MEDIA QUERIES ===== */
@media (max-width: 1200px) {
    .portfolio-content {
        justify-content: center;
    }
    
    .portfolio-text {
        padding-right: 0;
        margin-bottom: 2rem;
    }
}

@media (max-width: 992px) {
    .portfolio-intro {
        flex-direction: column-reverse;
        text-align: center;
    }
    
    .intro-content {
        padding-right: 0;
    }
    
    .intro-photo {
        margin-bottom: 2rem;
    }
    
    .tags {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
    }
    
    .navbar::after {
        left: 20px;
        right: 20px;
    }
    
    .logo {
        margin-bottom: 1rem;
    }
    
    .nav-links {
        margin: 1rem 0;
    }
    
    .nav-links li {
        margin: 0 8px;
    }
    
    .section {
        padding: 1.5rem 1rem;
    }
    
    .portfolio-image {
        height: 250px;
    }
    
    .footer-top {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .footer-logo {
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 30px auto;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.6rem;
    }
    
    .intro-title {
        font-size: 1.8rem;
    }
    
    .portfolio-image {
        height: 200px;
    }
}

/* ===== OPTIMASI PERFORMA ===== */
.low-performance .rain-drop {
    display: none;
}

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

.low-performance .portfolio-item:hover,
.low-performance .gallery-image:hover,
.low-performance .portfolio-image img:hover,
.low-performance .modal-button:hover,
.low-performance .modal-close:hover,
.low-performance .footer-social a:hover {
    transform: none;
}

.low-performance .portfolio-image img,
.low-performance .gallery-image {
    transition: none;
}

/* ===== PAGE TRANSITION ===== */
.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);}
}


/* Page Transition Overlay */
.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: #00e5ff;
    animation: spin 1s linear infinite;
}

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

/* Optimasi: Intro section */
.portfolio-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
}

.intro-content {
    flex: 1;
    padding-right: 2rem;
}

.intro-title {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #00e5ff;
}

.intro-subtitle {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.intro-text {
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.intro-photo {
    flex: 0 0 200px;
    height: 200px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #00e5ff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.intro-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Optimasi: Section title */
.section-title {
    display: inline-block;
    position: relative;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, rgba(0,229,255,0) 0%, rgba(0,229,255,1) 50%, rgba(0,229,255,0) 100%);
}

/* Optimasi: Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.tag {
    background-color: rgba(0, 229, 255, 0.1);
    color: #00e5ff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

/* Optimasi: Modal styles */
.portfolio-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    position: relative;
    background-color: rgba(22, 28, 36, 0.95);
    margin: 50px auto;
    padding: 30px;
    border-radius: 15px;
    max-width: 900px;
    width: 90%;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
    animation: modalFadeIn 0.3s;
    border: 1px solid rgba(0, 229, 255, 0.2);
}

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

/* Optimasi: Scroll animation */
.reveal {
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
    will-change: opacity, transform;
}

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

/* Optimasi: Animation delays */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

/* Optimasi: Portfolio items */
.portfolio-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.5s ease-out;
    will-change: opacity, transform;
}

.portfolio-item.active {
    opacity: 1;
    transform: translateY(0);
}

/* Optimasi: Low performance mode */
.low-performance .rain-drop {
    display: none;
}

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

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

/* Animasi paused ketika halaman tidak terlihat */
.animation-paused * {
    animation-play-state: paused !important;
}