/* Custom Styles untuk Aplikasi Google Sheets */

/* Root font size for consistent sizing */
:root {
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-h1: 2rem;
    --font-size-h4: 1.1rem;
    --font-size-nav: 0.95rem;
    --font-size-table: 0.9rem;
    --font-size-table-header: 0.85rem;
    --font-size-nip: 0.85rem;
    --font-size-search: 0.95rem;
}

body {
    background-color: #f8f9fa;
    min-height: 100vh;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
}

.container {
    max-width: 1600px;
}

h1 {
    color: #2c3e50;
    font-weight: 700;
    font-size: var(--font-size-h1);
}

h4 {
    color: #6c757d;
    font-weight: 400;
    font-size: var(--font-size-h4);
}

/* Info Card Styles */
.info-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.info-card.pns {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.info-card.pppk {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

.info-card h5 {
    margin-bottom: 5px;
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 600;
}

.info-card h4 {
    color: white;
    font-weight: 600;
    font-family: var(--font-family);
    font-size: 1.25rem;
}

/* Tab Styles */
.nav-tabs .nav-link {
    font-family: var(--font-family);
    font-weight: 600;
    padding: 14px 28px;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    background-color: transparent;
    transition: all 0.3s ease;
    font-size: var(--font-size-nav);
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

.nav-tabs .nav-link.active {
    background-color: transparent;
    border: none;
    border-bottom: 3px solid #0d6efd;
    color: #0d6efd;
}

.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

/* Table Styles */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
    font-size: var(--font-size-table);
    font-family: var(--font-family);
}

.table thead th {
    background-color: #2c3e50;
    color: white;
    font-weight: 600;
    padding: 14px 12px;
    text-align: left;
    border: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: var(--font-size-table-header);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 12px;
    vertical-align: middle;
    border-color: #e9ecef;
    font-family: var(--font-family);
    font-size: var(--font-size-table);
    font-weight: 400;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
    transition: background-color 0.2s ease;
}

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Custom Scrollbar for Table Responsive */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* NIP Column Styles */
.nip-cell {
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-nip);
    color: #0d6efd;
    font-weight: 400;
    white-space: nowrap;
}

/* Nama Column Styles */
.nama-cell {
    font-weight: 400;
    color: #212529;
    min-width: 200px;
}

/* Search Input Styles */
#searchPNS,
#searchPPPK {
    border-radius: 8px;
    padding: 14px 18px;
    border: 2px solid #dee2e6;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-size: var(--font-size-search);
    font-family: var(--font-family);
}

#searchPNS:focus,
#searchPPPK:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

/* Text Styles */
.text-muted {
    font-family: var(--font-family);
    font-size: 0.9rem;
}

.fw-bold {
    font-weight: 600 !important;
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive adjustments */
@media (max-width: 992px) {
    :root {
        --font-size-h1: 1.8rem;
        --font-size-h4: 1rem;
    }
    
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 10px 8px;
    }
    
    .nav-tabs .nav-link {
        padding: 12px 18px;
        font-size: 0.9rem;
    }
    
    .info-card {
        padding: 15px;
    }
    
    .info-card h4 {
        font-size: 1.1rem;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-h1: 1.6rem;
        --font-size-h4: 0.95rem;
    }
    
    h1 {
        font-size: var(--font-size-h1);
    }
    
    h4 {
        font-size: var(--font-size-h4);
    }
    
    .container {
        padding: 0 10px;
    }
    
    .mt-5 {
        margin-top: 1.5rem !important;
    }
    
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .info-card {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .info-card h5 {
        font-size: 1rem;
    }
    
    .info-card h4 {
        font-size: 1rem;
    }
    
    .info-card p {
        font-size: 0.85rem;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 8px 6px;
    }
}

@media (max-width: 576px) {
    :root {
        --font-size-h1: 1.4rem;
        --font-size-h4: 0.95rem;
    }
    
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 8px;
    }
    
    .mt-5 {
        margin-top: 1rem !important;
    }
    
    .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    h1 {
        font-size: var(--font-size-h1);
        margin-bottom: 0.5rem !important;
    }
    
    h4 {
        font-size: var(--font-size-h4);
        margin-bottom: 0.75rem !important;
    }
    
    /* Horizontal scroll for nav tabs on mobile */
    .nav-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .nav-tabs::-webkit-scrollbar {
        height: 4px;
    }
    
    .nav-tabs::-webkit-scrollbar-thumb {
        background-color: #dee2e6;
        border-radius: 4px;
    }
    
    .nav-tabs .nav-link {
        padding: 10px 14px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex: 0 0 auto;
    }
    
    /* Info cards */
    .info-card {
        padding: 10px;
        border-radius: 8px;
    }
    
    .info-card .row {
        flex-direction: column;
    }
    
    .info-card .col-md-6 {
        text-align: left !important;
        margin-bottom: 5px;
    }
    
    .info-card h4 {
        margin-top: 5px;
    }
    
    /* Search inputs */
    #searchPNS,
    #searchPPPK {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    /* Table responsive */
    .table-responsive {
        max-height: 50vh;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 6px 5px;
    }
    
    /* Tab content */
    .tab-content {
        padding: 12px;
        border-radius: 6px;
    }
    
    /* Last update text */
    .text-center.mt-4 p {
        font-size: 0.75rem;
    }
}

/* Additional visual enhancements */
.tab-pane {
    padding-top: 20px;
    animation: fadeIn 0.3s ease;
}

.tab-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

/* No data message */
.text-center.text-warning {
    color: #ffc107 !important;
    font-weight: 500;
    padding: 20px;
}

.text-center.text-danger {
    color: #dc3545 !important;
    font-weight: 500;
    padding: 20px;
}

/* Number column */
.table td:first-child,
.table th:first-child {
    text-align: center;
    width: 50px;
    font-weight: 400;
    color: #6c757d;
}

/* Row striping improvement */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Table Column width adjustments for proportional data display */
.table {
    table-layout: auto;
    width: 100%;
    word-wrap: break-word;
}

/* Pie Chart Styles */
.chart-card {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.chart-card .card-body {
    padding: 25px;
}

.chart-card .card-title {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
}

.chart-container {
    position: relative;
    max-width: 300px;
    margin: 0 auto;
    height: 250px;
}

.chart-legend {
    font-family: var(--font-family);
    font-size: 0.95rem;
    color: #495057;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    margin-right: 15px;
    margin-bottom: 8px;
}

.legend-color {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    margin-right: 8px;
    vertical-align: middle;
}

.pns-color {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.pppk-color {
    background: linear-gradient(135deg, #ee0979 0%, #ff6a00 100%);
}

/* Responsive Chart Styles */
@media (max-width: 768px) {
    .chart-container {
        max-width: 250px;
        height: 200px;
    }
    
    .chart-card .card-body {
        padding: 20px 15px;
    }
    
    .chart-legend {
        font-size: 0.85rem;
    }
    
    .legend-item {
        margin-right: 10px;
    }
}

@media (max-width: 480px) {
    .chart-container {
        max-width: 200px;
        height: 180px;
    }
    
    .chart-card .card-title {
        font-size: 1rem;
    }
    
    .chart-legend {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .legend-item {
        margin-right: 0;
        margin-bottom: 8px;
    }
}

