/* --- Reset & Variabel Dasar --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
}

:root {
    --neon-blue: #0f0;
    --neon-pink: #f0f;
    --matrix-green: #0f0;
    --cyber-dark: #000;
    --transition-speed: 0.3s;
}

body {
    background-color: var(--cyber-dark);
    color: var(--matrix-green);
    overflow-x: hidden;
    scroll-behavior: smooth;
}



/* --- Background Matrix Rain --- */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    opacity: 0.2;
}

/* --- Efek Glitch --- */
@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, .75), -0.025em -0.05em 0 rgba(0, 255, 0, .75), 0.025em 0.05em 0 rgba(0, 0, 255, .75);
    }

    14% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, .75), -0.05em -0.025em 0 rgba(0, 255, 0, .75), -0.025em 0.05em 0 rgba(0, 0, 255, .75);
    }

    15% {
        text-shadow: -0.05em 0 0 rgba(255, 0, 0, .75), 0.025em 0.025em 0 rgba(0, 255, 0, .75), -0.05em -0.05em 0 rgba(0, 0, 255, .75);
    }

    49% {
        text-shadow: -0.05em 0 0 rgba(255, 0, 0, .75), 0.025em 0.025em 0 rgba(0, 255, 0, .75), -0.05em -0.05em 0 rgba(0, 0, 255, .75);
    }

    50% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, .75), 0.05em 0 0 rgba(0, 255, 0, .75), 0 -0.05em 0 rgba(0, 0, 255, .75);
    }

    99% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, .75), 0.05em 0 0 rgba(0, 255, 0, .75), 0 -0.05em 0 rgba(0, 0, 255, .75);
    }

    100% {
        text-shadow: -0.025em 0 0 rgba(255, 0, 0, .75), -0.025em -0.025em 0 rgba(0, 255, 0, .75), -0.025em -0.05em 0 rgba(0, 0, 255, .75);
    }
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    z-index: 100;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    padding: 1rem;
}

.navbar ul li a {
    color: var(--matrix-green);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.navbar ul li a:hover {
    color: var(--neon-blue);
}

/* Tampilkan menu sebagai scroll horizontal di mobile */
@media (max-width: 768px) {
    .navbar ul {
        overflow-x: auto;
        /* Aktifkan scroll horizontal */
        white-space: nowrap;
        /* Pastikan item navbar tidak membungkus ke baris baru */
        -webkit-overflow-scrolling: touch;
        /* Scroll yang halus di perangkat touch */
    }

    .navbar ul li {
        display: inline-block;
        /* Pastikan setiap item berada dalam satu baris */
    }
}

/* --- Header --- */
header {
    position: relative;
    padding: 100px 0;
    text-align: center;
    border-bottom: 3px solid var(--neon-blue);
    box-shadow: 0 0 30px var(--neon-blue);
}

.cyber-title {
    font-size: 4em;
    text-transform: uppercase;
    letter-spacing: 4px;
    animation: glitch 3s infinite;
    text-shadow: 0 0 10px var(--matrix-green);
}

.cyber-subtitle {
    margin-top: 10px;
    font-size: 1.2em;
}

/* --- Profile Section (Foto Formal) --- */
#profile {
    padding: 50px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    /* background: rgba(255, 255, 255, 0.03); */
}



.profile-photo img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 4px solid var(--neon-blue);
    object-fit: cover;
}

.profile-info {
    max-width: 500px;
    text-align: left;
}

.profile-info h2 {
    margin-bottom: 1rem;
    color: var(--matrix-green);
}

.profile-info p {
    color: var(--matrix-green);
    line-height: 1.6;
}

/* --- Recent Projects Section --- */
#projects {
    padding: 50px;
    text-align: center;
}

#projects h2 {
    margin-bottom: 30px;
    color: var(--matrix-green);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* --- Modern Cyber Card --- */
.modern-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 1rem 2rem 2rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--matrix-green);
    cursor: pointer;
}

.modern-card img {
    width: 100%;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.modern-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5em;
}

.modern-card p {
    font-size: 1em;
    line-height: 1.4;
}

/* --- Tag Style --- */
.project-tags {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--neon-blue);
    border-radius: 5px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85em;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* --- Overlay Animasi Card --- */
.modern-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(0, 255, 255, 0.2), transparent);
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.modern-card:hover::after {
    opacity: 0.5;
}

/* --- Social Feed Section --- */
#feed {
    padding: 50px;
    text-align: center;
    /* background: rgba(255, 255, 255, 0.03); */
}

#feed h2 {
    margin-bottom: 20px;
    color: var(--matrix-green);
}

.feed-tabs {
    margin-bottom: 20px;
}

.feed-tab {
    background: transparent;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    padding: 0.5rem 1rem;
    margin: 0 0.3rem;
    cursor: pointer;
    transition: background var(--transition-speed);
}

.feed-tab.active,
.feed-tab:hover {
    background: var(--neon-blue);
    color: var(--cyber-dark);
}

.feed-content {
    display: none;
}

.feed-content.active {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.feed-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    width: 150px;
    text-align: center;
}

.feed-item img {
    width: 100%;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

/* --- Social Media Section --- */
#social {
    padding: 50px;
    text-align: center;
}

#social h2 {
    margin-bottom: 20px;
    color: var(--matrix-green);
}

#social a {
    margin: 0 10px;
    color: var(--matrix-green);
    font-size: 2em;
    transition: color 0.3s;
}

#social a:hover {
    color: var(--neon-blue);
}

/* --- Kontak Section --- */
#contact {
    padding: 50px;
    text-align: center;
}

#contact input,
#contact textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 2px solid var(--matrix-green);
    background: transparent;
    color: var(--matrix-green);
}

#contact button {
    padding: 10px 20px;
    border: none;
    background: var(--neon-blue);
    color: var(--cyber-dark);
    cursor: pointer;
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    padding-top: 60px;
    animation: fadeIn 0.5s;
}

.modal-content {
    background-color: var(--cyber-dark);
    margin: auto;
    padding: 20px;
    border: 1px solid var(--neon-blue);
    width: 80%;
    color: var(--matrix-green);
    border-radius: 10px;
    animation: scaleIn 0.5s;
}

.modal-body {
    text-align: center;
    padding: 20px;
}

.modal-title {
    font-size: 2em;
    margin-bottom: 10px;
}

.modal-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 15px;
}

.modal-description {
    font-size: 1em;
    margin-bottom: 20px;
}

.modal-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--neon-blue);
    color: var(--cyber-dark);
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modal-btn i {
    margin-right: 8px;
}

.modal-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close {
    color: var(--matrix-green);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--neon-blue);
    text-decoration: none;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- Back-to-Top Button --- */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--neon-blue);
    color: var(--cyber-dark);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-blue);
    z-index: 150;
    transition: opacity 0.3s;
}

#backToTop.hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .cyber-title {
        font-size: 2em;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    #profile {
        flex-direction: column;
        text-align: center;
    }

    .profile-info {
        text-align: center;
    }
}

/* Loading Animation */
.feed-loader {
    text-align: center;
    padding: 2rem;
    color: var(--neon-blue);
    font-size: 1.2em;
}

.feed-loader .fa-spinner {
    margin-right: 10px;
}

/* Error State */
.matrix-error {
    padding: 2rem;
    text-align: center;
    border: 2px solid #ff0066;
    margin: 2rem;
    color: #ff5555;
    text-shadow: 0 0 10px #ff0000;
}

/* Grid Layout */
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.repo-card {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--neon-blue);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.repo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.repo-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
}

.repo-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--neon-blue);
    color: var(--cyber-dark) !important;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-top: 1rem;
    border: none;
    cursor: pointer;
}

.repo-link:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background: var(--matrix-green);
}

.repo-link i {
    margin-right: 8px;
}


/* TAMBAHAN DULU  */
#social div {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    /* Menggunakan gap untuk spacing yang konsisten */
}

#social a {
    margin: 0;
    /* Hapus margin horizontal */
    font-size: 2em;
    flex-shrink: 1;
    /* Memungkinkan ikon menyusut jika diperlukan */
}

/* Pastikan semua ikon memiliki ukuran yang konsisten */
#social a i {
    font-size: 1em !important;
}

@media (max-width: 768px) {
    #social div {
        gap: 12px;
        /* Kurangi jarak antar ikon di mobile */
    }

    #social a {
        font-size: 1.6em;
        /* Sesuaikan ukuran ikon untuk mobile */
    }

    /* Opsi alternatif untuk layar sangat kecil */
    @media (max-width: 480px) {
        #social a {
            font-size: 1.4em;
        }
    }
}


/* Running text */
/* Tambahkan di styles.css */
#typed-text {
    position: relative;
    color: var(--matrix-green);
    line-height: 1.6;
    min-height: 96px;
    /* Sesuaikan dengan tinggi teks */
}

#typed-text.typing::after {
    content: '';
    position: absolute;
    right: -0.5em;
    bottom: 2px;
    width: 10px;
    height: 1.2em;
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
    animation: cyber-blink 0.8s step-end infinite;
}

@keyframes cyber-blink {

    from,
    to {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

#typed-text {
    animation: text-glitch 3s infinite;
}

/* Header terminal */
/* Terminal Style */
.cyber-terminal {
    background: rgba(0, 30, 0, 0.9);
    border: 2px solid #0f0;
    padding: 1rem;
    margin: 20px auto;
    width: 70%;
    font-family: 'Courier New', monospace;
    max-height: 40px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.terminal-header {
    color: #0f0;
    border-bottom: 1px solid #0f0;
    padding-bottom: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.led {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #f00;
    border-radius: 50%;
    margin-right: 5px;
    animation: led-pulse 1s infinite;
}

#terminal-output {
    height: 150px;
    overflow-y: auto;
    color: #0f0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.terminal-input input {
    background: transparent;
    border: none;
    color: #0f0;
    font-family: 'Courier New', monospace;
    width: 90%;
    width: calc(100% - 20px);
    outline: none;
    /* Ini yang menghilangkan border saat focus */
    caret-color: #0f0;
    /* Warna kursor ketik */
}

/* Untuk browser tertentu yang masih menampilkan outline */
.terminal-input input:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

.terminal-input input::-moz-focus-inner {
    border: 0;
  }

.terminal-input input,
.terminal-input input:focus,
.terminal-input input:active,
.terminal-input input:hover {
  outline: none;
  border: none;
  box-shadow: none;
}

.terminal-input input::-webkit-search-decoration,
.terminal-input input::-webkit-search-cancel-button,
.terminal-input input::-webkit-search-results-button,
.terminal-input input::-webkit-search-results-decoration {
  display: none;
}

/* Menghilangkan highlight di mobile */
.terminal-input input,
.terminal-input input:focus {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: text;
  user-select: text;
}

@keyframes led-pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.cyber-terminal.collapsed {
    max-height: 40px;
}

.cyber-terminal.expanded {
    max-height: 300px;
}

.terminal-body {
    display: none;
}

.cyber-terminal.expanded .terminal-body {
    display: block;
}

#terminal-output::-webkit-scrollbar {
    width: 0 !important;
}

/* Antisiapsi copy paste */
#terminal-cmd {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
  }
  
  /* Efek visual saat mencoba paste */
  #terminal-cmd:active {
    animation: deny-paste 0.3s;
  }
  
  @keyframes deny-paste {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
  }

  /* styles.css */
@keyframes glitch {
    0% { text-shadow: 1px 0 red; }
    25% { text-shadow: -1px 0 cyan; }
    50% { transform: skew(5deg); }
    100% { text-shadow: 0 0 white; }
}

.system-alert {
    animation: glitch 0.5s infinite;
    color: #ff5555 !important;
}