/**
 * TablePress Responsive - CSS Styles
 * Modern violet-red gradient design for both desktop and mobile
 */

/* Responsive wrapper */
.tablepress-responsive-wrapper {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Desktop table container and wrapper styling */
.tpr-wrapper table.tablepress,
.tablepress-responsive-wrapper table.tablepress {
    width: 100% !important;
    margin: 0 !important;
    background: #36416D !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    border: 1px solid rgba(250, 41, 70, 0.15) !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
}

/* Remove all borders and spacing from TablePress tables */
.tablepress-responsive-wrapper .tablepress,
.tablepress-responsive-wrapper .tablepress * {
    border: none !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
}

/* Desktop table header styling */
.tpr-wrapper thead th,
.tablepress-responsive-wrapper table.tablepress thead th,
.tablepress-responsive-wrapper table.tablepress.dataTable thead th {
    background: #2A3555 !important;
    color: #FA2946 !important;
    font-weight: 600 !important;
    text-align: left !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid rgba(250, 41, 70, 0.15) !important;
}

/* Desktop table rows - force override */
.tablepress-responsive-wrapper table.tablepress tbody tr,
.tablepress-responsive-wrapper table.tablepress.dataTable tbody tr {
    background: #36416D !important;
    transition: all 0.3s ease;
    border: none !important;
}

/* Alternierende Zeilen für bessere Lesbarkeit */
.tablepress-responsive-wrapper table.tablepress tbody tr:nth-child(odd),
.tablepress-responsive-wrapper table.tablepress.dataTable tbody tr:nth-child(odd) {
    background: #36416D !important;
}

.tablepress-responsive-wrapper table.tablepress tbody tr:hover,
.tablepress-responsive-wrapper table.tablepress.dataTable tbody tr:hover {
    background: rgba(54, 65, 109, 0.8) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.tablepress-responsive-wrapper table.tablepress tbody tr:nth-child(even),
.tablepress-responsive-wrapper table.tablepress.dataTable tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.05) !important;
}

.tablepress-responsive-wrapper table.tablepress tbody td,
.tablepress-responsive-wrapper table.tablepress.dataTable tbody td {
    padding: 16px 20px !important;
    border: none !important;
    border-bottom: 1px solid rgba(250, 41, 70, 0.15) !important;
    color: white !important;
    font-weight: 500 !important;
    background: transparent !important;
    text-align: left !important;
}

/* Zusätzliche Verstärkung der Textausrichtung */
.tpr-wrapper table.tablepress td,
.tpr-wrapper table.tablepress th,
.tablepress-responsive-wrapper td,
.tablepress-responsive-wrapper th {
    text-align: left !important;
}

/* Mobile accordion styles */
.tpr-accordion {
    width: 100%;
    background: #36416D;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(250, 41, 70, 0.15);
}

.tpr-accordion-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.tpr-accordion-item:last-child {
    border-bottom: none;
}

.tpr-accordion-item.tpr-active {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

    /* Accordion header styling */
    .tpr-accordion .tpr-accordion-header {
        background: #36416D;
        color: white;
        padding: 15px;
        font-weight: 600;
        cursor: pointer;
        border: none;
        margin-bottom: 2px;
        position: relative;
        text-align: left;
        border-bottom: 1px solid rgba(250, 41, 70, 0.15);
    }

.tpr-accordion-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tpr-accordion-header:hover {
    background: rgba(33, 3, 32, 0.8);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(33, 3, 32, 0.3);
}

.tpr-accordion-header:hover::before {
    opacity: 1;
}

.tpr-accordion-item.tpr-active .tpr-accordion-header {
    background: rgba(250, 41, 70, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(250, 41, 70, 0.3);
}

.tpr-header-text {
    flex-grow: 1;
    font-size: 16px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tpr-toggle-icon {
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.tpr-accordion-item.tpr-active .tpr-toggle-icon {
    transform: rotate(180deg);
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Accordion content */
.tpr-accordion-content {
    background: #36416D;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tpr-mobile-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.tpr-mobile-table tr {
    border-bottom: none;
    transition: all 0.3s ease;
}

.tpr-mobile-table tr:last-child {
    border-bottom: none;
}

.tpr-mobile-table tr:hover {
    background: rgba(250, 41, 70, 0.1);
}

.tpr-mobile-table td {
    padding: 16px 24px;
    vertical-align: top;
    border: none;
    transition: all 0.3s ease;
    color: white;
}

/* Label-Value pair styling */
.tpr-mobile-table td.tpr-label {
    background: #FA2946;
    font-weight: 600;
    color: white;
    width: 40%;
    border-right: none;
    border: none;
    border-bottom: 1px solid rgba(250, 41, 70, 0.15);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
}

.tpr-mobile-table td.tpr-value {
    background: #36416D;
    color: white;
    width: 60%;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
    text-align: left;
    border-bottom: 1px solid rgba(250, 41, 70, 0.15);
}

/* Value-only styling (when headers are disabled) */
.tpr-mobile-table td.tpr-value-only {
    background: #737194;
    color: white;
    text-align: center;
    font-size: 14px;
    line-height: 1.6;
    font-weight: 500;
}

/* Responsive breakpoints and utilities */
@media screen and (max-width: 480px) {
    .tpr-accordion-header {
        padding: 16px 20px;
    }
    
    .tpr-header-text {
        font-size: 15px;
    }
    
    .tpr-mobile-table td {
        padding: 14px 20px;
    }
    
    .tpr-mobile-table td.tpr-label,
    .tpr-mobile-table td.tpr-value {
        font-size: 13px;
    }
    
    /* Enhanced stack layout for very small screens */
    .tpr-mobile-table.tpr-stack tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid rgba(237, 100, 166, 0.3);
        border-radius: 8px;
        overflow: hidden;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(247, 250, 252, 0.95) 100%);
    }
    
    .tpr-mobile-table.tpr-stack td {
        display: block;
        width: 100% !important;
        padding: 12px 16px;
    }
    
    .tpr-mobile-table.tpr-stack td.tpr-label {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        background-color: #007cba;
        color: white;
        font-weight: 600;
    }
}

/* Animation classes */
.tpr-accordion-content.tpr-animating {
    transition: height 0.3s ease;
}

/* Loading state */
.tablepress-responsive-wrapper.tpr-loading {
    position: relative;
}

.tablepress-responsive-wrapper.tpr-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* TablePress DataTables compatibility */
.tablepress-responsive-wrapper .dataTables_wrapper {
    position: relative;
}

/* Hide DataTables controls on mobile when accordion is active */
.tablepress-responsive-wrapper.tpr-mobile-view .dataTables_length,
.tablepress-responsive-wrapper.tpr-mobile-view .dataTables_filter,
.tablepress-responsive-wrapper.tpr-mobile-view .dataTables_info,
.tablepress-responsive-wrapper.tpr-mobile-view .dataTables_paginate {
    display: none !important;
}

/* Ensure original table is properly hidden in mobile view */
.tablepress-responsive-wrapper.tpr-mobile-view table.tablepress {
    display: none !important;
}

/* Focus styles for accessibility */
.tpr-accordion-header:focus {
    outline: 3px solid rgba(240, 147, 251, 0.8);
    outline-offset: -3px;
    box-shadow: 0 0 0 3px rgba(240, 147, 251, 0.3);
}

/* Print styles */
@media print {
    .tablepress-responsive-wrapper.tpr-mobile-view table.tablepress {
        display: table !important;
    }
    
    .tablepress-responsive-wrapper.tpr-mobile-view .tpr-accordion {
        display: none !important;
    }
}

/* Dark mode support - enhanced version */
@media (prefers-color-scheme: dark) {
    .tablepress-responsive-wrapper {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    
    .tablepress-responsive-wrapper table.tablepress {
        background: #2d3748;
    }
    
    .tablepress-responsive-wrapper table.tablepress thead th {
        background: #210320 !important;
        color: #FA2946 !important;
    }
    
    .tablepress-responsive-wrapper table.tablepress tbody tr {
        background: #2d3748;
    }
    
    .tablepress-responsive-wrapper table.tablepress tbody tr:hover {
        background: rgba(45, 55, 72, 0.9);
    }
    
    .tablepress-responsive-wrapper table.tablepress tbody td {
        color: #e2e8f0;
        border-color: rgba(74, 85, 104, 0.3);
    }
    
    .tpr-accordion {
        background: #2d3748;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    }
    
    .tpr-accordion-item {
        border-color: rgba(74, 85, 104, 0.3);
    }
    
    .tpr-accordion-header {
        background: #97266d;
        color: white;
        border-color: rgba(74, 85, 104, 0.3);
    }
    
    .tpr-accordion-header:hover {
        background: rgba(33, 3, 32, 0.8);
        box-shadow: 0 4px 16px rgba(33, 3, 32, 0.4);
    }
    
    .tpr-accordion-item.tpr-active .tpr-accordion-header {
        background: rgba(33, 3, 32, 0.95);
    }
    
    .tpr-accordion-content {
        background: #2d3748;
    }
    
    .tpr-mobile-table td.tpr-label {
        background: #97266d;
        color: white;
        border-color: rgba(151, 38, 109, 0.3);
    }
    
    .tpr-mobile-table td.tpr-value,
    .tpr-mobile-table td.tpr-value-only {
        background: #2d3748;
        color: white;
    }
    
    .tpr-mobile-table tr {
        border-color: rgba(74, 85, 104, 0.2);
    }
    
    .tpr-mobile-table tr:hover {
        background: rgba(151, 38, 109, 0.1);
    }
}