/* Custom styles beyond bootstrap */

/* Override text-muted with text-secondary for better contrast in light theme */
.text-muted, span.text-muted {
    color: #71787e !important;
}

/* Einfaches Kurvendiagramm für API-Aufrufe */
.api-curve-chart {
    position: relative;
    width: 100%;
    height: 200px;
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.api-curve-grid {
    position: absolute;
    height: 100%;
    width: 100%;
    border-bottom: 1px solid rgba(108, 117, 125, 0.2);
}

.api-curve-grid-line {
    position: absolute;
    width: 100%;
    left: 0;
    border-top: 1px dotted rgba(108, 117, 125, 0.1);
}

.api-curve-line {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.api-curve-point {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #007bff;
    transform: translate(-50%, -50%);
}

.api-curve-label {
    position: absolute;
    bottom: -20px;
    font-size: 10px;
    color: #6c757d;
    transform: translateX(-50%);
    text-align: center;
}

.api-curve-value {
    position: absolute;
    top: -20px;
    font-size: 10px;
    color: #6c757d;
    transform: translateX(-50%);
    text-align: center;
}

.api-curve-path {
    fill: none;
    stroke: #007bff;
    stroke-width: 2px;
}

/* Layout styling */
#sidebar {
    width: 250px;
    min-width: 250px;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 1000;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: #262626 !important;
}

#sidebar.bg-primary {
    background-color: #262626 !important;
}

/* Blaue Kopfzeile für die Seitenleiste */
#sidebar .px-3.py-2.mb-4 {
    background-color: #0d6efd !important;
    margin-bottom: 0 !important;
    padding-top: 0.7rem !important;
    padding-bottom: 0.7rem !important;
    height: 56px !important; /* Anpassung der Höhe für Bündigkeit mit dem Dialog-Header */
    display: flex;
    align-items: center;
}

#content {
    width: calc(100% - 250px);
    min-height: 100vh;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}

/* Burger Menü Styles */
.burger-menu {
    display: none;
    margin-right: 15px;
    cursor: pointer;
    width: 25px;
    height: 20px;
    position: relative;
}

.burger-menu span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.burger-menu span:nth-child(1) {
    top: 0;
}

.burger-menu span:nth-child(2) {
    top: 9px;
}

.burger-menu span:nth-child(3) {
    top: 18px;
}

/* Animation für das Burger-Menü */
.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 9px;
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 9px;
}

/* Responsive-Styles */
@media (max-width: 992px) {
    .burger-menu {
        display: flex;
    }
    
    #sidebar {
        margin-left: 0;
    }
    
    body.sidebar-collapsed #sidebar {
        margin-left: -250px;
    }
    
    body.sidebar-collapsed #content {
        width: 100%;
    }
}

/* Zusätzliche Klasse für mobile Seitenleiste */
@media (max-width: 576px) {
    #sidebar {
        position: fixed;
    }
    
    body:not(.sidebar-collapsed) #content::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
}

/* Desktop-Verhalten */
@media (min-width: 993px) {
    body.sidebar-collapsed #sidebar {
        margin-left: -250px;
    }
    
    body.sidebar-collapsed #content {
        width: 100%;
    }
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    color: #fff;
}

#sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
    position: relative;
}

/* Überschreibe die blaue Sidebar mit grauer Farbe */
#sidebar.bg-primary, .bg-primary {
    background-color: #262626 !important;
}

/* Blauer Header für die Seitenleiste */
#sidebar .px-3.py-2.mb-4.text-center {
    background-color: #0d6efd !important;
    padding: 15px !important;
    margin-bottom: 0 !important;
}

#sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
}

#sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 4px solid #0d6efd;
    font-weight: bold;
    padding-left: 8px !important;
}

/* Card styling */
.card {
    border-color: rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.section-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Table styling */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table th {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.table td {
    border-color: rgba(0, 0, 0, 0.1);
}

/* Verbesserte Tabellensteuerung für horizontales Scrollen - vereinfachte Version */
.table-responsive {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin-bottom: 1rem;
}

/* Überschreibung für Tabellen, insbesondere für Gewerbemeldungen */
#notifications-table {
    min-width: 1400px !important; /* Sicherstellen einer Mindestbreite */
}

/* Allgemeine Tabellenverbesserungen */
.table-responsive .table {
    min-width: 100%;
}

/* Textformatierung in Zellen */
.table-responsive .table td, 
.table-responsive .table th {
    white-space: nowrap;
}

/* Kritisches Styling für Dropdown-Menüs in Tabellen */
.table-responsive .dropdown-menu {
    margin: 0 !important;
    padding: 0.5rem !important;
    min-width: 10rem !important;
    background-color: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    border-radius: 0.25rem !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175) !important;
}

/* Für korrekte Positionierung in Tabellen-Zellen */
.table-responsive .dropdown {
    position: static !important;
}

/* Der Dropdown-Container in der sticky Spalte */
.table-responsive td:last-child .dropdown {
    position: static !important;
}

/* Das Menu wird mit JavaScript positioniert */
.table-responsive .dropdown-menu.show {
    display: block !important;
}

/* Dropdown-Toggle-Button verbessern */
.table-responsive .dropdown-toggle::after {
    display: inline-block !important;
    margin-left: 0.255em !important;
    vertical-align: 0.255em !important;
    content: "" !important;
    border-top: 0.3em solid !important;
    border-right: 0.3em solid transparent !important;
    border-bottom: 0 !important;
    border-left: 0.3em solid transparent !important;
}

/* Links und Einträge im Dropdown-Menü anklickbar machen */
.table-responsive .dropdown-menu a,
.table-responsive .dropdown-item {
    display: block !important;
    width: 100% !important;
    padding: 0.25rem 1.5rem !important;
    clear: both !important;
    font-weight: 400 !important;
    color: #212529 !important;
    text-align: inherit !important;
    white-space: nowrap !important;
    background-color: transparent !important;
    border: 0 !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.table-responsive .dropdown-menu a:hover,
.table-responsive .dropdown-item:hover {
    color: #16181b !important;
    text-decoration: none !important;
    background-color: #f8f9fa !important;
}

/* Die letzte Spalte (Aktionen) sticky machen */
.table-responsive .table tr th:last-child,
.table-responsive .table tr td:last-child {
    position: sticky !important;
    right: 0 !important;
    background-color: #fff !important; /* Hintergrundfarbe für sticky-Element */
    box-shadow: -2px 0 5px rgba(0,0,0,0.1) !important; /* Schatten für bessere Sichtbarkeit */
    z-index: 2 !important; /* Höherer z-index als normale Zellen */
    min-width: 100px !important; /* Minimale Breite für die Aktionen-Spalte */
}

/* Direktes Aktionen-Buttons-Styling */
.action-buttons-cell .btn {
    padding: 0.175rem 0.5rem !important;
    font-size: 0.875rem !important;
    border-radius: 0.2rem !important;
}

/* Button Hover-Effekte */
.action-buttons-cell .btn:hover {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    transform: translateY(-1px) !important;
    transition: all 0.2s ease !important;
}

/* Detail sections */
.detail-section {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.detail-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.detail-section-title {
    font-weight: 500;
    margin-bottom: 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.detail-label {
    font-weight: 500;
    color: rgba(0, 0, 0, 0.7);
}

.detail-value {
    text-align: right;
}

/* Progress bars styling */
.progress {
    background-color: rgba(0, 0, 0, 0.1);
    height: 0.75rem;
    border-radius: 0.375rem;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
    font-weight: bold;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

/* Form styling */
.form-control, .form-select {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.2);
    color: #212529;
}

.form-control:focus, .form-select:focus {
    background-color: #ffffff;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    color: #212529;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 4px;
}

/* Badge styling */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Loading spinner animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-border {
    animation: spin 1s linear infinite;
}

/* Status indicators */
.status-high {
    color: #20c997;
}

.status-medium {
    color: #fd7e14;
}

.status-low {
    color: #dc3545;
}

/* Utilities */
.border-light-subtle {
    border-color: rgba(0, 0, 0, 0.1) !important;
}

.text-light-subtle {
    color: rgba(0, 0, 0, 0.6) !important;
}

.bg-light-subtle {
    background-color: #f8f9fa !important;
}

.bg-white {
    background-color: #ffffff !important;
}

/* Statistik-Icons und Zahlen */
.stats-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    font-size: 1.1rem;
}

.stats-number {
    font-size: 1.5rem;
    font-weight: 500;
}

.stats-label {
    font-size: 0.875rem;
}

/* Batch-Klassifizierung Styles */
.batch-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 28px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.batch-item i {
    margin-right: 0.25rem;
}

.batch-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
}

.icon-shape {
    width: 35px;
    height: 35px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Animation für Batch-Verarbeitung */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

.processing-pulse {
    animation: pulse 1.5s infinite;
}

/* Parallele Verarbeitung Anzeige */
#parallel-processing-items {
    min-height: 60px;
}
