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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 300;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card.active {
    border-color: #3498db;
    background-color: #e8f4f8;
}

.card h3 {
    color: #7f8c8d;
    font-size: 1rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card .count {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

#tercatat .count { color: #34495e; }
#terdaftar .count { color: #f39c12; }
#tersertifikasi .count { color: #27ae60; }

.chart-section {
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chart-container h2 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

#provinceChart {
    max-height: 400px;
    width: 100%;
}

.filters {
    margin-bottom: 30px;
}

.filter-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.filter-group input,
.filter-group select {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    background-color: white;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.filter-group select {
    cursor: pointer;
}

.table-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    position: sticky;
    top: 0;
}

th:first-child {
    text-align: center;
}

tbody tr {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

tbody tr.tersertifikasi-row {
    background-color: rgba(39, 174, 96, 0.1);
}

tbody tr.tersertifikasi-row:hover {
    background-color: rgba(39, 174, 96, 0.2);
}

.pagination {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
}

.pagination button {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#page-info {
    font-weight: 500;
    color: #7f8c8d;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-teregistrasi { background-color: #fff3cd; color: #856404; }
.status-terverifikasi { background-color: #d4edda; color: #155724; }
.status-tersertifikasi { background-color: #f8d7da; color: #721c24; }

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: block;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

#modal-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 16px;
}

#modal-content {
    display: none;
}

#modal-content h3 {
    color: #2c3e50;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #3498db;
    font-size: 1.2rem;
    font-weight: 600;
}

#modal-content h3:first-child {
    margin-top: 0;
}

#modal-content h4 {
    color: #495057;
    margin: 20px 0 10px 0;
    font-size: 1rem;
    font-weight: 600;
    border-left: 3px solid #3498db;
    padding-left: 12px;
}

.long-content {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    line-height: 1.6;
    color: #495057;
}

.array-item {
    margin-bottom: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    overflow: hidden;
}

.modal-table th,
.modal-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

.modal-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    width: 30%;
    min-width: 120px;
}

.modal-table td {
    color: #212529;
    word-wrap: break-word;
    max-width: 0;
}

.modal-table tr:last-child th,
.modal-table tr:last-child td {
    border-bottom: none;
}

.modal-table tr:hover {
    background-color: #f8f9fa;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-group {
        grid-template-columns: 1fr;
    }

    th, td {
        padding: 10px 8px;
        font-size: 14px;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
        max-height: 85vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-body {
        padding: 20px;
        max-height: 65vh;
    }

    .modal-table th,
    .modal-table td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .modal-table th {
        width: 35%;
        min-width: 100px;
    }
}

/* Perda Dot Styles */
.perda-cell {
    text-align: center;
    position: relative;
}

.perda-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    position: relative;
    cursor: help;
}

.perda-dot.green {
    background-color: #27ae60;
    animation: pulse-green 2s infinite;
}

.perda-dot.grey {
    background-color: #f39c12;
    animation: pulse-yellow 2s infinite;
}

.perda-dot.green::after {
    content: 'Memiliki Perda';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10000;
}

.perda-dot.grey::after {
    content: 'Belum memiliki Perda';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10000;
}

.perda-dot:hover::after {
    opacity: 1;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(39, 174, 96, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(39, 174, 96, 0);
    }
}

@keyframes pulse-yellow {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(243, 156, 18, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0);
    }
}