/* =========================================
   Reset & Base Styles
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Font Retro untuk estetika hacker */
    font-family: 'VT323', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary-color: #0d1117;
    --secondary-color: #1f6feb;
    --accent-color: #00ff41; /* Neon green */
    --light-color: #c9d1d9;
    --dark-color: #0d1117;
    --gray-color: #8b949e;
    --terminal-bg: #0d1117;
    --terminal-text: #00ff41;
}

html {
    scroll-behavior: smooth;
}

/* =========================================
   FULL SCREEN CRT RETRO EFFECTS
   ========================================= */
body {
    line-height: 1.6;
    color: var(--light-color);
    background-color: #0d1117;
    position: relative;
    overflow-x: hidden;
}

/* Vignette (Sudut Gelap) & Glow */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(circle, rgba(0,255,65,0.03) 50%, rgba(0,0,0,0.85) 120%);
    z-index: 9998;
    pointer-events: none;
}

/* Scanlines (Garis-garis layar) */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
    0% { opacity: 0.75; }
    5% { opacity: 0.85; }
    10% { opacity: 0.75; }
    100% { opacity: 0.75; }
}

/* Layar Pulse/Glitch sesekali */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: rgba(0, 255, 65, 0.05);
    z-index: 9997;
    pointer-events: none;
    animation: screen-pulse 10s infinite;
}

@keyframes screen-pulse {
    0% { opacity: 0; }
    98% { opacity: 0; }
    99% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* Phosphor Glow: Teks Bercahaya */
h1, h2, h3, h4, .terminal-output, .terminal-prompt, .logo span, .nav-links a.active {
    text-shadow: 0 0 4px rgba(0, 255, 65, 0.6), 0 0 10px rgba(0, 255, 65, 0.4);
}
p, .nav-links a {
    text-shadow: 0 0 2px rgba(201, 209, 217, 0.4);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--dark-color);
}
::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

/* =========================================
   Container & General
   ========================================= */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

section { padding: 80px 0; }
h1 { font-size: 3.5rem; line-height: 1.2; }
h2 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    color: var(--accent-color);
}
h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--secondary-color);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--secondary-color);
}
p { margin-bottom: 15px; font-size: 1.3rem; color: var(--gray-color); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--secondary-color);
    color: white;
    border-radius: 5px;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: 1px solid var(--secondary-color);
    cursor: pointer;
}
.btn-accent {
    background-color: var(--secondary-color);
    border: 1px solid var(--accent-color);
}
/* Chromatic Aberration Hover Effect */
.btn:hover, .btn-accent:hover {
    text-shadow: 2px 0px 1px rgba(255,0,0,0.5), -2px 0px 1px rgba(0,0,255,0.5);
    background-color: transparent;
    color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color), inset 0 0 10px rgba(0,255,65,0.3);
    transform: translateY(-3px);
}

/* =========================================
   Header & Navigation
   ========================================= */
header {
    background-color: #0d1117; /* Solid color menutupi konten bawah */
    box-shadow: 0 0 20px rgba(31, 111, 235, 0.3);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--secondary-color);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
header.scrolled {
    box-shadow: 0 0 25px rgba(0, 255, 65, 0.25);
    border-bottom-color: var(--accent-color);
}

.navbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.logo { font-size: 2.2rem; font-weight: 700; color: var(--secondary-color); }
.logo span { color: var(--accent-color); }

.nav-links { display: flex; }
.nav-links li { margin-left: 30px; position: relative; }
.nav-links a { font-size: 1.4rem; font-weight: 600; transition: color 0.3s; color: var(--light-color); }
.nav-links a:hover { color: var(--accent-color); }
.nav-links a.active { color: var(--accent-color); }
.nav-links a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -8px;
    height: 2px;
    background-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
}

.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    background: none;
    border: none;
    color: var(--light-color);
    padding: 0;
}

/* =========================================
   Hero Section & Terminal
   ========================================= */
.hero {
    background: linear-gradient(135deg, #0d1117 0%, #1a2332 100%);
    padding-top: 150px;
    padding-bottom: 100px;
    text-align: center;
}
.hero-terminal {
    background-color: rgba(13, 17, 23, 0.9);
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    margin-bottom: 40px;
    box-shadow: 0 0 30px rgba(31, 111, 235, 0.3), inset 0 0 15px rgba(0,255,65,0.1);
    overflow: hidden;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}
.terminal-header {
    background-color: #161b22;
    padding: 10px 15px;
    border-bottom: 1px solid var(--secondary-color);
    display: flex;
    gap: 8px;
}
.terminal-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.terminal-dot:nth-child(1) { background-color: #ff5f57; }
.terminal-dot:nth-child(2) { background-color: #febc2e; }
.terminal-dot:nth-child(3) { background-color: #28c840; }

.terminal-content {
    padding: 15px;
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 1.3rem;
    text-align: left;
    line-height: 1.8;
    color: var(--accent-color);
    min-height: 130px;
}
.terminal-prompt { color: var(--secondary-color); }
.terminal-output { color: var(--accent-color); }

/* Kursor Balok Solid */
.cursor-blink {
    display: inline-block;
    width: 10px;
    height: 1.2rem;
    background-color: var(--accent-color);
    vertical-align: middle;
    margin-left: 2px;
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

.hero-content { max-width: 800px; margin: 0 auto; }
.hero h1 { margin-bottom: 20px; }
.subtitle {
    color: var(--accent-color);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}
.hero-btns { display: flex; justify-content: center; gap: 20px; margin-top: 30px; }

/* =========================================
   About Section
   ========================================= */
.about-content { display: flex; align-items: center; gap: 50px; }
.about-text { flex: 1; color: var(--light-color); }
.about-img { flex: 1; text-align: center; }
.about-img img {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(31, 111, 235, 0.3);
    border: 2px solid var(--secondary-color);
}

/* =========================================
   Skills Section
   ========================================= */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.skill-item {
    background-color: rgba(22, 27, 34, 0.8);
    padding: 30px;
    border-radius: 10px;
    border: 1px solid var(--secondary-color);
    box-shadow: 0 0 20px rgba(31, 111, 235, 0.2);
    text-align: center;
    transition: all 0.3s;
}
.skill-item:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
}
.skill-icon { font-size: 3rem; color: var(--secondary-color); margin-bottom: 20px; }
.skill-item:hover .skill-icon { color: var(--accent-color); text-shadow: 0 0 10px var(--accent-color); }
.skill-item h3 { margin-bottom: 15px; font-size: 1.8rem; color: var(--accent-color); }

/* =========================================
   Portfolio Section
   ========================================= */
.portfolio { background-color: rgba(13, 17, 23, 0.8); }
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.portfolio-item {
    background-color: rgba(22, 27, 34, 0.9);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--secondary-color);
    box-shadow: 0 0 20px rgba(31, 111, 235, 0.2);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.portfolio-item:hover {
    transform: translateY(-10px);
    border-color: var(--accent-color);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.3);
}
.portfolio-content { padding: 25px; }
.portfolio-content h3 { margin-bottom: 10px; font-size: 1.8rem; color: var(--accent-color); }
.portfolio-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 15px 0 0 0; }
.tag {
    display: inline-block;
    background-color: rgba(31, 111, 235, 0.2);
    border: 1px solid var(--secondary-color);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 1rem;
}

/* =========================================
   Contact Section
   ========================================= */
.contact-container { display: flex; gap: 50px; margin-top: 40px; }
.contact-info, .contact-form { flex: 1; }
.contact-item { display: flex; align-items: center; margin-bottom: 30px; }
.contact-icon {
    width: 60px; height: 60px;
    background-color: var(--secondary-color); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    margin-right: 15px; font-size: 1.5rem;
}
.contact-item h3 { color: var(--accent-color); font-size: 1.6rem; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 1.3rem; color: var(--accent-color); }
.form-control {
    width: 100%; padding: 12px; border: 1px solid var(--secondary-color);
    border-radius: 5px; font-size: 1.2rem;
    background-color: rgba(22, 27, 34, 0.9); color: var(--light-color);
    transition: all 0.3s;
}
.form-control:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 10px rgba(0, 255, 65, 0.3); }
textarea.form-control { min-height: 150px; resize: vertical; }

/* =========================================
   Footer
   ========================================= */
footer {
    background-color: #0d1117;
    border-top: 1px solid var(--secondary-color);
    color: var(--light-color);
    padding: 50px 0 20px;
    position: relative;
    z-index: 10;
}
.footer-content { display: flex; justify-content: space-between; margin-bottom: 40px; }
.footer-about { flex: 2; margin-right: 50px; }
.footer-about h3 { color: var(--accent-color); font-size: 2rem; margin-bottom: 10px; }
.footer-social { flex: 1; }
.footer-social h3 { color: var(--accent-color); font-size: 1.8rem; margin-bottom: 20px; }
.social-icons { display: flex; gap: 15px; }
.social-icons a {
    display: flex; align-items: center; justify-content: center;
    width: 45px; height: 45px; font-size: 1.3rem;
    background-color: rgba(31, 111, 235, 0.2); border: 1px solid var(--secondary-color);
    border-radius: 50%; color: var(--accent-color); transition: all 0.3s;
}
.social-icons a:hover {
    background-color: var(--secondary-color); color: white;
    transform: translateY(-5px); box-shadow: 0 0 15px rgba(31, 111, 235, 0.5);
}
.copyright { text-align: center; padding-top: 20px; border-top: 1px solid rgba(139, 148, 158, 0.3); color: var(--gray-color); }

/* =========================================
   Responsive Styles
   ========================================= */
@media (max-width: 992px) {
    .about-content, .contact-container, .footer-content { flex-direction: column; }
    .footer-about { margin-right: 0; margin-bottom: 30px; }
}

@media (max-width: 768px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    .nav-links {
        position: absolute; top: 80px; left: 0; width: 100%;
        background-color: #0d1117; flex-direction: column; align-items: center;
        padding: 20px 0; border-bottom: 1px solid var(--secondary-color);
        transform: translateY(-100%); opacity: 0; transition: all 0.3s;
        pointer-events: none;
    }
    .nav-links.active { transform: translateY(0); opacity: 1; pointer-events: all; }
    .nav-links li { margin: 15px 0; }
    .menu-toggle { display: block; }
    .hero-btns { flex-direction: column; align-items: center; }
    .btn { width: 80%; max-width: 250px; text-align: center; }
}
/* =========================================
   CODEFORCES LIVE STATS CARD
   ========================================= */
/* =========================================
   CODEFORCES LIVE STATS CARD
   ========================================= */
.cf-card {
    background-color: rgba(22, 27, 34, 0.9);
    border: 1px solid var(--secondary-color);
    border-left: 4px solid var(--accent-color);
    padding: 15px;
    margin-top: 25px; /* Memberi jarak antara foto dan panel */
    border-radius: 5px;
    font-family: 'VT323', monospace;
    text-align: left; /* Mengembalikan teks ke kiri */
    max-width: 400px; /* Menyamakan lebar maksimal dengan foto profil */
    margin-left: auto;
    margin-right: auto;
}
.progress-container{

    margin-top:20px;

}

.progress-bar{

    width:100%;
    height:10px;

    background:#222;

    border-radius:20px;

    overflow:hidden;

    margin-top:15px;

}

#cy-bar{

    width:0%;

    height:100%;

    background:linear-gradient(
        90deg,
        #00ff41,
        #00b7ff
    );

    transition:.8s;

}

#cy-updated{

    margin-top:10px;

    color:#888;

    font-size:.8rem;

}

.progress-fill{

    height:100%;

    width:0%;

    background:linear-gradient(
        90deg,
        #00ff41,
        #1f6feb
    );

    transition:width .8s;

}
.cf-card h4 {
    margin-bottom: 10px;
    color: var(--light-color);
    font-size: 1.4rem;
}

.cf-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.cf-item {
    font-size: 1.2rem;
    color: var(--accent-color);
}

.cf-item span {
    color: var(--gray-color);
}

/* =========================================
   MODAL MARKDOWN VIEWER
   ========================================= */
.modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(13, 17, 23, 0.85); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #0d1117;
    margin: 5% auto; 
    padding: 30px;
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.2);
    position: relative;
    /* Font standar agar write-up mudah dibaca */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--light-color);
}

.close-btn {
    color: var(--accent-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    color: #ff5f57;
    text-shadow: 0 0 10px #ff5f57;
}

/* Kustomisasi Tampilan Hasil Markdown */
#markdown-content h1, #markdown-content h2, #markdown-content h3 {
    color: var(--accent-color);
    margin-top: 20px;
    margin-bottom: 15px;
    font-family: 'VT323', monospace;
}

#markdown-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--light-color);
    text-shadow: none;
}

#markdown-content a {
    color: var(--secondary-color);
    text-decoration: underline;
}

#markdown-content pre {
    background-color: #161b22;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    border: 1px solid var(--gray-color);
    margin: 15px 0;
}

#markdown-content code {
    font-family: 'Courier New', Courier, monospace;
    color: #00ff41;
}

#markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 15px 0;
}