/* ===================================================================
   DISPENSASI PAGE STYLES
   Styling untuk halaman dispensasi perpindahan penduduk
   ================================================================== */

/* Multi-Step Form Styles */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    width: 25%;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

/* Step Indicators */
.step-indicators {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    gap: 1rem;
}

.step-indicator {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #999;
    position: relative;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.step-indicator i {
    font-size: 1.1rem;
}

/* Ensure icons are vertically centered and have consistent size */
.step-indicator {
    line-height: 1;
}

.step-indicator i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.step-indicator.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Step 4 green when active (success step) */
.step-indicator[data-step="4"].active {
    background: #27ae60 !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3) !important;
}

.step-indicator.completed {
    background: #27ae60;
    color: white;
}

.step-indicator.completed::after {
    content: '✓';
    position: absolute;
    top: 0.3rem;
    right: 0.5rem;
    font-size: 1.2rem;
}

/* Step Content */
.step-content {
    display: none;
}

.step-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* fadeIn keyframes defined in base.css */

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e0e0e0;
}

/* File Upload Styles */
.file-upload-box {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.file-upload-box:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-box input[type="file"] {
    display: none;
}

.file-upload-label {
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.file-upload-label i {
    margin-right: 0.5rem;
}

.file-preview {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #27ae60;
    display: none;
}

/* Review Sections */
.review-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.review-section h3 {
    margin-top: 0;
    color: #667eea;
    border-bottom: 2px solid #667eea;
    padding-bottom: 0.5rem;
}

.review-table {
    width: 100%;
    border-collapse: collapse;
}

.review-table td {
    padding: 0.75rem;
    border-bottom: 1px solid #ddd;
}

.review-table td:first-child {
    width: 280px;
    font-weight: 600;
}

.review-documents {
    list-style: none;
    padding: 0;
}

.review-documents li {
    padding: 0.5rem 0;
    font-size: 0.95rem;
}

/* Pernyataan Box */
.pernyataan-box {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.pernyataan-box label {
    display: flex;
    align-items: start;
    gap: 1rem;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.6;
}

.pernyataan-box input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Success Page Styles */
.success-icon {
    font-size: 5rem;
    color: #27ae60;
    text-align: center;
    margin: 2rem 0;
}

.success-content {
    text-align: center;
    padding: 2rem;
}

.success-content h2 {
    color: #27ae60;
    margin-bottom: 1rem;
}

.success-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    text-align: left;
}

.btn-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Data Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table thead tr {
    background: #667eea;
    color: white;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #ddd;
}

.data-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

/* Filters Section */
.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.filters label {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.filters input,
.filters select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Pagination Styles */
#pagination {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#paginationButtons {
    display: flex;
    gap: 0.5rem;
}

#paginationButtons button {
    padding: 0.5rem 1rem;
}

#paginationButtons button.active {
    background: #667eea;
    color: white;
}

/* Action Buttons */
.btn-action {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 2px;
    transition: opacity 0.2s;
}

.btn-action:hover {
    opacity: 0.8;
}

/* Signature Pad Styles */
#signatureSection {
    margin-top: 1rem;
}

#signature-pad {
    display: block;
    margin: 0 auto;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: crosshair;
    touch-action: none;
}

.pen-color-btn {
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.pen-color-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.pen-color-btn:focus {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
}

/* Table Photo Display - 2:3 Ratio */
.table-photo {
    width: 48px;
    height: 72px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #ddd;
    background: #f5f5f5;
}

.table-photo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 72px;
    background: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 4px;
    color: #999;
    font-size: 20px;
}

/* Table Action Buttons */
.btn-table-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 4px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f0f0f0;
    color: #333;
}

.btn-table-action:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-table-action.btn-view {
    background: #667eea;
    color: white;
}

.btn-table-action.btn-view:hover {
    background: #5a6fd8;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-table-action.btn-edit {
    color: #f39c12;
}

.btn-table-action.btn-edit:hover {
    background: #fff3e0;
}

.btn-table-action.btn-delete {
    color: #e74c3c;
}

.btn-table-action.btn-delete:hover {
    background: #ffebee;
}

.btn-table-action i {
    font-size: 18px;
}

/* Table Row with Actions Below */
.data-table tbody tr.action-row {
    background: #fafafa;
    border-bottom: 3px solid #667eea !important;
}

.data-table tbody tr.action-row td {
    padding: 0.75rem !important;
    text-align: center !important;
    border: 1px solid #ddd;
    border-bottom: none;
}

.data-table tbody tr.action-row td:first-child {
    width: auto;
    text-align: center;
}

/* Modal Overlay & Dialog - Core styles in components.css */
/* Page-specific modal overrides */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
    animation: fadeInBackdrop 0.3s ease-out;
}

@keyframes fadeInBackdrop {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Dispensasi-specific modal content styling */
.modal-overlay .modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideInModal 0.3s ease-out;
}

@keyframes slideInModal {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
    margin: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: white;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    color: white;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Preview Image Styling */
.modal-body img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.modal-body iframe {
    display: block;
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: 8px;
}

/* Detail Modal Tab Styles */
.detail-tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    text-align: center;
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #999;
    transition: all 0.3s;
    position: relative;
}

.detail-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.detail-tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.detail-tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.detail-tab-content.active {
    display: block;
}

/* Document List Styles in Modal */
.document-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f0f7ff;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    margin-bottom: 0.75rem;
}

.document-item i {
    font-size: 1.5rem;
    color: #667eea;
}

.document-item .doc-info {
    flex: 1;
}

.document-item .doc-info strong {
    display: block;
    margin-bottom: 0.25rem;
}

.document-item .doc-info small {
    color: #666;
}

.document-item .btn-view {
    padding: 0.4rem 0.8rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.document-item .btn-view:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .step-indicators {
        flex-direction: column;
    }
    
    .step-indicator {
        width: 100%;
    }
    
    .step-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .filters {
        grid-template-columns: 1fr;
    }
    
    .document-item {
        flex-direction: column;
        text-align: center;
    }
}
