/* Div Tables CSS - Professional Dark Mode Table Styles */

/* Table Container */
.widget-div-table-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-small);
    margin-bottom: 2rem;
    position: relative;
}

.widget-div-table {
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Table Header - laut ui-widget-div-table-css.mdc Regel 005 UPPERCASE */
.widget-div-table-header {
    display: flex;
    background: var(--color-primary);
    color: var(--color-text-on-primary);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    font-size: var(--font-size-sm);
}

.widget-div-table-header .widget-div-table-cell {
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    /* Laut ui-widget-div-table-css.mdc Regel 006: Spaltenköpfe dürfen nicht umbrechen */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-div-table-header .widget-div-table-cell:last-child {
    border-right: none;
}

/* Table Rows - laut ui-widget-div-table-css.mdc Regel 001 Hover-Effekt */
.widget-div-table-row {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    transition: all 0.2s ease;
    background: var(--color-background);
}

.widget-div-table-row:hover {
    background: var(--color-surface-hover);
}

.widget-div-table-row:last-child {
    border-bottom: none;
}

/* Table Cells - laut ui-widget-div-table-css.mdc Regel 003 1px Gitternetz */
.widget-div-table-cell {
    flex: 1;
    padding: 1rem;
    display: flex;
    align-items: center;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
    border-right: 1px solid var(--color-border);
    /* Laut ui-widget-div-table-css.mdc Regel 004.001: white-space: normal für Textumbruch, kein horizontales Scrollen */
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text-primary);
}

.widget-div-table-cell:last-child {
    border-right: none;
}

/* Cell Content Alignment */
.widget-div-table-cell.widget-div-table-cell-left {
    justify-content: flex-start;
    text-align: left;
}

.widget-div-table-cell.widget-div-table-cell-center {
    justify-content: center;
    text-align: center;
}

.widget-div-table-cell.widget-div-table-cell-right {
    justify-content: flex-end;
    text-align: right;
}

/* Table Cell Types */
.widget-div-table-cell.widget-div-table-cell-number {
    font-family: var(--font-family-mono);
    font-weight: var(--font-weight-medium);
}

.widget-div-table-cell.widget-div-table-cell-date {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.widget-div-table-cell.widget-div-table-cell-status {
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
}

/* Status Colors */
.widget-div-table-cell-status-success {
    color: var(--color-success);
}

.widget-div-table-cell-status-warning {
    color: var(--color-warning);
}

.widget-div-table-cell-status-error {
    color: var(--color-error);
}

.widget-div-table-cell-status-info {
    color: var(--color-info);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .widget-div-table-cell {
        padding: 0.75rem;
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 768px) {
    .widget-div-table-container {
        /* STRENGSTENS VERBOTEN laut ui-widget-div-table-css.mdc Regel 004.001: overflow-x: auto entfernt */
    }
    
    .widget-div-table {
        /* STRENGSTENS VERBOTEN laut ui-widget-div-table-css.mdc Regel 004.001: min-width entfernt, da es horizontales Scrollen verursacht */
        width: 100%;
    }
    
    .widget-div-table-cell {
        padding: 0.5rem;
        font-size: var(--font-size-xs);
        white-space: normal;
    }
    
    .widget-div-table-header {
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 480px) {
    .widget-div-table {
        /* STRENGSTENS VERBOTEN laut ui-widget-div-table-css.mdc Regel 004.001: min-width entfernt, da es horizontales Scrollen verursacht */
        width: 100%;
    }
    
    .widget-div-table-cell {
        padding: 0.375rem;
        font-size: var(--font-size-xs);
        white-space: normal;
    }
    
    .widget-div-table-header {
        font-size: var(--font-size-xs);
    }
}

/* Table Actions */
.widget-div-table-cell .widget-button-standard,
.widget-div-table-cell .widget-button-delete {
    margin: 0;
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
    min-height: 32px;
}

/* Table Sorting */
.widget-div-table-header .widget-div-table-cell {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.widget-div-table-header .widget-div-table-cell:hover {
    background: var(--color-primary-dark);
}

.widget-div-table-header .widget-div-table-cell::after {
    content: '↕';
    position: absolute;
    right: 0.5rem;
    opacity: 0.7;
    font-size: var(--font-size-xs);
}

.widget-div-table-header .widget-div-table-cell.widget-div-table-cell-sorted-asc::after {
    content: '↑';
    opacity: 1;
}

.widget-div-table-header .widget-div-table-cell.widget-div-table-cell-sorted-desc::after {
    content: '↓';
    opacity: 1;
}

/* Table Search */
.widget-div-table-search {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.widget-div-table-search-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-small);
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
}

/* Table Filters */
.widget-div-table-filters {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.widget-div-table-filter {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.widget-div-table-filter-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.widget-div-table-filter-select {
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-small);
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--color-background);
    color: var(--color-text-primary);
    cursor: pointer;
}

/* Table Pagination */
.widget-div-table-pagination {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    align-items: center;
    justify-content: center;
}

.widget-text-pagination {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-left: 1rem;
}

/* Table Stats */
.widget-div-table-stats {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    background: var(--color-surface);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}
