/* Management UI Styles */

body {
    /*background-color: #f5f5f5;*/
}

.ui.container {
    margin-top: 1em;
    margin-bottom: 2em;
}

/* Remove extra spacing between header and tabs */
.ui.container .ui.top.attached.tabular.menu {
    margin-top: 0;
    border-top: none;
}

/* Ensure proper connection between tabs and content */
.ui.container .ui.bottom.attached.segment {
    margin-top: 0;
    border-top: none;
}

/* Collection Cards */
.collection-card {
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

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

.collection-card.active {
    border: 2px solid #2185d0;
    box-shadow: 0 2px 10px rgba(33,133,208,0.2);
}

.collection-card .content {
    position: relative;
    padding-bottom: 1em !important;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.collection-card .extra.content {
    margin-top: auto;
    padding: 1em !important;
    border-top: 1px solid rgba(34,36,38,.1);
}

.collection-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.collection-card:hover .collection-actions {
    opacity: 1;
}

/* Collection Card Button Layout */
.collection-button-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

/* Activate/Active button (full width) */
.collection-activate-btn {
    width: 100% !important;
    margin: 0 !important;
    font-size: 0.9em !important;
    padding: 0.8em 1em !important;
}

.collection-activate-btn.active {
    background-color: #21ba45 !important;
    color: white !important;
    border-color: #21ba45 !important;
}

.collection-activate-btn i.icon {
    margin-right: 0.5em;
}

/* Action buttons container (Ingest and Status) */
.collection-action-buttons {
    display: flex;
    gap: 0.5em;
    width: 100%;
}

.collection-action-buttons button {
    flex: 1;
    margin: 0 !important;
    font-size: 0.85em !important;
    padding: 0.7em 0.8em !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-action-buttons button i.icon {
    margin-right: 0.4em;
}

/* Responsive adjustments for collection cards */
@media (max-width: 768px) {
    .collection-action-buttons {
        flex-direction: column;
        gap: 0.5em;
    }
    
    .collection-action-buttons button {
        width: 100%;
    }
}

/* Document Table Styles */
.document-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.document-row:hover {
    background-color: rgba(0,0,0,0.05);
}

.status-label {
    font-size: 0.8em;
    padding: 0.3em 0.6em;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-pending {
    background-color: #f39c12;
    color: white;
}

.status-processing {
    background-color: #3498db;
    color: white;
}

.status-completed {
    background-color: #27ae60;
    color: white;
}

.status-failed {
    background-color: #e74c3c;
    color: white;
}

/* Upload Area */
#upload-form {
    background: white;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#upload-progress {
    margin-top: 1em;
}

/* File Display */
#file-display {
    font-family: monospace;
    font-size: 0.9em;
}

/* Statistics */
.ui.statistics .statistic {
    margin: 0 1em 2em;
}

.ui.statistics .statistic > .value {
    color: #2185d0;
}

/* Collection Stats */
.collection-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5em 0;
    border-bottom: 1px solid #eee;
}

.collection-stat-item:last-child {
    border-bottom: none;
}

.collection-stat-name {
    font-weight: bold;
}

.collection-stat-count {
    background-color: #2185d0;
    color: white;
    padding: 0.2em 0.8em;
    border-radius: 12px;
    font-size: 0.9em;
}

/* Active Collection Label */
#active-collection-label {
    background-color: #27ae60 !important;
    color: white !important;
}

/* Loading States */
.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #999;
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ui.container {
        margin-top: 1em;
        padding: 0 1em;
    }
    
    .ui.four.stackable.cards .card {
        width: 100% !important;
    }
    
    .ui.statistics .statistic {
        margin: 0 0 1em;
    }
}

/* Animation for Cards */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.collection-card,
.document-row {
    animation: slideInUp 0.3s ease forwards;
}

/* Success/Error Messages */
.ui.success.message {
    border-left: 4px solid #27ae60;
}

.ui.error.message {
    border-left: 4px solid #e74c3c;
}

.ui.warning.message {
    border-left: 4px solid #f39c12;
}

/* Custom Icons */
.collection-icon {
    font-size: 2em;
    color: #2185d0;
    margin-bottom: 0.5em;
}

/* Button Improvements */
.ui.button {
    transition: all 0.3s ease;
}

.ui.button:hover {
    transform: translateY(-1px);
}

/* Tab Content */
.ui.tab.segment {
    min-height: 400px;
}

/* Progress Bar */
.ui.progress .bar {
    transition: width 0.3s ease;
}

/* Modal Improvements */
.ui.modal {
    border-radius: 8px;
}

.ui.modal .header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Table Improvements */
.ui.table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.ui.table tbody tr:hover {
    background-color: rgba(0,0,0,0.03);
}

/* Dropdown Improvements */
.ui.dropdown .menu {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.ui.dropdown .menu .item:hover {
    background-color: rgba(0,0,0,0.05);
}

/* Fix for collection filter dropdown z-index */
#collection-filter.ui.dropdown .menu,
#collection-filter.ui.dropdown > .menu {
    z-index: 9999 !important;
    position: absolute !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: 300px !important;
}

#collection-filter.ui.dropdown {
    position: relative;
}

/* Ensure the documents loading segment doesn't clip dropdown */
#documents-loading {
    overflow: visible !important;
}

/* Fix table container overflow */
.ui.bottom.attached.tab.segment[data-tab="documents"] {
    overflow: visible !important;
}

/* Additional overflow fixes for parent containers */
.ui.segment,
.ui.loading.segment,
.ui.bottom.attached.segment {
    overflow: visible !important;
}

/* Ensure dropdown menu appears above everything */
.ui.dropdown .menu.visible,
.ui.dropdown .menu.animating,
.ui.dropdown .menu.transition.visible {
    z-index: 99999 !important;
}

/* DataTables Styling */
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 5px;
}

.dataTables_wrapper .dataTables_info {
    margin-bottom: 5px;
}

/* Column Resizing Styles */
#documents-table {
    table-layout: fixed;
    width: 100%;
}

#documents-table th {
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-right: 1px solid #ddd;
}

#documents-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 8px;
}

/* Column resize handles */
.column-resizer {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 5px;
    cursor: col-resize;
    user-select: none;
    z-index: 10;
}

.column-resizer:hover {
    background: rgba(33, 133, 208, 0.5) !important;
}

/* Visual feedback during resize */
.column-resizer.resizing {
    background: #2185d0 !important;
}

/* Ensure table headers have enough padding for resize handles */
#documents-table thead th {
    padding-right: 10px;
    min-width: 50px;
}

/* Prevent text selection during resize */
.resizing-table {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Better visual separation between columns */
#documents-table th:not(:last-child) {
    border-right: 1px solid #e0e0e0;
}

/* Ensure DataTables wrapper doesn't interfere */
.dataTables_wrapper {
    overflow-x: auto;
}

/* Pulsing animation for ingesting buttons */
@keyframes pulse {
    0% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(242, 113, 28, 0.7);
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 0 10px rgba(242, 113, 28, 0);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(242, 113, 28, 0);
    }
}

.ui.button.pulsing {
    animation: pulse 2s infinite;
}

/* Ensure spinner icon rotates */
.ui.button .spinner.loading.icon {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}


.ui.header{
  padding-bottom: 15px;
}
