/**
 * EasyBill Integration - Frontend Styles
 */

.easybill-container {
    margin: 20px 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.easybill-section {
    margin-bottom: 40px;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.easybill-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4em;
    color: #1d2327;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.easybill-section h4 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.2em;
    color: #1d2327;
}

.easybill-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    overflow: hidden;
}

.easybill-table thead {
    background: #f6f7f7;
}

.easybill-table thead th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #1d2327;
    border-bottom: 1px solid #e2e4e7;
    white-space: nowrap;
}

.easybill-table tbody tr {
    transition: background-color 0.2s ease;
}

.easybill-table tbody tr:hover {
    background-color: #f0f6fc;
}

.easybill-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid #f0f0f1;
}

.easybill-table tbody td {
    padding: 12px 15px;
    font-size: 14px;
    color: #50575e;
    vertical-align: middle;
}

.easybill-table tbody td:first-child {
    font-weight: 500;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
    .easybill-table {
        font-size: 13px;
    }

    .easybill-table thead {
        display: none;
    }

    .easybill-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e2e4e7;
        border-radius: 4px;
        padding: 10px;
    }

    .easybill-table tbody td {
        display: block;
        text-align: left;
        padding: 8px 10px;
        position: relative;
        border: none;
    }

    .easybill-table tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        display: inline-block;
        min-width: 120px;
        margin-right: 10px;
        color: #1d2327;
    }

    .easybill-table tbody td:first-child {
        border-top: none;
    }

    .easybill-table tbody td:last-child {
        border-bottom: none;
    }
}

/* Status-Indikatoren */
.easybill-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.easybill-status.status-active {
    background: #d4f4dd;
    color: #00a32a;
}

.easybill-status.status-inactive {
    background: #fef1f1;
    color: #d63638;
}

/* Loading States */
.easybill-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.easybill-loading:before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: easybill-spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes easybill-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Messages */
.easybill-error {
    background: #fef1f1;
    border-left: 4px solid #d63638;
    padding: 12px;
    margin: 20px 0;
    border-radius: 4px;
    color: #d63638;
}

/* Empty States */
.easybill-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: #f6f7f7;
    border-radius: 4px;
}

.easybill-empty:before {
    content: "📊";
    display: block;
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* Number Formatting */
.easybill-number {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.easybill-currency {
    font-weight: 600;
    color: #1d2327;
}

/* Lagerbestand Farbcodierung */
.easybill-stock {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 13px;
    cursor: help;
}

.easybill-stock.stock-red {
    background: #fef1f1;
    color: #d63638;
    border: 1px solid #d63638;
}

.easybill-stock.stock-yellow {
    background: #fcf9e8;
    color: #dba617;
    border: 1px solid #dba617;
}

.easybill-stock.stock-green {
    background: #d4f4dd;
    color: #00a32a;
    border: 1px solid #00a32a;
}

/* Zeitraum-Filter */
.easybill-filter {
    margin-bottom: 20px;
    padding: 15px;
    background: #f6f7f7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.easybill-filter label {
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

.easybill-period-filter {
    padding: 8px 12px;
    border: 1px solid #e2e4e7;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 180px;
}

.easybill-period-filter:hover {
    border-color: #0073aa;
}

.easybill-period-filter:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.easybill-loading-text {
    color: #0073aa;
    font-style: italic;
    animation: pulse 1.5s infinite;
}

/* Sortier-Indikatoren */
.easybill-table thead th.sort-asc:after {
    content: " ↑";
    color: #0073aa;
}

.easybill-table thead th.sort-desc:after {
    content: " ↓";
    color: #0073aa;
}

.easybill-table thead th[style*="cursor: pointer"]:hover {
    background: #e5f3ff;
    transition: background-color 0.2s ease;
}

/* Cache-Info Styling */
.easybill-cache-info {
    background: #f0f6fc;
    border: 1px solid #0073aa;
    border-radius: 4px;
    padding: 10px;
    margin: 15px 0;
    font-size: 13px;
    color: #0073aa;
}

/* Sortier-Filter */
.easybill-sort-filter {
    margin: 15px 0;
    padding: 10px;
    background: #f6f7f7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.easybill-sort-filter label {
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

.easybill-sort-filter .button {
    margin: 0 2px;
}

.easybill-sort-filter .button-primary {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* Responsive Design für Filter */
@media screen and (max-width: 782px) {
    .easybill-filter,
    .easybill-sort-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .easybill-period-filter {
        width: 100%;
        max-width: none;
    }

    .easybill-sort-filter {
        align-items: stretch;
    }

    .easybill-sort-filter .button {
        margin: 2px 0;
        text-align: center;
    }
}