:root {
    --primary: #d32f2f;
    --primary-hover: #b71c1c;
    --bg: #0f0f0f;
    --card-bg: #1e1e1e;
    --text: #e0e0e0;
    --text-dim: #a0a0a0;
    --border: #333;
    --wa-color: #25D366;
    --wa-hover: #1da851;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* HEADER */
header {
    background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
    padding: 30px 20px;
    text-align: center;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

header h1 {
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 900;
}

header h1 span {
    color: var(--primary);
    text-shadow: 0 0 15px rgba(211,47,47,0.4);
}

header p {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* NAV */
.main-nav {
    display: flex;
    justify-content: center;
    background: #161616;
    padding: 10px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(255,255,255,0.05);
}

.nav-item.active {
    color: white;
    background: var(--primary);
}

/* CONTAINER */
.container {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 15px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* INPUTS & BUTTONS */
.input {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid var(--border);
    color: white;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.input:focus {
    border-color: var(--primary);
}

.btn {
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211,47,47,0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--text);
}

.btn-wa {
    background: var(--wa-color);
    color: white;
    width: 100%;
}

.btn-wa:hover {
    background: var(--wa-hover);
}

.w-full { width: 100%; }
.mt-4 { margin-top: 1.5rem; }
.mt-2 { margin-top: 0.8rem; }

/* SEARCH & FILTERS */
.search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.filter-group {
    background: #2a2a2a;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #444;
}

.filter-group.active {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(211,47,47,0.2);
}

.filter-label {
    background: #333;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 5px 10px;
    color: #888;
    text-transform: uppercase;
}

.filter-group.active .filter-label {
    background: var(--primary);
    color: white;
}

.filter-select {
    width: 100%;
    background: #2a2a2a; /* Latar belakang solid */
    border: none;
    color: #ffffff;
    padding: 8px 10px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.filter-select option {
    background: #2a2a2a; /* Pastikan opsi juga gelap */
    color: white;
}

/* RESULTS */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.font-card {
    background: linear-gradient(145deg, #1e1e1e, #161616);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    position: relative;
    overflow: hidden;
}

.font-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255,215,0,0.03), transparent);
    transform: translateX(-100%);
    transition: 0.6s;
}

.font-card:hover {
    border-color: #ffd700;
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(255,215,0,0.1);
}

.font-card:hover::before {
    transform: translateX(100%);
}

.font-name {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.font-img {
    max-width: 100%;
    max-height: 70px;
    filter: invert(1) brightness(1.5) contrast(1.2);
    mix-blend-mode: lighten; /* Menghilangkan background hitam jika ada */
    transition: transform 0.3s;
}

.font-card:hover .font-img {
    transform: scale(1.05);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-dim);
}

.big-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-bottom: 40px;
}

/* UPSCALER TOOLS */
.form-row {
    display: flex;
    gap: 15px;
}

.form-group {
    flex: 1;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dim);
}

.status-box {
    background: #1a1a1a;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: monospace;
    font-size: 0.9rem;
    text-align: center;
}

.progress-bar {
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-inner {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s;
}

.preview-img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* ADMIN TABLE */
.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    color: var(--text-dim);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.admin-table td img {
    max-height: 30px;
    filter: invert(1) brightness(2);
}

.btn-delete {
    color: #ff4444;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: #1a1a1a;
    width: 90%;
    max-width: 500px;
    padding: 35px;
    border-radius: 24px;
    position: relative;
    border: 1px solid #333;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}

#modalFontName {
    font-size: 0.8rem !important;
    color: #888 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-bottom: 20px !important;
    text-align: left !important;
    font-weight: 600 !important;
}

.modal-preview-box {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.modal-preview-box img {
    max-width: 100%;
    height: auto;
}

.modal-tip {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
    margin-bottom: 25px;
}

/* MOBILE RESPONSIVE */
@media (max-width: 600px) {
    header h1 { font-size: 1.8rem; }
    .search-row { flex-direction: column; }
    .form-row { flex-direction: column; gap: 0; }
    .nav-item { padding: 10px; font-size: 0.8rem; }
    .results-grid { grid-template-columns: 1fr 1fr; }
    .filters-grid { grid-template-columns: repeat(3, 1fr); }
}
