/* Reset dan Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--gray-800);
}

.hidden {
    display: none !important;
}

/* Modal Login */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-header h2 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.8em;
}

.login-header p {
    color: var(--gray-600);
    font-size: 1.1em;
}

/* Main Application */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 25px 30px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-title h1 {
    font-size: 2.2em;
    margin-bottom: 5px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}

.tab-button {
    flex: 1;
    padding: 20px;
    border: none;
    background: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    color: var(--gray-600);
    min-width: 200px;
}

.tab-button:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.tab-button.active {
    background: white;
    border-bottom-color: var(--primary-light);
    color: var(--primary);
}

.tab-button i {
    margin-right: 8px;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

/* Form Sections */
.form-section {
    margin-bottom: 40px;
}

.form-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-left: 4px solid var(--primary-light);
    padding-left: 15px;
    font-weight: 600;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-size: 0.95em;
}

.form-control {
    padding: 12px 15px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Rubrik Styles */
.komponen-group {
    background: var(--gray-50);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary);
}

.komponen-group h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

.indikator-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid var(--gray-200);
    transition: transform 0.2s ease;
}

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

.indikator-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 15px;
}

.indikator-header h4 {
    color: var(--gray-800);
    flex: 1;
    font-size: 1.1em;
    font-weight: 500;
    line-height: 1.4;
}

.skor-display {
    background: var(--gray-400);
    color: white;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85em;
    min-width: 80px;
    text-align: center;
}

.skor-display.skor-4 { background: var(--success); }
.skor-display.skor-3 { background: var(--primary-light); }
.skor-display.skor-2 { background: var(--warning); }
.skor-display.skor-1 { background: var(--danger); }

.checklist-group {
    display: grid;
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 6px;
    transition: background 0.3s ease;
    cursor: pointer;
}

.checklist-item:hover {
    background: var(--gray-100);
}

.checklist-item input[type="checkbox"] {
    margin-top: 2px;
    transform: scale(1.2);
    cursor: pointer;
}

.checklist-item label {
    font-weight: normal;
    margin: 0;
    line-height: 1.5;
    cursor: pointer;
    color: var(--gray-700);
    flex: 1;
}

/* Analisis Section */
.analisis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.analisis-group {
    background: var(--gray-50);
    padding: 25px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}

.analisis-group h3 {
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 1.2em;
}

.analisis-group h3 i {
    margin-right: 8px;
}

.analisis-group h3 .success { color: var(--success); }
.analisis-group h3 .primary { color: var(--primary-light); }

.analisis-desc {
    color: var(--gray-600);
    margin-bottom: 15px;
    font-style: italic;
    font-size: 0.9em;
}

.analisis-textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.analisis-textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Laporan Preview */
.laporan-preview {
    background: var(--gray-50);
    padding: 30px;
    border-radius: 10px;
    min-height: 500px;
    border: 2px dashed var(--gray-300);
    margin-bottom: 20px;
}

.placeholder-content {
    text-align: center;
    color: var(--gray-500);
    padding: 60px 20px;
}

.placeholder-content i {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.placeholder-content h3 {
    margin-bottom: 10px;
    color: var(--gray-600);
}

/* Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

.btn-secondary:hover {
    background: var(--gray-600);
    transform: translateY(-2px);
}

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

.btn-success:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-download {
    background: #8b5cf6;
    color: white;
}

.btn-download:hover {
    background: #7c3aed;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-info {
    background: #06b6d4;
    color: white;
}

.btn-info:hover {
    background: #0891b2;
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn:disabled {
    background: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Laporan Content Styles */
.laporan-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: 'Poppins', sans-serif;
}

.laporan-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 20px;
}

.laporan-header h1 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.8em;
}

.identity-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.identity-table td {
    padding: 12px;
    border: 1px solid var(--gray-300);
}

.identity-table td:first-child {
    background: var(--gray-50);
    font-weight: 600;
    width: 180px;
}

.score-summary {
    background: #ecfdf5;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid var(--success);
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 600;
    color: white;
    font-size: 0.9em;
}

.badge.sangat-baik { background: var(--success); }
.badge.baik { background: var(--primary-light); }
.badge.cukup { background: var(--warning); }
.badge.perlu-peningkatan { background: var(--danger); }

.analisis-section {
    margin: 25px 0;
}

.analisis-section h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.analisis-content {
    background: var(--gray-50);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-light);
}

.laporan-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-300);
    color: var(--gray-600);
    font-style: italic;
}

/* Footer Credit */
.footer-credit {
    background: var(--gray-50);
    padding: 20px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
    margin-top: 30px;
}

.credit-content {
    max-width: 600px;
    margin: 0 auto;
}

.credit-content p {
    margin-bottom: 5px;
    color: var(--gray-600);
}

.credit-content strong {
    color: var(--primary);
}

.copyright {
    font-size: 0.9em;
    color: var(--gray-500);
    margin-top: 10px;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .analisis-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        min-width: auto;
    }
    
    .header-title h1 {
        font-size: 1.8em;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .container {
        margin: 0;
        border-radius: 10px;
    }
    
    .indikator-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-credit {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .komponen-group {
        padding: 15px;
    }
    
    .laporan-preview {
        padding: 20px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    .tabs, .navigation-buttons, .action-buttons, .btn-logout, .footer-credit {
        display: none;
    }
    
    .tab-content {
        display: block !important;
        padding: 0;
    }
    
    .laporan-content {
        box-shadow: none;
        padding: 0;
    }
}
