/* ==========================================
   SURVEY APPLICATION STYLES
   ========================================== */

/* CSS Variables */
:root {
    --primary-color: #2C3E50;
    --secondary-color: #34495E;
    --accent-color: #3498DB;
    --success-color: #27AE60;
    --danger-color: #E74C3C;
    --warning-color: #F39C12;
    --info-color: #17A2B8;
    --light-bg: #F8F9FA;
    --card-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --card-shadow-hover: 0 1rem 2rem rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   GLOBAL STYLES
   ========================================== */

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 0 !important;
    margin: 0 !important;
}

header {
    margin: 0;
    padding: 0;
}

main {
    padding: 0 !important;
    margin: 0 !important;
}

/* Hide navbar on specific pages */
.hide-navbar header {
    display: none !important;
}

.hide-navbar body {
    padding-top: 0 !important;
}

/* Page-specific navbar hiding */
body.page-home header,
body.page-form header,
body.page-dashboard header,
body.page-success header {
    display: none !important;
}

/* ==========================================
   CONTAINERS
   ========================================== */

.main-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.container-fluid {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* ==========================================
   CARDS
   ========================================== */

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    background: white;
    overflow: hidden;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

.main-card {
    will-change: transform, box-shadow;
}

.card-header {
    padding: 1rem 1.25rem;
    border: none;
    font-weight: 600;
    font-size: 1rem;
}

.card-header h3,
.card-header h4,
.card-header h5 {
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: -0.3px;
    margin: 0;
}

.main-card-header h3 {
    font-size: 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* Card Header Backgrounds */
.card-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.card-header.bg-info {
    background: linear-gradient(135deg, #17A2B8 0%, #138496 100%) !important;
}

.card-header.bg-warning {
    background: linear-gradient(135deg, #F39C12 0%, #D68910 100%) !important;
}

.card-header.bg-dark {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
}

.main-card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.section-card-header.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.indikator-card-header {
    background: linear-gradient(135deg, #0066CC 0%, #004C99 100%) !important;
}

.indikator-card-header h4 {
    color: white !important;
}

/* Statistic Cards */
.card.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%) !important;
    border: none;
}

.card.bg-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #C0392B 100%) !important;
    border: none;
}

/* ==========================================
   ANIMATIONS - REMOVED (Not Used Anymore)
   ========================================== */

/* All keyframe animations removed for cleaner code */

/* ==========================================
   TYPOGRAPHY
   ========================================== */

h1 {
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
}

h1 .bi {
    color: var(--accent-color);
}

.display-4 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

/* ==========================================
   FORM CONTROLS
   ========================================== */

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.2px;
}

.form-control,
.form-select {
    border: 2px solid #e8ecef;
    border-radius: 8px;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

.form-control::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.form-select-sm {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
}

/* ==========================================
   CHECKBOXES & RADIOS
   ========================================== */

.form-check {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.form-check:hover {
    background: #f8f9fa;
}

.form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    border: 2px solid #cbd5e0;
    transition: var(--transition);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.form-check-input:checked[value="false"] {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.form-check-label {
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 0.5rem;
    user-select: none;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    border: none;
    border-radius: 8px;
    padding: 0.55rem 1.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: -0.2px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%);
}

.btn-success:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #2980B9 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2980B9 0%, #21618C 100%);
}

/* ==========================================
   ALERTS
   ========================================== */

.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--card-shadow);
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #e7f5f8 100%);
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.alert-info .alert-heading {
    color: #0c5460;
    font-size: 0.95rem;
}

.alert-info ol {
    line-height: 1.7;
    font-size: 0.85rem;
}

.alert-info ol li {
    color: #0c5460;
    margin-bottom: 0.5rem;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #fce4e6 100%);
    color: #721c24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #fff9e6 100%);
    border: 1px solid #ffc107;
    border-radius: 10px;
}

.bab-selection .alert-warning {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==========================================
   BADGES
   ========================================== */

.badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-weight: 600;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #229954 100%) !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #C0392B 100%) !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--accent-color) 0%, #2980B9 100%) !important;
}

.question-item .badge {
    background: linear-gradient(135deg, var(--accent-color) 0%, #2980B9 100%);
}

/* ==========================================
   TABLES
   ========================================== */

.table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.table {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.table thead th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #dee2e6;
    padding: 0.75rem;
}

.table tbody td {
    padding: 0.75rem;
    vertical-align: middle;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
    transition: var(--transition);
}

.table-dark {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
}

.table-warning {
    background: linear-gradient(135deg, #FFF3CD 0%, #FFE69C 100%) !important;
    color: #856404 !important;
}

.table-bordered {
    border: 1px solid #dee2e6;
}

/* ==========================================
   FORM PAGE SPECIFIC STYLES
   ========================================== */

.question-item {
    background: #fafbfc;
    border-radius: 12px;
    padding: 1rem !important;
    margin-bottom: 1rem !important;
    border: 1px solid #e8ecef;
    transition: var(--transition);
}

.question-item:hover {
    background: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.1);
}

.question-item h5 {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color);
    line-height: 1.6;
    margin: 0;
}

.answer-section {
    padding-left: 3.5rem;
    padding-right: 1rem;
}

.bab-selection {
    background: linear-gradient(135deg, #fff5eb 0%, #fff9f0 100%);
    border: 2px solid #ffd7a8;
    border-radius: 8px;
    padding: 1rem !important;
    margin-top: 0.85rem;
}

.bab-selection .row {
    justify-content: center;
}

.bab-selection .col-md-4,
.bab-selection .col-6 {
    margin-bottom: 0.25rem !important;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    text-align: center;
}

.bab-selection .form-check {
    margin-bottom: 0 !important;
    padding: 0.25rem 0.5rem !important;
    display: inline-block;
    text-align: left;
}

.saran-item {
    background: white;
    border: 2px solid #e8ecef;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.saran-item textarea {
    resize: vertical;
    min-height: 100px;
}

.section-card-body .alert-info {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

.section-card-body .alert-info .fw-semibold {
    font-size: 0.9rem;
    color: #0c5460;
}

.section-card-body .alert-info .small {
    font-size: 0.8rem;
    line-height: 1.5;
}

/* ==========================================
   AUTOCOMPLETE DROPDOWN STYLES
   ========================================== */

.autocomplete-dropdown {
    position: absolute;
    z-index: 1000;
    display: none;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: calc(100% - 24px);
    margin-top: -1px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
}

.autocomplete-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.autocomplete-satker {
    font-size: 0.85rem;
    color: #6c757d;
}

.autocomplete-no-results {
    padding: 12px 16px;
    color: #6c757d;
    font-style: italic;
    text-align: center;
}

.readonly-satker {
    background-color: #e9ecef !important;
    cursor: not-allowed;
}

input[readonly].readonly-satker {
    opacity: 0.7;
}

/* Position adjustment for autocomplete */
.col-md-6:has(#namaAutocomplete) {
    position: relative;
}

/* ==========================================
   HOME PAGE SPECIFIC STYLES
   ========================================== */

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-ditjen {
    max-width: 350px;
    height: auto;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.jumbotron {
    padding: 3rem 2rem !important;
}

/* Original jumbotron title - Bootstrap default style */
.jumbotron .display-4 {
    font-size: 3.5rem;
    font-weight: 300;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .logo-ditjen {
        max-width: 120px;
    }

    .jumbotron {
        padding: 2rem 1rem !important;
    }

    .jumbotron .display-4 {
        font-size: 2.5rem;
    }
}

/* ==========================================
   DASHBOARD SPECIFIC STYLES
   ========================================== */

/* Dashboard Tabs */
.dashboard-tabs .nav-link {
    font-weight: 600;
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.dashboard-tabs .nav-link:hover {
    background-color: #f8f9fa;
    border-bottom-color: #dee2e6;
}

.dashboard-tabs .nav-link.active {
    background-color: white;
    border-bottom-color: #0066cc;
    color: #0066cc;
}

.badge-tab-count {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
}

/* Chart */
#resultChart {
    max-width: 400px;
    margin: 0 auto;
}

/* ==========================================
   SCROLLBAR
   ========================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-color) 0%, #2980B9 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2980B9 0%, #21618C 100%);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    body {
        padding: 0.75rem 0;
    }

    h1 {
        font-size: 1.5rem;
    }

    .main-card-header h3 {
        font-size: 1.1rem;
    }

    .main-card-body,
    .section-card-body,
    .indikator-card-body,
    .card-body {
        padding: 1rem;
    }

    .question-item {
        padding: 0.75rem !important;
    }

    .alert-info ol {
        font-size: 0.75rem;
    }

    .alert-info ol li {
        margin-bottom: 0.35rem;
    }

    .logo-ditjen {
        max-width: 120px;
    }

    .jumbotron {
        padding: 2rem 1rem !important;
    }

    .display-4 {
        font-size: 2rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.bi {
    vertical-align: middle;
}

.text-muted {
    color: #6c757d !important;
    font-size: 0.9rem;
}

.bi-inbox {
    color: #dee2e6;
}

/* ==========================================
   AI SUMMARY FORMATTED STYLES
   ========================================== */

/* Container for AI summary with formatted content */
.ai-summary-container {
    white-space: normal;
    line-height: 1.9;
    font-size: 0.95rem;
    color: #2c3e50;
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
}

/* Main wrapper for formatted AI content */
.ai-summary-formatted {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Highlighted keywords and important text */
.highlight-text {
    color: #0066cc;
    font-weight: 600;
    background-color: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    border-bottom: 2px solid #ffc107;
    transition: all 0.2s ease;
}

.highlight-text:hover {
    background-color: #ffe69c;
    border-bottom-color: #ff9800;
}

/* Styled bullet points */
.bullet-point {
    color: #28a745;
    font-size: 1.1em;
    font-weight: bold;
    margin-right: 8px;
    display: inline-block;
}

/* Section headers with emoji */
.summary-section {
    display: block;
    font-weight: 600;
    font-size: 1.05rem;
    margin: 1.2rem 0 0.6rem 0;
    padding: 0.5rem 0.8rem;
    background: linear-gradient(90deg, #e3f2fd 0%, transparent 100%);
    border-left: 4px solid #2196f3;
    border-radius: 4px;
    line-height: 1.6;
}

.summary-section:first-child {
    margin-top: 0;
}

/* Emoji icon styling */
.emoji-icon {
    font-size: 1.3em;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}

/* Bounce animation removed */

/* Horizontal dividers */
.summary-divider {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #dee2e6 20%, #dee2e6 80%, transparent);
    margin: 1.5rem 0;
}

/* Enhanced styling for specific sections */
.ai-summary-formatted strong {
    font-weight: 600;
}

.ai-summary-formatted br + br {
    display: block;
    content: "";
    margin-top: 0.5rem;
}

/* Scrollbar styling for AI summary container */
.ai-summary-container::-webkit-scrollbar {
    width: 8px;
}

.ai-summary-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.ai-summary-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.ai-summary-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive adjustments for AI summary */
@media (max-width: 768px) {
    .ai-summary-container {
        max-height: 400px;
        font-size: 0.9rem;
        padding: 0.75rem;
    }

    .summary-section {
        font-size: 1rem;
        padding: 0.4rem 0.6rem;
    }

    .emoji-icon {
        font-size: 1.2em;
    }

    .highlight-text {
        padding: 1px 4px;
    }
}
