/* Custom Styles für DataBackend */

/* Theme variables are now defined in main.ejs and override Bootstrap colors */

/* Modern Header Styles */
.modern-header {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--primary-color, #007bff);
    border-radius: 0;
    padding: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
    margin-top: 0;
    box-shadow: none;
    position: relative;
    overflow: hidden;
}

.modern-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.05) 0%, transparent 50%, rgba(255,255,255,0.02) 100%);
    pointer-events: none;
}

.modern-header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.modern-header-title {
    color: var(--primary-color, #007bff);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: none;
}

.modern-header-title i {
    font-size: 1.25rem;
    opacity: 0.9;
}

.modern-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.modern-header-tag {
    background: rgba(0, 123, 255, 0.1);
    color: var(--primary-color, #007bff);
    padding: 0.375rem 0.75rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--primary-color, #007bff);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.3s ease;
}

.modern-header-tag:hover {
    background: rgba(0, 123, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modern-header-btn {
    background: rgba(0, 123, 255, 0.1) !important;
    color: var(--primary-color, #007bff) !important;
    border: 1px solid var(--primary-color, #007bff) !important;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.modern-header-btn:hover {
    background: rgba(0, 123, 255, 0.2) !important;
    color: var(--primary-color, #007bff) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.modern-header-btn i {
    font-size: 0.875rem;
}

/* Einheitliche Header-Farben - transparent mit Primary Color Border */
.modern-header {
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid var(--primary-color, #007bff) !important;
}

.modern-header-title {
    color: var(--primary-color, #007bff) !important;
}

.modern-header-tag {
    background: rgba(0, 123, 255, 0.1) !important;
    color: var(--primary-color, #007bff) !important;
    border-color: var(--primary-color, #007bff) !important;
}

.modern-header-tag:hover {
    background: rgba(0, 123, 255, 0.2) !important;
}


/* Layout-Optimierungen für minimalen Platz oberhalb der Header */
.content-wrapper {
    padding-top: 10px !important;
    margin-top: 0 !important;
}

.content-wrapper .container-fluid {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Reduziere Abstände im Main-Content-Bereich */
main.px-md-4 {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Reduziere Abstände bei Breadcrumbs */
.breadcrumb {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Reduziere Abstände bei allen Container-Elementen */
.container-fluid {
    padding-top: 0 !important;
}

/* Spezifisch für Seiten mit modernen Headern */
.content-wrapper .container-fluid:first-child {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modern-header {
        padding: 0.5rem 1rem;
        margin-bottom: 1rem;
        margin-top: 0;
    }
    
    .modern-header-title {
        font-size: 1.25rem;
    }
    
    .modern-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .modern-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Filter Styles */
.filter-card {
    border-left: 4px solid var(--primary-color);
    background-color: #f8f9fa;
}

.filter-card .form-check-label {
    font-weight: 500;
    color: #495057;
}

.filter-card .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.filter-status {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Collapsible Filter Styles */
.filter-toggle-container {
    margin-bottom: 0.5rem;
}

.filter-toggle-btn {
    width: 100%;
    text-align: left;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-toggle-btn:hover {
    background-color: #e9ecef;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-toggle-btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-color: var(--primary-color);
}

.filter-toggle-btn[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.filter-toggle-btn .bi-chevron-down {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

/* Collapse Animation */
.collapse {
    transition: height 0.35s ease;
}

.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* Button Badge Styles */
.btn .badge {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Filter Radio Button Styles */
.filter-card .form-check {
    margin-bottom: 0.25rem;
}

.filter-card .form-check-label {
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-card .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Sidebar */
.sidebar {
    position: fixed !important;
    top: 56px !important; /* Height of navbar */
    bottom: 0 !important;
    left: 0 !important;
    z-index: 1000 !important;
    padding: 48px 0 0 !important;
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1) !important;
    transition: transform 0.3s ease !important;
    width: 250px !important;
    background-color: #f8f9fa !important;
    border-right: 1px solid #dee2e6 !important;
    transform: translateX(-100%) !important; /* Standardmäßig eingeklappt */
}

.sidebar.collapsed {
    transform: translateX(-100%) !important;
}

.sidebar.expanded {
    transform: translateX(0) !important;
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #333;
}

.sidebar .nav-link:hover {
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    color: var(--primary-color);
    background-color: rgba(13, 110, 253, 0.1);
}

/* Main content */
main {
    margin-top: 56px !important; /* Height of navbar */
    margin-left: 0 !important; /* Standardmäßig kein linker Rand */
    transition: margin-left 0.3s ease !important;
    min-height: calc(100vh - 56px) !important;
}

main.sidebar-expanded {
    margin-left: 250px !important; /* Width of sidebar when expanded */
}

/* Editable fields */
.editable {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.editable:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

.editable.editing {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
}

.editable input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 2px 4px;
}

.editable input:focus {
    outline: none !important;
    background-color: white !important;
    border: 1px solid var(--primary-color) !important;
    border-radius: 3px !important;
    box-shadow: none !important;
}

/* Bootstrap Focus-Styles überschreiben */
.editable input.form-control:focus {
    border-color: var(--primary-color) !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Zeilenvergrößerung verhindern */
.editable input {
    height: auto !important;
    min-height: auto !important;
    line-height: normal !important;
    padding: 2px 4px !important;
    margin: 0 !important;
    vertical-align: baseline !important;
}

/* Gelbe Balken entfernen */
.editable input.form-control-sm:focus {
    border-color: var(--primary-color) !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Alle Bootstrap Focus-Effekte für editierbare Felder entfernen */
.editable input:focus,
.editable input.form-control:focus,
.editable input.form-control-sm:focus,
.editable input[type="text"]:focus,
.editable input[type="number"]:focus,
.editable input[type="date"]:focus {
    border-color: var(--primary-color) !important;
    box-shadow: none !important;
    outline: none !important;
    background-color: white !important;
}

/* Zeilen-Höhe konstant halten */
.table td {
    vertical-align: middle;
    font-size: 0.9rem;
    height: auto !important;
    min-height: auto !important;
}

/* Editierbare Zellen - konstante Spaltenbreiten */
.table td .editable {
    display: block;
    width: 100%;
    min-height: 1.2em;
    box-sizing: border-box;
}

.table td .editable input {
    display: block;
    width: 100%;
    height: 1.2em !important;
    min-height: 1.2em !important;
    max-height: 1.2em !important;
    line-height: 1.2em !important;
    padding: 0 4px !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    font-size: inherit !important;
    box-sizing: border-box !important;
}

.table td .editable input:focus {
    border: 1px solid var(--primary-color) !important;
    background: white !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 3px !important; /* 1px weniger wegen Border */
    box-sizing: border-box !important;
}

/* Table improvements */
.table th {
    border-top: none;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table td {
    vertical-align: middle;
    font-size: 0.9rem;
}

/* Tabellenlayout stabilisieren - verhindert Spaltenbreiten-Änderungen */
.table {
    table-layout: fixed;
}

.table td {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.table td .editable {
    white-space: normal;
    overflow: visible;
}

.table td .editable input {
    white-space: normal;
    overflow: visible;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Badge improvements */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Button improvements */
.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Einheitliche Button-Styles - alle Buttons verwenden outline-primary Design */
.btn-outline-primary {
    color: var(--primary-color, #007bff) !important;
    border-color: var(--primary-color, #007bff) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color, #007bff) !important;
    border-color: var(--primary-color, #007bff) !important;
    color: var(--primary-text-color, #ffffff) !important;
}

.btn-outline-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

.btn-outline-primary:active,
.btn-outline-primary.active {
    background-color: var(--primary-color, #007bff) !important;
    border-color: var(--primary-color, #007bff) !important;
    color: var(--primary-text-color, #ffffff) !important;
}

/* Toast improvements */
.toast {
    min-width: 300px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Workflow buttons */
.workflow-btn {
    position: relative;
    overflow: hidden;
}

.workflow-btn.loading {
    color: transparent;
}

.workflow-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Responsive improvements */
@media (max-width: 767.98px) {
    .sidebar {
        top: 56px;
        width: 100%;
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    main {
        margin-top: 56px;
        margin-left: 0;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
    }
    
    /* Filter responsive styles */
    .filter-toggle-btn {
        font-size: 0.875rem;
        padding: 0.4rem 0.6rem;
    }
    
    .filter-toggle-btn span {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100% - 40px);
    }
    
    .filter-card .form-check-label {
        font-size: 0.85rem;
    }
    
    .filter-card .form-check {
        margin-bottom: 0.2rem;
    }
}

/* Breadcrumb improvements */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--secondary-color);
}

/* Search improvements */
.input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Status indicators */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-indicator.success {
    background-color: var(--success-color);
}

.status-indicator.warning {
    background-color: var(--warning-color);
}

.status-indicator.danger {
    background-color: var(--danger-color);
}

.status-indicator.info {
    background-color: var(--info-color);
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Toggle-Funktionalität */
.pruefen-toggle,
.jtl-plausibel-toggle,
.abgeschlossen-toggle {
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    display: inline-block;
}

.pruefen-toggle:hover,
.jtl-plausibel-toggle:hover,
.abgeschlossen-toggle:hover {
    background-color: rgba(0, 123, 255, 0.1);
    transform: scale(1.05);
}

.pruefen-toggle:active,
.jtl-plausibel-toggle:active,
.abgeschlossen-toggle:active {
    transform: scale(0.95);
}

.pruefen-toggle .badge,
.jtl-plausibel-toggle .badge,
.abgeschlossen-toggle .badge {
    transition: all 0.2s ease;
}

/* Toast-Styles */
.alert.position-fixed {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 0.5rem;
}

/* Klickbare Abschnitte-Badges */
.sections-link {
    transition: all 0.2s ease !important;
    display: inline-block !important;
}

.sections-link:hover {
    background-color: #0aa2c0 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.sections-link:active {
    transform: scale(0.95) !important;
}

/* Klickbare Positionen-Badges */
.positions-link {
    transition: all 0.2s ease !important;
    display: inline-block !important;
}

.positions-link:hover {
    background-color: #0aa2c0 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.positions-link:active {
    transform: scale(0.95) !important;
}

/* Sticky Table Headers - Global */
.table-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

.table-container .table {
    margin-bottom: 0;
}

.table-container .table thead th {
    position: sticky;
    top: 0;
    background-color: var(--primary-color);
    color: var(--primary-text-color, #ffffff);
    z-index: 10;
    border-bottom: 2px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Responsive Anpassungen für Sticky Tables */
@media (max-width: 768px) {
    .table-container {
        max-height: calc(100vh - 150px);
    }
}

/* Floating Action Button (FAB) für ASK Module */
.fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.fab:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.fab:active {
    transform: scale(0.95);
}

.fab:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* FAB Animation */
.fab {
    animation: fabPulse 2s infinite;
}

@keyframes fabPulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 10px rgba(13, 110, 253, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

/* FAB Responsive */
@media (max-width: 768px) {
    .fab {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
}

/* FAB Tooltip */
.fab-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.fab-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
}

.fab:hover .fab-tooltip {
    opacity: 1;
    visibility: visible;
}

/* FAB Hidden State */
.fab.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
}

/* ASK Popup Styles */
.ask-popup {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    user-select: none;
}

/* Draggable Header */
.ask-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: move;
    user-select: none;
}

.ask-popup-header.dragging {
    cursor: grabbing;
}

.ask-popup-header:active {
    cursor: grabbing;
}

.ask-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Drag Indicator */
.ask-popup-header::before {
    content: '⋮⋮';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.7;
    letter-spacing: 2px;
}

.ask-popup-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.ask-popup-title i {
    font-size: 1.2rem;
}

.ask-popup-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ask-popup-control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    opacity: 0.8;
    position: relative;
    z-index: 10;
}

.ask-popup-control-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.ask-popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 10;
}

.ask-popup-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.ask-popup-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ask-popup-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ask-welcome-message {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Bubbles */
.ask-message {
    display: flex;
    margin-bottom: 12px;
    animation: messageSlideIn 0.3s ease-out;
}

.ask-message.user {
    justify-content: flex-end;
}

.ask-message.bot {
    justify-content: flex-start;
}

.ask-message-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
}

.ask-message.user .ask-message-bubble {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 4px;
}

.ask-message.bot .ask-message-bubble {
    background: #f1f3f4;
    color: #333;
    border-bottom-left-radius: 4px;
}

.ask-message-time {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.ask-message.bot .ask-message-time {
    text-align: left;
}

/* Message Animation */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll to bottom indicator */
.ask-scroll-indicator {
    position: absolute;
    bottom: 80px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.ask-scroll-indicator.show {
    opacity: 1;
    visibility: visible;
}

.ask-scroll-indicator:hover {
    transform: scale(1.1);
}

.ask-popup-input {
    padding: 16px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

.ask-popup-input .input-group {
    margin: 0;
}

.ask-popup-input .form-control {
    border: 1px solid #dee2e6;
    border-radius: 8px 0 0 8px;
    font-size: 0.9rem;
    padding: 8px 12px;
    resize: none;
    box-shadow: none;
}

.ask-popup-input .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.ask-popup-input .btn {
    border-radius: 0 8px 8px 0;
    padding: 8px 12px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: white;
    transition: all 0.2s ease;
}

.ask-popup-input .btn:hover {
    background: color-mix(in srgb, var(--primary-color) 85%, black);
    border-color: color-mix(in srgb, var(--primary-color) 85%, black);
    color: white;
}

.ask-popup-input .btn:active {
    transform: scale(0.95);
}

.ask-popup-input .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Popup Responsive */
@media (max-width: 768px) {
    .ask-popup {
        bottom: 85px;
        right: 15px;
        left: 15px;
        width: auto;
        height: 450px;
    }
}

@media (max-width: 480px) {
    .ask-popup {
        height: 400px;
    }
    
    .ask-popup-header {
        padding: 12px 16px;
    }
    
    .ask-popup-body {
        padding: 16px;
    }
    
    .ask-popup-input {
        padding: 12px 16px;
    }
    
    .ask-popup-input .form-control {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    .ask-popup-input .btn {
        padding: 6px 10px;
    }
}

/* Popup Animation States */
.ask-popup.closing {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
}

/* FAB Animation when popup is open */
.fab.popup-open {
    background: var(--success-color);
    animation: none;
}

.fab.popup-open:hover {
    background: var(--success-color);
    transform: scale(1.05);
}

/* Dragging States */
.ask-popup.dragging {
    transition: none !important;
    transform: scale(1.02) !important;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25) !important;
    z-index: 1002 !important;
}

.ask-popup.dragging .ask-popup-header {
    background: color-mix(in srgb, var(--primary-color) 90%, black);
}

/* Vollbild-Modus */
.ask-popup.fullscreen {
    z-index: 1003 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

.ask-popup.fullscreen .ask-popup-header {
    background: color-mix(in srgb, var(--primary-color) 95%, black);
}

/* Resize Handles - Alle Ecken */
.ask-popup-resize {
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.ask-popup-resize:hover {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(0, 0, 0, 0.4);
}

/* Ecke unten rechts (se-resize) */
.ask-popup-resize.se {
    bottom: 0;
    right: 0;
    cursor: se-resize;
    border-radius: 0 0 12px 0;
}

/* Ecke unten links (sw-resize) */
.ask-popup-resize.sw {
    bottom: 0;
    left: 0;
    cursor: sw-resize;
    border-radius: 0 0 0 12px;
}

/* Ecke oben rechts (ne-resize) */
.ask-popup-resize.ne {
    top: 0;
    right: 0;
    cursor: ne-resize;
    border-radius: 0 12px 0 0;
}

/* Ecke oben links (nw-resize) */
.ask-popup-resize.nw {
    top: 0;
    left: 0;
    cursor: nw-resize;
    border-radius: 12px 0 0 0;
}

/* Resize Handle Indicators */
.ask-popup-resize::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.ask-popup-resize:hover::after {
    background: rgba(0, 0, 0, 0.6);
}

