:root {
    --neo-black: #1a1a1a;
    --neo-white: #ffffff;
    --neo-bg: #fdfbf7;
    --neo-yellow: #ffde59;
    --neo-pink: #ff99c8;
    --neo-blue: #9eeaf9;
    --neo-green: #d0f0c0;
    --border-width: 3px;
    --shadow-offset: 5px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lexend', sans-serif;
}

body {
    background-color: var(--neo-bg);
    color: var(--neo-black);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-image: radial-gradient(var(--neo-black) 1px, transparent 1px);
    background-size: 30px 30px;
}

/* --- NEO BRUTALISM COMPONENTS --- */

.neo-box {
    background: var(--neo-white);
    border: var(--border-width) solid var(--neo-black);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--neo-black);
    transition: transform 0.1s;
}

.neo-btn {
    background: var(--neo-yellow);
    border: var(--border-width) solid var(--neo-black);
    box-shadow: 4px 4px 0px var(--neo-black);
    padding: 12px 24px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--neo-black);
}

.neo-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0px var(--neo-black);
}

.neo-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--neo-black);
}

.neo-btn.secondary {
    background: var(--neo-blue);
}

.neo-btn.danger {
    background: var(--neo-pink);
}

.neo-btn.success {
    background: var(--neo-green);
}

/* --- LAYOUT --- */

.navbar {
    width: 100%;
    max-width: 800px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.brand-badge {
    background: var(--neo-black);
    color: var(--neo-white);
    padding: 5px 15px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    transform: rotate(-3deg);
}

.main-container {
    width: 100%;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.hero-section {
    text-align: center;
}

h1 {
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 3px 3px 0px var(--neo-pink);
}

.subtitle {
    font-family: 'Space Mono', monospace;
    background: var(--neo-green);
    display: inline-block;
    padding: 5px 10px;
    border: 2px solid var(--neo-black);
    font-weight: 700;
}

/* --- INPUT SECTION --- */

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 30px;
    background: #fff;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

/* Gradient Overlay */
.input-wrapper::after {
    content: '';
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 80px;
    background: linear-gradient(90deg, transparent 0%, #f4f4f4 70%);
    pointer-events: none;
    z-index: 1;
    transition: background 0.2s;
}

.input-wrapper:focus-within::after {
    background: linear-gradient(90deg, transparent 0%, #fff 70%);
}

input[type="text"] {
    width: 100%;
    /* Padding kanan ditambah dikit buat tombol X */
    padding: 15px 85px 15px 20px;
    border: var(--border-width) solid var(--neo-black);
    font-size: 1.1rem;
    font-family: 'Space Mono', monospace;
    outline: none;
    background: #f4f4f4;
    transition: 0.2s;
}

input[type="text"]:focus {
    background: #fff;
    box-shadow: 5px 5px 0px var(--neo-pink);
}

.paste-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    font-weight: bold;
    cursor: pointer;
    text-decoration: underline;
    z-index: 2;
}

/* Tombol Clear (X) */
.clear-btn {
    position: absolute;
    right: 60px; /* Di sebelah kiri tombol Paste */
    top: 50%;
    transform: translateY(-50%);
    background: #ccc;
    border: 2px solid #000;
    color: #000;
    width: 20px;
    height: 20px;
    display: none; /* Hidden default */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    z-index: 3; /* Paling atas */
    border-radius: 50%;
    transition: all 0.2s;
}

.clear-btn:hover {
    background: var(--neo-pink);
    transform: translateY(-50%) scale(1.1);
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.download-btn {
    flex: 1;
    justify-content: center;
    font-size: 1.2rem;
}

/* --- PLATFORM ICONS --- */
.platforms {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px; /* Jarak ditambah agar tidak menumpuk */
    flex-wrap: wrap;
}

.p-icon {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid var(--neo-black);
    font-size: 1.2rem;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 1;
}

/* State: Active (Highlight) */
.p-icon.active {
    transform: translateY(-10px) scale(1.2);
    box-shadow: 0 10px 0 var(--neo-black);
    z-index: 10;
    border-color: #000;
}

/* State: Dimmed (Meredup) */
.p-icon.dimmed {
    opacity: 0.3;
    transform: scale(0.9);
    filter: grayscale(100%);
}

.p-icon:hover {
    transform: translateY(-3px);
    box-shadow: 3px 3px 0 #000;
    opacity: 1;
    filter: none;
}

.p-icon.tiktok {
    background: #000;
    color: #fff;
}

.p-icon.instagram {
    background: #E1306C;
    color: #fff;
}

.p-icon.youtube {
    background: #FF0000;
    color: #fff;
}

.p-icon.facebook {
    background: #1877F2;
    color: #fff;
}

.p-icon.spotify {
    background: #1DB954;
    color: #fff;
}

.p-icon.twitter {
    background: #000;
    color: #fff;
}

.p-icon.capcut {
    background: #ff99c8;
    color: #000;
}

/* Neo Pink for CapCut */
.p-icon.snackvideo {
    background: #F7D117;
    color: #000;
}

/* Yellow */
.p-icon.douyin {
    background: #000;
    color: #9eeaf9;
}

/* Black with Neo Blue icon */

/* --- RESULT SECTION --- */
#result-container {
    display: none;
    padding: 0;
    overflow: hidden;
    animation: slideUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* --- PLAYLIST SECTION --- */
#playlist-container {
    display: none;
    width: 100%;
}

.playlist-header {
    background: var(--neo-black);
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #000;
}

.playlist-list {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid #000;
    border-top: none;
    background: #fff;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 2px solid #eee;
    gap: 15px;
    transition: background 0.2s;
}

.playlist-item:hover {
    background: #f0f0f0;
}

.playlist-item:last-child {
    border-bottom: none;
}

.p-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--neo-black);
}

.p-thumb {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border: 1px solid #000;
}

.p-info {
    flex: 1;
}

.p-title {
    font-weight: 700;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.p-meta {
    font-size: 0.8rem;
    color: #666;
    font-family: 'Space Mono', monospace;
}

.batch-controls {
    margin-top: 15px;
    padding: 15px;
    background: var(--neo-white);
    border: var(--border-width) solid var(--neo-black);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0px var(--neo-black);
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.select-all-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
    margin-right: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-header {
    background: var(--neo-black);
    color: #fff;
    padding: 10px 20px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-body {
    padding: 20px;
    display: flex;
    gap: 20px;
    flex-direction: column;
}

.media-preview {
    width: 100%;
    height: 200px;
    background: #000;
    border: 2px solid #000;
    object-fit: cover;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

.info-details h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.download-options {
    display: grid;
    gap: 10px;
    margin-top: 15px;
}

.dl-option {
    width: 100%;
    justify-content: space-between;
}

/* --- LOADER --- */
#loader {
    display: none;
    text-align: center;
    padding: 20px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: 1.2rem;
    background: var(--neo-yellow);
    border: 3px solid #000;
    margin-top: 20px;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from {
        transform: scale(0.98);
    }

    to {
        transform: scale(1.02);
    }
}

/* Status Modal */
.status-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    color: #fff;
}

.status-box {
    background: var(--neo-yellow);
    color: #000;
    padding: 20px;
    border: 3px solid #000;
    box-shadow: 10px 10px 0 #fff;
    text-align: center;
    max-width: 90%;
    width: 400px;
}

/* Mobile Responsive */
@media (min-width: 600px) {
    .result-body {
        flex-direction: row;
    }

    .media-preview {
        width: 150px;
        height: 150px;
        flex-shrink: 0;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 2.2rem;
    }

    .neo-btn {
        width: 100%;
    }

    .navbar .neo-btn {
        width: auto;
        font-size: 0.8rem;
        padding: 10px 16px;
    }

    .brand-badge {
        font-size: 0.85rem;
        padding: 5px 10px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .batch-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .select-all-wrap {
        margin-bottom: 10px;
    }
}

/* --- SWEETALERT NEO BRUTALISM --- */
div:where(.swal2-container) div:where(.swal2-popup) {
    border: 3px solid #000 !important;
    box-shadow: 10px 10px 0 #000 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: #000 !important;
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm {
    background-color: var(--neo-green) !important;
    color: #000 !important;
    border: 3px solid #000 !important;
    border-radius: 0 !important;
    box-shadow: 4px 4px 0 #000 !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    padding: 10px 24px !important;
    font-family: 'Lexend', sans-serif !important;
    outline: none !important;
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000 !important;
    background-color: var(--neo-green) !important;
}

div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000 !important;
}

div:where(.swal2-icon) {
    border-color: #000 !important;
    color: #000 !important;
}