/**
 * Frontend-Styles für Spenden-Liste Block
 *
 * @package RG\FundraisingBox\Integration
 */

/* Block-Container */
.rg-fundraisingbox-donations-list {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: hidden;
}

/* Table Wrapper für horizontales Scrollen */
.rg-fundraisingbox-donations-list .table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rg-fundraisingbox-donations-list .search-wrapper {
    margin-bottom: 1rem;
    text-align: right;
}

.rg-fundraisingbox-donations-list .donations-search {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.rg-fundraisingbox-donations-list .donations-search:focus {
    outline: none;
    border-color: #0073aa;
}

/* Tabelle */
.rg-fundraisingbox-donations-list .donations-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.rg-fundraisingbox-donations-list .donations-table th,
.rg-fundraisingbox-donations-list .donations-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.rg-fundraisingbox-donations-list .donations-table th:first-of-type {
    text-align: center;
}

.rg-fundraisingbox-donations-list .donations-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

/* Spalten-spezifische Styles */
.rg-fundraisingbox-donations-list .rank-col,
.rg-fundraisingbox-donations-list .donations-table .rank {
    width: 60px;
    text-align: center;
}

.rg-fundraisingbox-donations-list .gemeinde-col,
.rg-fundraisingbox-donations-list .donations-table .gemeinde-name {
    width: auto;
}

.rg-fundraisingbox-donations-list .baeume-col,
.rg-fundraisingbox-donations-list .donations-table .anzahl-baeume {
    width: 190px;
}

/* Zeilen-Hover-Effekt */
.rg-fundraisingbox-donations-list .donation-item {
    transition: background-color 0.3s ease;
}

.rg-fundraisingbox-donations-list .donation-item:hover {
    background-color: #f9f9f9;
}

/* Fehlermeldung */
.rg-fundraisingbox-error {
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    color: #721c24;
    font-weight: 500;
}

/* Mobile: Card-Layout */
@media screen and (max-width: 768px) {
    .rg-fundraisingbox-donations-list .donations-table {
        table-layout: auto;
    }

    .rg-fundraisingbox-donations-list .donations-table thead {
        display: none;
    }

    .rg-fundraisingbox-donations-list .donations-table,
    .rg-fundraisingbox-donations-list .donations-table tbody,
    .rg-fundraisingbox-donations-list .donations-table tr,
    .rg-fundraisingbox-donations-list .donations-table td {
        display: block;
        width: 100%;
    }

    .rg-fundraisingbox-donations-list .donations-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-left: 4px solid rgba(136, 178, 37, 1);
        border-radius: 4px;
        padding: 10px;
        background-color: #f9f9f9;
    }

    .rg-fundraisingbox-donations-list .donations-table tr:hover {
        background-color: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .rg-fundraisingbox-donations-list .donations-table td {
        padding: 8px 10px;
        border-bottom: none;
        position: relative;
        padding-left: 50%;
        min-height: 2.5em;
    }

    .rg-fundraisingbox-donations-list .donations-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        top: 8px;
        width: calc(50% - 20px);
        font-weight: 600;
        text-align: left;
        word-wrap: break-word;
        overflow-wrap: break-word;
        white-space: normal;
        hyphens: auto;
    }

    .rg-fundraisingbox-donations-list .donations-table .anzahl-baeume {
        width: auto;
    }
}

@media screen and (min-width: 768px) {
    .rg-fundraisingbox-donations-list .donations-search {
        max-width: 50%;
    }
}
