/* Corpus Explorer Specific Styles */

.corpus-explorer-container {
    background: #f8f9fa;
    min-height: 100vh;
    padding-bottom: 2rem;
}

.corpus-nav-card {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: none;
    margin-bottom: 1.5rem;
}

.corpus-nav-card .card-body {
    padding: 1.5rem;
}

/* Table Styles */
#corpusTable {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

#corpusTable .table {
    margin-bottom: 0;
}

#corpusTable thead th {
    background: #343a40;
    color: white;
    border: none;
    font-weight: 600;
    padding: 12px 8px;
    font-size: 0.9rem;
}

#corpusTable tbody tr {
    transition: background-color 0.2s ease;
}

#corpusTable tbody tr:hover {
    background-color: #f1f3f4;
}

/* Cell-specific styles */
.discourse-cell {
    max-width: 200px;
    word-wrap: break-word;
    line-height: 1.4;
}

.cowlitz-cell {
    font-weight: bold;
    color: #112AAA;
}

.translation-cell {
    color: black;
    font-weight: 500;
}

.morpheme-cell {

}

.notes-cell {
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

/* Search highlighting */
mark {
    background-color: #fff3cd;
    padding: 1px 2px;
    border-radius: 2px;
    font-weight: bold;
    color: #856404;
}

/* Speaker badges */
.badge-secondary {
    background-color: #6c757d;
    font-size: 0.75rem;
}

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

#corpusDetailsContent h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#corpusDetailsContent .bg-light {
    background-color: #f8f9fa !important;
    border-left: 4px solid #007bff;
}

/* Loading indicator */
#loadingIndicator {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* No results */
#noResults {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Results info */
#resultsInfo .alert {
    border: none;
    border-left: 4px solid #17a2b8;
    border-radius: 0;
    background-color: #d1ecf1;
    color: #0c5460;
}

/* Pagination */
.pagination {
    margin-bottom: 0;
}

.pagination .page-link {
    color: #007bff;
    border-color: #dee2e6;
    padding: 0.5rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background-color: #007bff;
    border-color: #007bff;
}

.pagination .page-link:hover {
    color: #0056b3;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .corpus-nav-card .card-body {
        padding: 1rem;
    }
    
    #corpusTable .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.85rem;
    }
    
    .discourse-cell, .morpheme-cell, .notes-cell {
        max-width: 120px;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .discourse-cell, .morpheme-cell, .notes-cell {
        max-width: 100px;
    }
    
    #corpusTable thead th {
        font-size: 0.8rem;
        padding: 8px 4px;
    }
}

/* Navigation button styles */
#prevChapterBtn, #nextChapterBtn {
    min-width: 80px;
}

/* Form controls */
.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Search input group */
.input-group .btn {
    border-left: none;
}

.input-group .form-control:focus {
    z-index: 3;
}

/* Utility classes */
.text-truncate-custom {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Animation for table rows */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#corpusData tr {
    animation: fadeIn 0.3s ease-in-out;
}

/* Spinner customization */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Title styling */
#Dictionary {
    font-size: 2.5rem;
    font-weight: 300;
    color: #495057;
    margin-bottom: 0.5rem;
}

/* Card hover effects */
.corpus-nav-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease;
}

/* Enhanced Dynamic Column Styles */
/* .language-text {
    font-family: 'Segoe UI', 'Times New Roman', serif;
    font-style: italic;
    color: #2c3e50;
} */

.column-checkbox {
    margin-right: 8px;
}

#columnSettings .card {
    border-color: #17a2b8;
    border-left: 4px solid #17a2b8;
}

#dataSchema .card {
    border-color: #17a2b8;
    border-left: 4px solid #17a2b8;
}

/* Schema info cards */
#schemaInfo .card {
    transition: transform 0.2s ease;
    border: 1px solid #e9ecef;
}

#schemaInfo .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

#schemaInfo .card-title {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

#schemaInfo .badge {
    font-size: 0.7rem;
}

/* Column management */
.custom-control-label {
    font-size: 0.9rem;
    cursor: pointer;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: #007bff;
    border-color: #007bff;
}

/* Improved table responsiveness */
@media (max-width: 992px) {
    .table-responsive {
        font-size: 0.85em;
    }
    
    .discourse-cell {
        max-width: 150px;
    }
    
    .morpheme-cell {
        max-width: 120px;
    }
}

/* Modal enhancements for dynamic content */
#corpusDetailsModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

#corpusDetailsModal .collapse .card {
    border: 1px solid #dee2e6;
    margin-top: 0.5rem;
}

#corpusDetailsModal h5 {
    color: #495057;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

#corpusDetailsModal h6 {
    color: #6c757d;
    font-size: 0.95rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* Collapsible sections styling */
.collapse.show {
    animation: slideDown 0.3s ease;
}

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

/* Button group styling */
.btn-group-toggle .btn {
    font-size: 0.875rem;
}

/* Enhanced badges */
.badge-success { background-color: #28a745; }
.badge-warning { background-color: #ffc107; color: #212529; }
.badge-secondary { background-color: #6c757d; }

/* Dynamic table styling */
.table th {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 200px;
}

.table td {
    word-wrap: break-word;
    max-width: 200px;
}

/* Column type-specific styling */
.table .badge-cell {
    text-align: center;
    white-space: nowrap;
}

.table .datetime-cell {
    font-size: 0.8rem;
    color: #6c757d;
}

.table .action-cell {
    text-align: center;
    white-space: nowrap;
}

/* Loading and error states */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.text-muted {
    color: #6c757d !important;
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
