/* ==========================================================================
   Tocco License DataTable - Styling
   Matches the form-control / pagination style from the existing site design.
   ========================================================================== */

/* Loading state */
.tocco-license-loading {
    text-align: center;
    padding: 40px 0;
}

.tocco-license-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #dcddde;
    border-top-color: #000;
    border-radius: 50%;
    animation: tocco-spin 0.8s linear infinite;
}

@keyframes tocco-spin {
    to { transform: rotate(360deg); }
}

/* Error state */
.tocco-license-error {
    text-align: center;
    padding: 40px 0;
    color: #c00;
    font-size: 16px;
}

/* Table wrapper */
.tocco-license-table {
    width: 100%;
    margin: 20px 0;
}

/* ==========================================================================
   Controls (canton dropdown + search input)
   Styled like .form-control: border: 1px solid #000, border-radius: 0, height: 40px
   ========================================================================== */

.tocco-license-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

/* Filter group — keeps canton + language dropdowns together on the left */
.tocco-license-filter-group {
    display: flex;
    gap: 10px;
    flex: 0 0 auto;
}

/* Dropdown filters (canton + language) */
.tocco-license-canton-filter,
.tocco-license-language-filter {
    border: 1px solid #000;
    border-radius: 0;
    box-shadow: none;
    height: 40px;
    padding: 5px 10px;
    font-size: 14px;
    background: #fff;
    color: #000;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: url("../Images/am-suisse_x1.png") no-repeat center center;
    background-position: 100% -190px;
    background-size: 33px, 30px;
    background-color: #fff;
    padding-right: 45px;
    width: auto;
}

.tocco-license-canton-filter:focus,
.tocco-license-language-filter:focus {
    outline: none;
    border-color: #000;
}

/* Search input — remove "Suchen:" label, use placeholder */
.tocco-license-controls .dataTables_filter {
    flex: 0 0 auto;
}

.tocco-license-controls .dataTables_filter label {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 0;
}

.tocco-license-controls .dataTables_filter input {
    border: 1px solid #000;
    border-radius: 0;
    box-shadow: none;
    height: 40px;
    padding: 5px 10px;
    font-size: 14px;
    color: #000;
    background: #fff;
    width: 220px;
    margin-left: 0;
}

.tocco-license-controls .dataTables_filter input:focus {
    outline: none;
    border-color: #000;
}

/* ==========================================================================
   Table styling — white background, black text, 1px black row borders
   ========================================================================== */

table.tocco-license-dt {
    border-collapse: collapse;
    width: 100%;
    font-size: 16px;
    background: #fff;
    table-layout: fixed;
}

/* Fixed column widths (desktop) */
table.tocco-license-dt thead th:nth-child(1),
table.tocco-license-dt tbody td:nth-child(1) { width: 60px; }  /* Kanton — max 2 chars */
table.tocco-license-dt thead th:nth-child(2),
table.tocco-license-dt tbody td:nth-child(2) { width: 80px; }  /* FB-Nr. — max 6 chars */
table.tocco-license-dt thead th:nth-child(3),
table.tocco-license-dt tbody td:nth-child(3) { width: auto; }  /* Unternehmen — fills remaining */
table.tocco-license-dt thead th:nth-child(4),
table.tocco-license-dt tbody td:nth-child(4) { width: 230px; } /* Adresse — street + zip/city */

/* Header: white bg, black text, bottom border */
table.tocco-license-dt thead th {
    background: #fff;
    color: #000;
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    border-bottom: 1px solid rgba(0, 0, 0, 1) !important;
    white-space: nowrap;
    overflow: hidden;
}

/* Body cells */
table.tocco-license-dt tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #000;
    vertical-align: top;
    color: #000;
    background: #fff;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal !important;
}

/* Override DataTables stripe, hover, shadow — all white, no effects */
table.tocco-license-dt tbody tr.odd td,
table.tocco-license-dt tbody tr.even td,
table.tocco-license-dt tbody tr:hover td,
table.tocco-license-dt.stripe tbody tr.odd td,
table.tocco-license-dt.stripe tbody tr.even td,
table.tocco-license-dt tbody tr:hover > * {
    background: #fff !important;
    box-shadow: none !important;
}

/* Remove DataTables default sorting icons (sorting is disabled) */
table.tocco-license-dt thead .sorting::before,
table.tocco-license-dt thead .sorting::after,
table.tocco-license-dt thead .sorting_asc::before,
table.tocco-license-dt thead .sorting_asc::after,
table.tocco-license-dt thead .sorting_desc::before,
table.tocco-license-dt thead .sorting_desc::after {
    display: none !important;
    content: none !important;
}

table.tocco-license-dt thead th {
    padding-right: 12px !important;
}

/* ==========================================================================
   Footer (info + pagination)
   Pagination styled like the existing .pagination on the site:
   inline items, no borders, plain text, bold for current page.
   ========================================================================== */

.tocco-license-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    font-size: 14px;
}

.tocco-license-footer .dataTables_info {
    flex: 0 0 auto;
    color: #000;
}

/* Pagination — matches existing .pagination styling */
.tocco-license-footer .dataTables_paginate {
    flex: 0 0 auto;
    padding-left: 0;
}

.tocco-license-footer .dataTables_paginate .paginate_button {
    display: inline;
    padding: 0;
    padding-right: 7px;
    margin: 0;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    background: none;
    background-color: #fff;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    float: none;
}

.tocco-license-footer .dataTables_paginate .paginate_button:hover {
    background: none;
    background-color: #fff;
    border: 0;
    color: #000;
}

.tocco-license-footer .dataTables_paginate .paginate_button.current,
.tocco-license-footer .dataTables_paginate .paginate_button.current:hover {
    background: none;
    background-color: #fff;
    color: #000;
    border: 0;
    border-color: transparent;
    font-weight: bold;
    cursor: default;
}

.tocco-license-footer .dataTables_paginate .paginate_button.disabled,
.tocco-license-footer .dataTables_paginate .paginate_button.disabled:hover {
    cursor: default;
    color: #000;
    opacity: 0.3;
}

/* Previous/Next arrows — use sprite image like existing pagination */
.tocco-license-footer .dataTables_paginate .paginate_button.previous,
.tocco-license-footer .dataTables_paginate .paginate_button.next {
    font-size: 0;
    color: transparent;
    font-weight: bold;
    position: relative;
    padding-right: 7px;
    width: 14px;
    height: 14px;
}

.tocco-license-footer .dataTables_paginate .paginate_button.previous::before {
    content: "<";
    font-size: 14px;
    color: transparent;
    background: url("../Images/am-suisse_x1.png") no-repeat center center;
    background-position: 0 -232px;
}

.tocco-license-footer .dataTables_paginate .paginate_button.next::after {
    content: ">";
    font-size: 14px;
    color: transparent;
    background: url("../Images/am-suisse_x1.png") no-repeat center center;
    background-position: 0 -284px;
    padding-left: 2px;
}

.tocco-license-footer .dataTables_paginate .paginate_button.previous:hover,
.tocco-license-footer .dataTables_paginate .paginate_button.next:hover {
    background: none;
    background-color: #fff;
}

.tocco-license-footer .dataTables_paginate .paginate_button.previous.disabled,
.tocco-license-footer .dataTables_paginate .paginate_button.next.disabled {
    opacity: 0.3;
}

/* Responsive: remove list bullets from expanded child rows */
table.tocco-license-dt > tbody > tr.child ul.dtr-details {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

table.tocco-license-dt > tbody > tr.child ul.dtr-details > li {
    list-style-type: none;
    padding: 4px 0;
    border-bottom: none;
}

table.tocco-license-dt > tbody > tr.child ul.dtr-details > li .dtr-title {
    display: block;
}

.content-wrapper table.tocco-license-dt > tbody > tr.child ul.dtr-details > li:before {
    content: none;
    display: none;
}

/* Responsive: stacked layout on small screens */
@media screen and (max-width: 767px) {
    .tocco-license-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .tocco-license-filter-group {
        flex-direction: column;
        width: 100%;
    }

    .tocco-license-canton-filter,
    .tocco-license-language-filter,
    .tocco-license-controls .dataTables_filter input {
        width: 100%;
        box-sizing: border-box;
        padding: 7px 10px!important;
    }

    .tocco-license-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    table.tocco-license-dt thead th {
        white-space: normal;
    }
}
