/* Tables.css - Table styles, filters, sorting, and resizing */

/* Table Container */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    width: 100%;
}

/* Table Base Styles */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

tr {
    height: auto;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    height: auto;
}

td.readonly-text {
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    user-select: none;
}

/* Resizable column headers */
th {
    position: relative;
}

.resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    background: transparent;
}

.resizer:hover {
    background: #007bff;
}

/* Sortable headers */
th.sortable {
    cursor: pointer;
}

th.sortable:hover {
    background: #eef3f8;
}

.sort-indicator {
    float: right;
    font-size: 11px;
    color: #666;
    margin-left: 6px;
}

/* Filter bars */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.filter-bar input[type="text"], .filter-bar select {
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.filter-bar .filter-label {
    font-size: 12px;
    color: #666;
}

.filter-bar .filter-spacer {
    flex: 1 1 auto;
}

.filter-bar .filter-clear {
    padding: 8px 10px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.resizing {
    cursor: col-resize;
}

/* Scene ID Button */
.scene-id-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    text-align: center;
}

.scene-id-button:hover {
    background: #0056b3;
}

.scene-id-button:active {
    background: #004085;
}

/* Table Input Fields */
td input, td select, td textarea {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
    resize: none;
    overflow: hidden;
    min-height: 40px;
    box-sizing: border-box;
}

td textarea {
    min-height: 60px;
    height: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Make textareas auto-expand */
td textarea:focus {
    overflow: hidden;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab:hover {
    color: #007bff;
}

.tab.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Merged cells */
td.merged-cell {
    border-top: none;
}

td.merged-cell:first-child {
    border-top: 1px solid #ddd;
}

/* Floating Create Button */
.floating-create-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    border: none;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}

.floating-create-btn:hover {
    background: #0056b3;
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.6);
    transform: scale(1.05);
    opacity: 1;
}

.floating-create-btn:active {
    transform: scale(0.95);
}
