/* Custom CSS for SAP Configuration Manager */

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

/* Sidebar Styling */
.list-group-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

.list-group-item.active {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Entity Cards */
.entity-card {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.15s ease-in-out;
}

.entity-card:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.entity-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: between;
    align-items: center;
}

.entity-body {
    padding: 1rem;
}

/* Property and Relation Tables */
.table-sm th,
.table-sm td {
    padding: 0.5rem;
    vertical-align: middle;
}

.table-actions {
    width: 120px;
    text-align: center;
}

/* Badge Styling */
.badge-operation {
    font-size: 0.75em;
}

.badge-create {
    background-color: #198754;
}

.badge-update {
    background-color: #fd7e14;
}

/* Button Styling */
.btn-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

.btn-xs {
    font-size: 0.75rem;
    padding: 0.125rem 0.25rem;
}

/* Modal Styling */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* Form Styling */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.required::after {
    content: " *";
    color: #dc3545;
}

/* Toast Styling */
.toast {
    min-width: 300px;
}

.toast-success .toast-header {
    background-color: #d1edff;
    color: #0c5460;
}

.toast-error .toast-header {
    background-color: #f8d7da;
    color: #721c24;
}

.toast-warning .toast-header {
    background-color: #fff3cd;
    color: #856404;
}

/* Tab Content */
.tab-content {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
}

.tab-pane {
    padding: 0;
}

/* Card Styling */
.card {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .col-md-3 {
        margin-bottom: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Utility Classes */
.text-truncate-custom {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Entity tabs styling */
.nav-tabs-sm .nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.nav-tabs-sm .nav-link i {
    font-size: 0.75rem;
}

.entity-body .tab-content {
    min-height: 200px;
}

.entity-body .tab-pane {
    padding: 1rem 0;
}

/* Improve table spacing in tabs */
.entity-body .table-responsive {
    margin-bottom: 1rem;
}

.entity-body .table th {
    font-size: 0.875rem;
    font-weight: 600;
    border-top: none;
}

.entity-body .table td {
    font-size: 0.875rem;
    vertical-align: middle;
}

/* Better spacing for empty states */
.entity-body .text-muted {
    text-align: center;
    padding: 2rem 1rem;
}

/* Conditional creation modal improvements */
.condition-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6 !important;
}

.condition-item:hover {
    background-color: #e9ecef;
}

.condition-item .form-label {
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.condition-item .form-control-sm,
.condition-item .form-select-sm {
    font-size: 0.875rem;
}

/* Preview styling */
#conditional-creation-preview pre {
    font-size: 0.875rem;
    max-height: 300px;
    overflow-y: auto;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border-style: dashed !important;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Status Indicators */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
}

.status-active {
    background-color: #28a745;
}

.status-inactive {
    background-color: #6c757d;
}

.status-error {
    background-color: #dc3545;
}

/* Code Styling */
.code-snippet {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.25rem;
    padding: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #495057;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Accordion Styling */
.accordion-button:not(.collapsed) {
    background-color: #e7f1ff;
    color: #0c63e4;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Search Box */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-left: 2.5rem;
}

.search-box .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    z-index: 5;
}

/* Drag and Drop */
.drag-over {
    border: 2px dashed #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

.draggable {
    cursor: move;
}

.draggable:hover {
    background-color: #f8f9fa;
}

/* Progress Bar */
.progress-sm {
    height: 0.5rem;
}

/* Custom Scrollbar */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #6c757d #f8f9fa;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #6c757d;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #495057;
}

/* Highlight */
.highlight {
    background-color: #fff3cd;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
}

/* Validation States */
.is-invalid {
    border-color: #dc3545;
}

.is-valid {
    border-color: #28a745;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc3545;
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #28a745;
}

/* Search Configuration Styling */
.search-parameter-item {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6 !important;
    transition: all 0.2s ease;
}

.search-parameter-item:hover {
    background-color: #e9ecef;
    border-color: #adb5bd !important;
}

.search-parameter-item .form-control-sm {
    font-size: 0.875rem;
}

/* Search Pattern Radio Buttons */
.form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.form-check-label {
    cursor: pointer;
}

.form-check-label strong {
    color: #495057;
}

/* Search Pattern Badges */
.badge.bg-success {
    background-color: #198754 !important;
}

.badge.bg-primary {
    background-color: #0d6efd !important;
}

/* Mapping Preview Styling */
.mapping-preview .card {
    border-color: #0dcaf0;
}

.mapping-preview .card-header {
    background-color: #cff4fc;
    border-color: #0dcaf0;
}

.mapping-preview .fa-arrow-right {
    font-size: 1.5rem;
}

/* Operation Type Badges */
.badge-create {
    background-color: #198754 !important;
    color: white;
}

.badge-update {
    background-color: #fd7e14 !important;
    color: white;
}

/* Enhanced Table Styling for Relations */
.table th {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-weight: 600;
    font-size: 0.875rem;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

.table .text-truncate-custom {
    max-width: 150px;
}

/* Search Field ID Display */
.text-info {
    color: #0dcaf0 !important;
}

code {
    background-color: #f8f9fa;
    color: #d63384;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* Form Text Styling */
.form-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

.form-text i {
    color: #0d6efd;
}

/* Modal Size Adjustments */
.modal-lg {
    max-width: 900px;
}

.modal-xl {
    max-width: 1200px;
}

/* Card in Modal Body */
.modal-body .card {
    margin-bottom: 0;
}

.modal-body .card .card-header h6 {
    margin-bottom: 0;
    font-weight: 600;
}

/* Button Group Styling */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Enhanced Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Responsive Table Improvements */
@media (max-width: 768px) {
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table th,
    .table td {
        padding: 0.25rem;
    }
    
    .text-truncate-custom {
        max-width: 100px;
    }
    
    .btn-xs {
        font-size: 0.625rem;
        padding: 0.125rem 0.25rem;
    }
}

/* Search Configuration Section */
#search-parameters-section {
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-top: 1rem;
}

#search-parameters-container {
    max-height: 300px;
    overflow-y: auto;
}

/* Enhanced Form Styling */
.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Status and Pattern Indicators */
.pattern-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.pattern-indicator .badge {
    font-size: 0.75rem;
}

/* Enhanced Card Headers */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.card-header h5,
.card-header h6 {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Improved Button Styling */
.btn-outline-success:hover {
    background-color: #198754;
    border-color: #198754;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
}
