@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;700&family=Inter:wght@400;700;900&display=swap');

:root {
    --font-hand: 'Caveat', cursive;
    --font-ui: 'Inter', sans-serif;
    --black: #000000;
    --white: #ffffff;
    --border-thick: 3px solid var(--black);
    --border-thin: 1px solid var(--black);
    --shadow-hard: 6px 6px 0px var(--black); /* Bayangan kotak keras */
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--white);
    color: var(--black);
    font-family: var(--font-ui);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* --- HEADER YANG TEGAS --- */
header {
    border-bottom: var(--border-thick);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: var(--font-ui);
    font-weight: 900; /* Tebal sekali */
    font-size: 1.5rem;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--black);
    letter-spacing: -1px;
    border: 2px solid var(--black);
    padding: 5px 10px;
    background: var(--black);
    color: var(--white); /* Logo inverted */
}

nav a {
    font-family: var(--font-ui);
    font-weight: 700;
    text-decoration: none;
    color: var(--black);
    margin-left: 20px;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
}

nav a:hover {
    border-bottom: 2px solid var(--black);
}

/* --- CONTAINER UTAMA --- */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

/* --- TOMBOL & FORM GAYA BRUTAL --- */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

input, textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--black);
    background: var(--white);
    font-family: var(--font-ui);
    font-size: 1rem;
    border-radius: 0; /* Sudut tajam */
    transition: all 0.2s;
}

input:focus, textarea:focus {
    outline: none;
    background: #f0f0f0;
    box-shadow: 4px 4px 0px var(--black);
}

textarea {
    font-family: var(--font-hand); /* Font tulis tangan */
    font-size: 1.8rem;
}

button {
    width: 100%;
    padding: 18px;
    background: var(--black);
    color: var(--white);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px solid var(--black);
    cursor: pointer;
    border-radius: 0;
    position: relative;
    top: 0;
    transition: all 0.2s;
}

button:hover {
    background: var(--white);
    color: var(--black);
    box-shadow: var(--shadow-hard);
    transform: translate(-2px, -2px);
}

/* --- STYLE DETAIL PESAN (GAYA KERTAS/SURAT) --- */
.paper-container {
    border: var(--border-thick);
    padding: 0;
    background: var(--white);
    box-shadow: var(--shadow-hard);
    display: flex;
    flex-direction: column;
}

.track-info {
    border-bottom: var(--border-thick);
    padding: 20px;
    background: #f4f4f4;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.track-label {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.2rem;
}

/* Filter Spotify jadi Hitam Putih */
.spotify-filter {
    filter: grayscale(100%) contrast(1.2);
    border-top: var(--border-thick);
}

.message-area {
    padding: 30px;
    min-height: 300px;
    background-image: linear-gradient(#cfcfcf 1px, transparent 1px);
    background-size: 100% 40px; /* Garis-garis buku tulis */
    line-height: 40px; /* Samakan dengan background size */
}

.recipient-title {
    font-family: var(--font-hand);
    font-size: 2.5rem;
    margin: 0 0 20px 0;
    line-height: 1;
}

.handwriting-text {
    font-family: var(--font-hand);
    font-size: 2rem;
    line-height: 40px; /* Agar pas di garis */
    margin-top: 0;
}

/* --- GRID JELAJAH --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    border: 2px solid var(--black);
    padding: 15px;
    text-decoration: none;
    color: var(--black);
    display: block;
    background: var(--white);
    transition: 0.2s;
    position: relative;
}

.card:hover {
    background: var(--black);
    color: var(--white);
    box-shadow: 5px 5px 0px #888;
    transform: translate(-3px, -3px);
}

.card-to {
    font-family: var(--font-ui);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    border-bottom: 1px solid currentColor;
    padding-bottom: 5px;
    margin-bottom: 10px;
    display: block;
}

.card-msg {
    font-family: var(--font-hand);
    font-size: 1.4rem;
    line-height: 1.2;
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .container { margin: 20px auto; }
    .paper-container { box-shadow: 4px 4px 0px var(--black); }
    .recipient-title { font-size: 2rem; }
    .handwriting-text { font-size: 1.6rem; }
    
    /* Di HP, tata letak track info stack ke bawah */
    .track-info { flex-direction: column; align-items: flex-start; gap: 10px; }
}
/* --- SEARCH DROPDOWN --- */
.search-results {
    position: absolute;
    width: 100%;
    background: white;
    border: 2px solid black;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
    display: none; /* Sembunyi default */
    box-shadow: 4px 4px 0px rgba(0,0,0,0.2);
}

.result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.result-item:hover {
    background: #f0f0f0;
}

.result-item img {
    border: 1px solid black;
}

.song-preview {
    border: 2px solid black;
    padding: 10px;
    background: #f9f9f9;
    margin-top: 5px;
}
/* --- MARQUEE (Running Text) --- */
.marquee-container {
    width: 100%;
    overflow: hidden;
    background: var(--black);
    color: var(--white);
    border-bottom: var(--border-thick);
    padding: 10px 0;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    font-family: var(--font-ui);
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
    animation: marquee 20s linear infinite; /* Animasi berjalan */
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* --- HERO SECTION --- */
.hero-section {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 0;
    border-bottom: var(--border-thick);
}

.hero-title {
    font-family: var(--font-ui);
    font-size: 4rem; /* Sangat Besar */
    font-weight: 900;
    margin: 0;
    line-height: 1;
    letter-spacing: -2px;
}

.hero-subtitle {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 10px;
    text-transform: uppercase;
    background: var(--black);
    color: var(--white);
    display: inline-block;
    padding: 5px 15px;
}

/* --- ACTION BAR (Search & Random) --- */
.action-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-form {
    flex: 1;
    display: flex;
    gap: 0; /* Nempel */
}

.search-form input {
    flex: 1;
    border: 2px solid var(--black);
    border-right: none;
    padding: 15px;
    font-weight: bold;
}

.search-form button {
    width: auto;
    padding: 0 30px;
    border: 2px solid var(--black);
}

.btn-random {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 2px solid var(--black);
    text-decoration: none;
    color: var(--black);
    font-weight: 900;
    background: #e0e0e0; /* Sedikit abu-abu */
    transition: 0.2s;
    text-transform: uppercase;
}

.btn-random:hover {
    background: var(--black);
    color: var(--white);
    box-shadow: 4px 4px 0px var(--black);
    transform: translate(-2px, -2px);
}

/* --- CARD UPDATES --- */
.card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
}

.card-header {
    border-bottom: 1px solid var(--black);
    padding-bottom: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    font-weight: 900;
    color: #555;
}

.card-body {
    flex: 1;
}

.card-footer {
    margin-top: 15px;
    font-size: 0.8rem;
    font-weight: 900;
    text-align: right;
    text-decoration: underline;
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 600px) {
    .hero-title { font-size: 2.5rem; }
    .action-bar { flex-direction: column; }
    .search-form button { width: 100px; }
    .btn-random { padding: 15px; width: 100%; }
}
/* --- TAMBAHAN BARU: HERO PATTERN --- */
.hero-pattern {
    /* Membuat efek kertas bintik-bintik (Polkadot halus) */
    background-image: radial-gradient(#000 1px, transparent 1px);
    background-size: 20px 20px; /* Jarak antar titik */
    background-color: #f4f4f4;
    border: 3px solid black; /* Kotak tegas mengelilingi hero */
    margin-bottom: 30px;
    padding: 60px 20px; /* Padding lebih besar */
}

/* Update text Hero agar lebih enak dibaca di atas pattern */
.hero-subtitle {
    background: black;
    color: white;
    display: inline-block;
    padding: 10px 20px;
    line-height: 1.6;
    margin-top: 20px;
    transform: rotate(-1deg); /* Sedikit miring biar artsy */
}

/* --- UPDATE TAMPILAN KARTU (CARD) --- */
.card {
    border: 3px solid black; /* Border lebih tebal */
    box-shadow: 5px 5px 0px rgba(0,0,0,0.1);
    transition: all 0.2s;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 8px 8px 0px black; /* Shadow hitam solid saat hover */
}

.card-status {
    background: black;
    color: white;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 0.8rem;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-to {
    font-weight: 900;
    font-size: 1.1rem;
    text-transform: uppercase;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.card-msg {
    font-family: var(--font-hand); /* Pakai font tulisan tangan untuk isinya */
    font-size: 1.4rem;
    line-height: 1.2;
    color: #333;
    margin: 0;
}
/* --- SHARE SECTION (BRUTALIST STYLE) --- */
.share-container {
    margin-top: 30px;
    border-top: 3px solid black; /* Garis pemisah tebal */
    padding-top: 20px;
    text-align: center;
}

.share-title {
    font-family: var(--font-ui);
    font-weight: 900;
    font-size: 0.9rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.share-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 Tombol sejajar */
    gap: 10px;
}

.btn-share {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border: 2px solid black;
    background: white;
    color: black;
    font-weight: 900;
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.2s;
}

.btn-share:hover {
    background: black;
    color: white;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.3);
    transform: translate(-2px, -2px);
}

/* Responsif: Di HP tombol jadi turun ke bawah biar gampang dipencet */
@media (max-width: 480px) {
    .share-grid {
        grid-template-columns: 1fr; /* 1 Kolom ke bawah */
    }
}