:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --info-color: #1abc9c;
    --border-radius: 8px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    text-align: center;
}

header h1 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 500px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

#refresh-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

#refresh-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.summary-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    color: var(--dark-color);
}

.spinner {
    border: 3px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top: 3px solid var(--primary-color);
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.total {
    font-size: 0.9rem;
    color: var(--dark-color);
    line-height: 1.6;
    padding: 10px 0;
}

.total strong {
    color: var(--accent-color);
}

.table-responsive {
    overflow-x: auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    max-height: 70vh; /* Tambahkan tinggi maksimum */
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10; /* Pastikan header di atas konten lain */
}

tbody {
    display: block;
    overflow-y: auto;
    max-height: calc(70vh - 60px); /* Sesuaikan dengan tinggi header */
}

thead, tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 150;
}

tr:hover {
    background-color: #f8f9fa;
}

td {
    overflow: hidden;
    text-overflow: ellipsis;
}

footer {
    text-align: center;
    padding: 20px;
    color: #777;
    font-size: 0.9rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    #refresh-btn {
        width: 100%;
        justify-content: center;
    }
    
    th, td {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    
    .total {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 15px;
    }
    
    .summary-card {
        padding: 15px;
    }
    
    th, td {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}
