/* German Language Specific Fixes */

/* NO SCROLL - Tables must fit in view */
.table-responsive {
    overflow-x: visible !important;
}

/* Force table cells to wrap text instead of expanding */
.table th,
.table td {
    word-break: break-word !important;
    word-wrap: break-word !important;
    hyphens: auto;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    white-space: normal !important;
    max-width: 150px;
    min-width: 50px;
}

/* Specific fix for admin users table */
.admin-users-table th:nth-child(7), /* Weiterleitungs-URL column */
.admin-users-table td:nth-child(7) {
    max-width: 150px;
    word-wrap: break-word;
}

.admin-users-table th:nth-child(8), /* Bevorzugte Sprache column */
.admin-users-table td:nth-child(8) {
    max-width: 120px;
}

/* Fix for admin products table */
.admin-products-table {
    table-layout: fixed;
    width: 100%;
}

.admin-products-table th,
.admin-products-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ensure action buttons are always visible */
.admin-actions {
    min-width: 150px;
    text-align: right;
    position: sticky;
    right: 0;
    background: white;
    z-index: 10;
}

/* Fix for long German button text */
.btn-group .btn {
    white-space: normal !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    line-height: 1.2;
}

/* Specific fix for Verwaltung von QR button */
html[lang="de"] .btn-secondary {
    max-width: 120px;
    font-size: 0.8rem;
}

/* Fix for modal buttons with long text */
.modal-footer .btn {
    min-width: auto;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
}

/* German language specific adjustments */
html[lang="de"] .table {
    font-size: 0.95rem;
}

html[lang="de"] .btn {
    font-size: 0.9rem;
    padding: 0.375rem 0.75rem;
}

/* Fix for admin map cards */
html[lang="de"] .location-card {
    font-size: 0.9rem;
}

html[lang="de"] .location-card h5 {
    font-size: 1rem;
}

/* Equal height for stats cards */
html[lang="de"] .stats-card,
html[lang="de"] .stat-card,
html[lang="de"] .dashboard-stat-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

html[lang="de"] .stats-card .card-body,
html[lang="de"] .stat-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Responsive table wrapper */
@media (max-width: 1400px) {
    html[lang="de"] .table-container {
        overflow-x: auto;
        margin: 0 -15px;
        padding: 0 15px;
    }

    html[lang="de"] .table {
        min-width: 1000px;
    }
}

/* Fix specific German translation issues */
html[lang="de"] .crud-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
}

html[lang="de"] .crud-buttons .btn {
    flex-shrink: 0;
}

/* Fix footer spacing on scan page */
html[lang="de"] .scan-page main,
html[lang="de"] main.flex-grow-1 {
    min-height: calc(100vh - 200px);
    padding-bottom: 50px;
}

/* Ensure footer stays at bottom */
html[lang="de"] footer {
    margin-top: auto !important;
}