/* Global CSS - Sistem Pendataan Desa */
:root {
    --primary-color: #112D4E;
    --secondary-color: #3F72AF;
    --light-color: #DBE2EF;
    --lightest-color: #F9F7F7;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
}

[data-theme="dark"] {
    --primary-color: #1a365d;
    --secondary-color: #2d5a87;
    --light-color: #2d3748;
    --lightest-color: #1a202c;
    --text-dark: #e2e8f0;
    --text-light: #a0aec0;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --info: #4299e1;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--lightest-color);
    color: var(--text-dark);
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--lightest-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Content Loader */
.content-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .content-loader {
    background: rgba(26, 32, 44, 0.8);
}

.content-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

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

/* Cards */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: none;
    height: auto;
}

[data-theme="dark"] .card {
    background: var(--light-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

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

.btn-primary:hover {
    background: #0d1f35;
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: #2d5a87;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(17, 45, 78, 0.1);
}

[data-theme="dark"] .form-control {
    background: var(--light-color);
    border-color: #4a5568;
    color: var(--text-dark);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--light-color);
    font-size: 14px;
}

.table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.table tbody tr:hover {
    background: var(--lightest-color);
}

[data-theme="dark"] .table {
    background: var(--light-color);
}

[data-theme="dark"] .table tbody tr:hover {
    background: #2d3748;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 6px 8px;
        font-size: 10px;
    }
    
    .table th {
        font-size: 10px;
        font-weight: 700;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .card {
        padding: 12px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 5px 6px;
        font-size: 8px;
    }
    
    .table th {
        font-size: 8px;
    }
}

@media (max-width: 360px) {
    .table th,
    .table td {
        padding: 5px 5px;
        font-size: 8px;
    }
    
    .table th {
        font-size: 7px;
    }
}

/* Text Muted */
.text-muted {
    color: var(--text-light);
    font-size: 14px;
}

@media (max-width: 768px) {
    .text-muted {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .text-muted {
        font-size: 8px;
    }
}

@media (max-width: 360px) {
    .text-muted {
        font-size: 8px;
    }
}