:root {
    --primary: #4facfe;
    --primary-glow: rgba(79, 172, 254, 0.5);
    --secondary: #00f2fe;
    --bg-dark: #0a0c10;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background Animations */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: move 20s infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    bottom: -150px;
    right: -150px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #7c3aed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 15s;
}

@keyframes move {
    from { transform: translate(0, 0); }
    to { transform: translate(50px, 100px) scale(1.1); }
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.hero {
    text-align: center;
    margin-bottom: 4rem;
}

.gradient-text {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Glass Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Form Styles */
.search-form {
    width: 100%;
}

.input-group {
    display: flex;
    gap: 1rem;
}

input[type="text"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

button {
    cursor: pointer;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

#submitBtn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 1rem 2.5rem;
    min-width: 180px;
}

#submitBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px var(--primary);
}

#submitBtn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Table Styles */
.results-section {
    margin-top: 3rem;
    animation: fadeInUp 0.6s ease-out forwards;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.filter-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

#typeFilter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 150px;
}

#typeFilter:focus {
    border-color: var(--primary);
}

#typeFilter option {
    background: var(--bg-dark);
    color: var(--text-main);
}

.table-container {
    overflow: hidden;
}

.responsive-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    font-weight: 600;
    color: var(--primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.95rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

/* Skeleton Loader */
.skeleton-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-row {
    height: 45px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-row.header {
    height: 55px;
    opacity: 0.5;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Transitions */
.hidden {
    display: none !important;
}

.status-message {
    text-align: center;
    margin-top: 1.5rem;
    font-weight: 500;
}

.error-text {
    color: var(--error);
}

/* Responsive */
@media (max-width: 768px) {
    .container { 
        padding: 1rem 0; 
        max-width: 100%;
    }
    
    .hero {
        padding: 0 1.5rem;
    }

    .search-section {
        padding: 0 1rem;
    }

    .gradient-text { font-size: 2.2rem; }
    
    .input-group { flex-direction: column; }
    #submitBtn { width: 100%; }

    /* Tabel Tanpa Pinggiran di Mobile */
    .results-section {
        margin-top: 2rem;
    }

    /* Efek Search Box ke Atas (Sticky) saat hasil aktif */
    .results-active .hero {
        display: none;
    }

    .results-active .search-section {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 0.5rem 0;
        background: var(--bg-dark);
        border-bottom: 1px solid var(--border-color);
    }

    .results-active .search-section .glass-card {
        padding: 0.8rem;
        border-radius: 0;
        border: none;
        background: rgba(0, 0, 0, 0.4);
    }

    .results-active .input-group {
        flex-direction: row;
        gap: 0.5rem;
    }

    .results-active input[type="text"] {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .results-active #submitBtn {
        width: auto;
        padding: 0.6rem 1.2rem;
        min-width: 100px;
    }

    .results-active #submitBtn .btn-text {
        font-size: 0.9rem;
    }

    .results-section .glass-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 1.5rem 1rem;
    }

    .table-header {
        padding: 0 0.5rem;
    }

    td, th {
        padding: 0.8rem 0.5rem;
        font-size: 0.85rem;
    }
}
