/* Modern Table Display - Vollständiges Dark Theme mit Sticky Header */
.modern-table-container {
    max-width: 100%;
    margin: 0 auto 2rem;
    background: var(--bg-primary, #1a1a1a);
    border-radius: 16px;
    box-shadow: var(--shadow, 0 10px 30px rgba(0,0,0,0.3));
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary, #e0e0e0);
}

.modern-table-title {
    padding: 20px 24px;
    background: linear-gradient(135deg, #0d47a1 0%, #1976d2 100%);
    margin: 0;
}

.modern-table-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.modern-table-controls {
    padding: 20px 24px;
    background: var(--bg-secondary, #252525);
    border-bottom: 1px solid var(--border-color, #333);
}

.modern-table-search {
    position: relative;
    max-width: 400px;
}

.modern-table-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--bg-tertiary, #1f1f1f);
    border: 2px solid var(--border-color, #333);
    border-radius: 12px;
    color: var(--text-primary, #e0e0e0);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.modern-table-search-input::placeholder {
    color: var(--text-secondary, #b0b0b0);
}

.modern-table-search-input:focus {
    outline: none;
    border-color: var(--primary-color, #0d47a1);
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.15);
    background: var(--bg-primary, #1a1a1a);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary, #b0b0b0);
    font-size: 18px;
    pointer-events: none;
}

.modern-table-wrapper {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color, #0d47a1) var(--bg-secondary, #252525);
}

.modern-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.modern-table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-secondary, #252525);
}

.modern-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color, #0d47a1);
    border-radius: 4px;
}

.modern-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, #1976d2);
}

.modern-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    table-layout: auto;
    background: var(--bg-primary, #1a1a1a);
}

.modern-table thead {
    position: sticky;
    top: 0;
    z-index: 20;
}

.modern-table thead th {
    position: sticky;
    top: 0;
    background: linear-gradient(180deg, var(--primary-color, #0d47a1) 0%, #1565c0 100%) !important;
    color: white;
    padding: 18px 16px;
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 2px solid rgba(255,255,255,0.15);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: middle;
}

.modern-table thead th:last-child {
    border-right: none;
}

.modern-table thead th:hover {
    background: linear-gradient(180deg, var(--primary-dark, #1976d2) 0%, #1e88e5 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13,71,161,0.3);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.sort-icon {
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.modern-table thead th.sort-asc .sort-icon,
.modern-table thead th.sort-desc .sort-icon {
    opacity: 1;
}

.modern-table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #333);
    border-right: 1px solid rgba(255,255,255,0.03);
    vertical-align: middle;
    white-space: pre-wrap;
    word-break: break-word;
    transition: background 0.2s;
}

.modern-table tbody td:last-child {
    border-right: none;
}

.modern-table tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-table tbody tr:hover {
    background: rgba(37, 37, 37, 0.8);
    transform: scale(1.001);
}

.modern-table tbody tr:nth-child(even) {
    background: rgba(31, 31, 31, 0.5);
}

.modern-table tbody tr:nth-child(even):hover {
    background: rgba(37, 37, 37, 0.8);
}

.modern-table tbody tr.search-highlight {
    background: rgba(13, 71, 161, 0.2) !important;
    box-shadow: inset 0 0 0 2px rgba(13, 71, 161, 0.3);
}

.modern-table-info {
    padding: 16px 24px;
    background: var(--bg-secondary, #252525);
    color: var(--text-secondary, #b0b0b0);
    font-size: 13px;
    text-align: center;
    border-top: 1px solid var(--border-color, #333);
}

.modern-table-error {
    padding: 24px;
    background: #4a0d0d;
    color: #ff6b6b;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .modern-table-container {
        border-radius: 12px;
        margin-bottom: 1rem;
    }
    
    .modern-table-title {
        padding: 16px 20px;
    }
    
    .modern-table-title h3 {
        font-size: 18px;
    }
    
    .modern-table-controls {
        padding: 16px 20px;
    }
    
    .modern-table-search-input {
        padding: 12px 16px 12px 44px;
        font-size: 15px;
    }
    
    .modern-table thead th,
    .modern-table tbody td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .modern-table {
        min-width: 500px;
    }
}

@media (max-width: 480px) {
    .modern-table thead th,
    .modern-table tbody td {
        padding: 10px 6px;
        font-size: 12px;
    }
    
    .modern-table-wrapper {
        border-radius: 0;
    }
}

/* Animationen */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modern-table-container {
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading State */
.modern-table-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary, #b0b0b0);
}

.modern-table-loading::after {
    content: '';
    width: 24px;
    height: 24px;
    margin-left: 12px;
    border: 2px solid var(--border-color, #333);
    border-top-color: var(--primary-color, #0d47a1);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .modern-table-container {
        border: 2px solid #fff;
    }
    
    .modern-table thead th {
        border-bottom-width: 3px !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
