/* style.css */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Auth Pages Styling */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    overflow: hidden;
    max-width: 450px;
    width: 100%;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 2rem;
    text-align: center;
}

.auth-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.auth-body {
    padding: 2rem;
}

.form-floating {
    margin-bottom: 1rem;
}

.form-floating > .form-control {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 0.75rem;
    height: auto;
    transition: all 0.3s ease;
}

.form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-auth {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.3);
}

/* Dashboard Styling */
.dashboard-wrapper {
    background: #f8f9fa;
    min-height: 100vh;
}

.navbar-custom {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
}

.config-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: none;
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-header-custom {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    padding: 1.5rem;
}

.card-header-custom h2 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.3rem;
}

/* Custom Tabs */
.nav-tabs-custom {
    border-bottom: 2px solid #e9ecef;
    background: #f8f9fa;
    padding: 0 1rem;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-radius: 10px 10px 0 0;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 1rem 1.5rem;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

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

.nav-tabs-custom .nav-link.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(13, 110, 253, 0.3);
}

.tab-content-custom {
    padding: 2rem;
    background: white;
}

/* Form Styling */
.form-floating-custom {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-control-custom {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    background: white;
}

.form-label-custom {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Character Counter */
.char-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 0.75rem;
    color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

/* Help Text */
.help-text {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-left: 4px solid var(--info-color);
    border-radius: 0 8px 8px 0;
}

/* Dynamic Fields */
.dynamic-field {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    align-items: end;
}

.dynamic-field .form-floating-custom {
    flex: 1;
    margin-bottom: 0;
}

/* Ansprechpartner Cards */
.ansprechpartner-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    position: relative;
}

.ansprechpartner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    border-radius: 15px 15px 0 0;
}

.ansprechpartner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Topic Groups */
.topic-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    background: white;
}

.topic-header {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    color: white;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.topic-body {
    padding: 1.5rem;
}

.form-check-custom {
    margin-bottom: 0.75rem;
}

.form-check-custom .form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.1em;
    border: 2px solid #dee2e6;
    border-radius: 4px;
}

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

.form-check-custom .form-check-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-left: 0.5rem;
}

/* Buttons */
.btn-custom {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border: none;
    color: white;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.3);
}

.btn-secondary-custom {
    background: linear-gradient(135deg, var(--secondary-color), #5a6268);
    border: none;
    color: white;
}

.btn-danger-custom {
    background: linear-gradient(135deg, var(--danger-color), #b02a37);
    border: none;
    color: white;
}

.btn-outline-custom {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-custom:hover {
    background: var(--primary-color);
    color: white;
}

/* Save Button */
.save-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 2rem;
    text-align: center;
    border-top: 2px solid #dee2e6;
}

.btn-save {
    background: linear-gradient(135deg, var(--success-color), #146c43);
    border: none;
    color: white;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.3);
}

.btn-save:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(25, 135, 84, 0.4);
}

/* Alerts */
.alert-custom {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success-custom {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1), rgba(25, 135, 84, 0.05));
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger-custom {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-card {
        margin: 1rem;
        border-radius: 15px;
    }

    .auth-header,
    .auth-body {
        padding: 1.5rem;
    }

    .main-content {
        padding: 1rem 0;
    }

    .tab-content-custom {
        padding: 1rem;
    }

    .dynamic-field {
        flex-direction: column;
    }

    .ansprechpartner-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), #0056b3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #0056b3, var(--primary-color));
}

/* Zusätzliche CSS-Regeln für bessere mobile Darstellung */
@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.1rem;
    }

    .auth-card {
        margin: 0.5rem;
        border-radius: 10px;
    }

    .auth-header,
    .auth-body {
        padding: 1rem;
    }

    .nav-tabs-custom .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .tab-content-custom {
        padding: 1rem;
    }

    .ansprechpartner-card {
        padding: 1rem;
    }

    .btn-save {
        padding: 0.75rem 2rem;
        font-size: 1rem;
    }

    .topic-header {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .topic-body {
        padding: 1rem;
    }

    .form-check-custom .form-check-label {
        font-size: 0.875rem;
    }

    .char-counter {
        font-size: 0.7rem;
    }

    .help-text {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
}

/* Toast Notifications */
.toast-notification {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading button state */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Form validation styles */
.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Smooth transitions */
.form-control-custom,
.btn-custom {
    transition: all 0.3s ease;
}

/* Focus improvements */
.form-control-custom:focus,
.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Better checkbox styling */
.form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

/* Improved button hover effects */
.btn-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(25, 135, 84, 0.4);
}

/* Better spacing for form elements */
.form-floating-custom + .form-floating-custom {
    margin-top: 1.5rem;
}

.row .form-floating-custom {
    margin-bottom: 1rem;
}

/* Improved card shadows */
.config-card {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

.config-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Workflow-Management Styles */
.workflow-management {
    padding: 1rem 0;
}

.workflow-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.workflow-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid #f8f9fa;
}

.workflow-title h4 {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
}

.workflow-description {
    margin: 0.5rem 0 0 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.workflow-actions {
    display: flex;
    gap: 0.5rem;
}

.workflow-steps {
    padding: 1rem 1.5rem 1.5rem;
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.workflow-step {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.step-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
    font-weight: 500;
    color: var(--dark-color);
}

/* Workflow Editor Modal */
.workflow-step-editor {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.step-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.step-editor-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.remove-step {
    padding: 0.25rem 0.5rem;
}

/* Responsive Workflow Cards */
@media (max-width: 768px) {
    .workflow-header {
        flex-direction: column;
        gap: 1rem;
    }

    .workflow-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .workflow-step {
        flex-direction: column;
        text-align: center;
    }

    .step-icon {
        margin: 0 0 0.5rem 0;
    }
}

/* Workflow-spezifische Button-Styles */
.btn-workflow {
    background: linear-gradient(135deg, #28a745, #20c997);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-workflow:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Workflow-Status Badges */
.workflow-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workflow-status.active {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.workflow-status.default {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

/* Workflow-Typ Icons */
.workflow-type-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.workflow-type-icon.authenticate {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.workflow-type-icon.collect_data {
    background: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
}

.workflow-type-icon.connect {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.workflow-type-icon.callback {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.workflow-type-icon.email {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
}

.workflow-type-icon.reference {
    background: rgba(13, 202, 240, 0.2);
    color: #0dcaf0;
}

/* Verbesserter Speichern-Button */
.btn-xl {
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    min-width: 280px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
}

.btn-xl:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.save-button {
    position: relative;
    overflow: hidden;
}

.save-button.saving {
    pointer-events: none;
}

.save-button.saving::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Footer Styling */
.footer-custom {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 3px solid #3498db;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.footer-custom p {
    font-size: 0.9rem;
    color: #bdc3c7;
    font-weight: 400;
}

.footer-custom i {
    color: #3498db;
}

/* Anpassung des Main Content für Footer */
.main-content {
    min-height: calc(100vh - 140px);
    padding-bottom: 20px;
}

/* Config Footer Anpassungen */
.config-footer {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 2px solid #dee2e6;
    padding: 30px 20px;
    margin-top: 30px;
    border-radius: 0 0 15px 15px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .btn-xl {
        min-width: 100%;
        padding: 12px 30px;
        font-size: 1.1rem;
    }

    .footer-custom {
        padding: 15px 0;
    }

    .footer-custom p {
        font-size: 0.8rem;
    }
}

/* Loading Animation für Button */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* Anruf-Management Styles */
.calls-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.calls-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 2px solid #dee2e6;
    padding: 1.5rem;
}

.calls-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.period-title {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
    font-size: 1.3rem;
}

.calls-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.stat-item i {
    color: var(--primary-color);
}

.calls-list {
    padding: 1.5rem;
}

.call-card {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    background: white;
    overflow: hidden;
    transition: all 0.3s ease;
}

.call-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.call-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-bottom: 1px solid #e9ecef;
}

.call-info {
    flex: 1;
}

.caller-number {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.call-details {
    display: flex;
    gap: 1.5rem;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.call-conversation {
    padding: 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.conversation-log {
    max-height: 400px;
    overflow-y: auto;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    position: relative;
}

.message.assistant {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
    border-left: 4px solid var(--primary-color);
    margin-right: 2rem;
}

.message.caller {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.05));
    border-left: 4px solid var(--secondary-color);
    margin-left: 2rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-header strong {
    color: var(--dark-color);
    font-size: 0.9rem;
}

.timestamp {
    color: var(--secondary-color);
    font-size: 0.8rem;
    font-weight: 400;
}

.message-text {
    color: var(--dark-color);
    line-height: 1.5;
}

.call-notes {
    padding: 1.5rem;
    background: white;
}

.note-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.no-calls {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.no-calls i {
    color: var(--primary-color);
    opacity: 0.5;
}

/* Responsive Design für Anrufe */
@media (max-width: 768px) {
    .calls-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .calls-stats {
        justify-content: center;
    }

    .call-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .call-details {
        justify-content: center;
    }

    .message.assistant {
        margin-right: 0;
    }

    .message.caller {
        margin-left: 0;
    }
}

/* Navigation aktive Links */
.navbar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-weight: 600;
}

textarea[name="note"] {
    resize: none; /* Verhindert manuelles Resize */
    overflow: hidden; /* Verhindert Scrollbars */
    min-height: 40px; /* Mindesthöhe */
    transition: height 0.2s ease; /* Sanfte Animation */
}

/* Tagesansicht spezifische Styles */
.calls-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: darkslategray;
    font-weight: 500;
}

.calls-stats .stat-item i {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Verbesserte Button-Gruppe für drei Buttons */
.period-selector .btn-group {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.period-selector .btn-group .btn-custom {
    border-radius: 0;
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    min-width: 80px;
}

.period-selector .btn-group .btn-custom:first-child {
    border-left: 2px solid var(--primary-color);
    border-radius: 10px 0 0 10px;
}

.period-selector .btn-group .btn-custom:last-child {
    border-right: 2px solid var(--primary-color);
    border-radius: 0 10px 10px 0;
}

.period-selector .btn-group .btn-primary-custom {
    border-color: var(--primary-color);
    z-index: 1;
}

/* Responsive Anpassungen für drei Buttons */
@media (max-width: 576px) {
    .period-selector .btn-group .btn-custom {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
        min-width: 60px;
    }

    .calls-navigation {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .nav-controls {
        order: 2;
    }

    .period-title {
        order: 1;
        text-align: center;
        font-size: 1.1rem;
    }
}

/* Bessere Darstellung der Anrufkarten in der Tagesansicht */
.day-view .call-card {
    border-left: 4px solid var(--primary-color);
}

.day-view .call-card:nth-child(even) {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
}

/* Zeitanzeige in der Tagesansicht hervorheben */
.day-view .call-time {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* Call Cards Styling */
.calls-content {
    padding: 1rem 0;
}

.calls-header {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.calls-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.period-title {
    margin: 0;
    color: var(--dark-color);
    font-weight: 600;
}

.calls-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.stat-item i {
    color: var(--primary-color);
}

.calls-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.call-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.call-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.call-header {
    padding: 1.5rem;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.call-info {
    flex: 1;
}

.caller-number {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.call-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.call-meta span {
    display: flex;
    align-items: center;
}

.call-cost {
    color: var(--success-color) !important;
    font-weight: 600;
}

.call-actions {
    display: flex;
    gap: 0.5rem;
}

.call-notes-section {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.notes-container {
    position: relative;
}

.auto-resize-textarea {
    min-height: 40px;
    resize: none;
    overflow: hidden;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

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

.call-conversation {
    padding: 1.5rem;
    background: #fafafa;
}

.conversation-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.conversation-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.conversation-log {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: white;
    padding: 1rem;
}

.message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
}

.message.assistant {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(13, 110, 253, 0.05));
    border-left: 4px solid var(--primary-color);
}

.message.caller {
    background: linear-gradient(135deg, rgba(108, 117, 125, 0.1), rgba(108, 117, 125, 0.05));
    border-left: 4px solid var(--secondary-color);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-text {
    line-height: 1.5;
}

.forward-info {
    margin-top: 1rem;
}

.no-calls {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.no-calls i {
    color: var(--light-color);
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .calls-navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .calls-stats {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .call-header {
        flex-direction: column;
        gap: 1rem;
    }

    .call-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .caller-number {
        font-size: 1rem;
    }

    .nav-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .calls-header {
        padding: 1rem;
    }

    .call-card {
        margin: 0 -0.5rem;
        border-radius: 10px;
    }

    .call-header,
    .call-notes-section,
    .call-conversation {
        padding: 1rem;
    }

    .period-selector .btn-group {
        flex-direction: column;
        width: 100%;
    }

    .period-selector .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }
}

/* Badge Styling */
.badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Form Styling in Notes */
.notes-form .btn {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

/* Smooth Transitions */
.call-conversation {
    transition: all 0.3s ease;
}

/* Custom Scrollbar für Conversation Log */
.conversation-log::-webkit-scrollbar {
    width: 6px;
}

.conversation-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.conversation-log::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* Guthaben-Widget Styling */
.balance-widget {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-left: 5px solid var(--success-color);
    margin-bottom: 1rem;
}

.balance-widget.balance-low {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, #fff5f5, #fed7d7);
}

.balance-widget.balance-medium {
    border-left-color: var(--warning-color);
    background: linear-gradient(135deg, #fffbf0, #fef5e7);
}

.balance-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.balance-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--dark-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 0.5rem;
}

.balance-widget.balance-low .balance-amount {
    color: var(--danger-color);
}

.balance-widget.balance-medium .balance-amount {
    color: var(--warning-color);
}

.balance-warning {
    color: var(--danger-color);
    font-size: 0.9rem;
    font-weight: 500;
}

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

/* Modal Styling für Guthaben aufladen */
.amount-btn {
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.amount-btn:hover,
.amount-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Transaktions-Tabelle */
.current-balance-display {
    background: rgba(13, 110, 253, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: 2px solid rgba(13, 110, 253, 0.2);
}

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

/* Responsive Design für Guthaben-Widget */
@media (max-width: 768px) {
    .balance-content {
        flex-direction: column;
        text-align: center;
    }

    .balance-actions {
        justify-content: center;
        width: 100%;
    }

    .balance-actions .btn {
        flex: 1;
        min-width: 140px;
    }
}

/* Anruf-Kosten in der Anrufliste */
.call-cost {
    font-weight: 600;
    color: var(--danger-color);
}

.call-cost-info {
    font-size: 0.85rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

/* Transaktionen Styling */
.transactions-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
}

.current-balance-display {
    text-align: right;
}

.transaction-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.transaction-item:hover {
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 0 -1rem;
    padding: 1rem;
}

.transaction-item:last-child {
    border-bottom: none;
}

/* Pagination Styling */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 2px solid #e9ecef;
    color: var(--primary-color);
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white !important;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.nav-link:hover, .nav-link.active {
    color: white !important;
    font-weight: bold;
}

/* Datenerfassung Überschrift zentrieren */
.config-card h2 {
    text-align: center;
}

/* Spezifische Zentrierung für die Datenerfassung-Sektion */
.card-header-custom h2 {
    text-align: center;
}

/* Dynamic Fields - Button auf gleicher Höhe wie Input */
.dynamic-field {
    display: flex;
    gap: 10px;
    margin-bottom: 1rem;
    align-items: flex-end; /* Ändere von end zu flex-end für bessere Kompatibilität */
}

.dynamic-field .form-floating-custom {
    flex: 1;
    margin-bottom: 0;
}

.dynamic-field .btn {
    height: 58px; /* Gleiche Höhe wie die Input-Felder */
    min-width: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Spezifische Anpassung für Datenerfassung-Felder */
.data-collection-section {
    margin-bottom: 3rem;
}

.data-collection-section h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    font-weight: 600;
}

/* Ansprechpartner Sektion Styling */
.contacts-section {
    margin-top: 3rem;
}

.contacts-section .section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.contacts-section .section-header h3 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Ansprechpartner hinzufügen Button zentrieren mit mehr Abstand */
.add-contact-section {
    text-align: center;
    margin-top: 3rem;
    margin-bottom: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e9ecef;
}

#add-ansprechpartner {
    margin-top: 2rem;
}

/* Bessere Ausrichtung für mobile Geräte */
@media (max-width: 768px) {
    .dynamic-field {
        flex-direction: column;
        align-items: stretch;
    }

    .dynamic-field .btn {
        height: 45px;
        margin-top: 10px;
    }

    .add-contact-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }
}

/* Zusätzliche Verbesserungen für die Form-Struktur */
.form-section {
    margin-bottom: 2.5rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

/* Bessere Ausrichtung der Lösch-Buttons */
.btn-danger-custom.btn-sm {
    height: 58px;
    width: 58px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

/* Spezielle Klasse für Datenerfassung Container */
.data-capture-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.data-capture-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--dark-color);
    font-weight: 600;
}

/* Zwei-Spalten Layout für Interessenten/Kunden */
.data-capture-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

@media (max-width: 992px) {
    .data-capture-row {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.data-capture-column {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.data-capture-column h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Password strength indicator */
.password-strength {
    margin-top: 10px;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background-color: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    display: block;
    margin-top: 5px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Auth links styling */
.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.auth-divider {
    margin: 0 10px;
    color: #6c757d;
}

/* Zusätzliche Styles für Stripe Integration */

.payment-form {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.amount-btn {
    transition: all 0.3s ease;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem;
    font-weight: 600;
}

.amount-btn:hover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.1);
}

.amount-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

#payment-element {
    margin-bottom: 1rem;
}

.stripe-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.payment-success-icon {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 1rem;
}

.payment-error-icon {
    font-size: 4rem;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

/* Balance Widget Styles */
.balance-widget {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.balance-widget.balance-low {
    border-color: var(--danger-color);
    background: linear-gradient(135deg, #fff5f5, #ffe6e6);
}

.balance-widget.balance-medium {
    border-color: var(--warning-color);
    background: linear-gradient(135deg, #fffbf0, #fff3cd);
}

.balance-widget.balance-good {
    border-color: var(--success-color);
    background: linear-gradient(135deg, #f0fff4, #d1e7dd);
}

.balance-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.balance-warning {
    color: var(--danger-color);
    font-weight: 600;
    margin-top: 0.5rem;
}

.balance-actions {
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

@media (max-width: 768px) {
    .balance-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .balance-actions {
        flex-direction: row;
        width: 100%;
    }

    .balance-actions .btn {
        flex: 1;
    }
}

/* Responsive Design für Agenten - Fortsetzung */
@media (max-width: 768px) {
    .agent-header {
        flex-direction: column;
        gap: 1rem;
    }

    .agent-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .agent-card {
        margin-left: 0 !important;
    }

    .agent-card.agent-child {
        border-left: none;
        border-top: 4px solid #6c757d;
        position: relative;
    }

    .agent-card.agent-child::before {
        content: "↳ Unteragent";
        position: absolute;
        top: -1px;
        left: 10px;
        background: #6c757d;
        color: white;
        padding: 2px 8px;
        font-size: 0.7rem;
        border-radius: 0 0 4px 4px;
    }

    .agent-details .row {
        flex-direction: column;
    }
}

/* Agenten-Hierarchie Visualisierung */
.agent-tree-line {
    position: absolute;
    left: -15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.agent-tree-connector {
    position: absolute;
    left: -15px;
    top: 50%;
    width: 15px;
    height: 2px;
    background: #dee2e6;
}

/* Status Badges */
.agent-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.agent-status .badge {
    font-size: 0.75rem;
}

/* Prompt Textarea Styling */
.prompt-textarea {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.4;
}

.prompt-textarea:focus {
    background: white;
    border-color: var(--primary-color);
}

/* Agenten-Karten Animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agent-card {
    animation: slideInUp 0.3s ease-out;
}

/* Loading States */
.agent-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.agent-loading i {
    margin-right: 0.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Empty State */
.agent-empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.agent-empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Agenten-Management - Verbesserte Styles */
.agent-management {
    padding: 0;
}

.agent-card {
    background: white;
    border: 1px solid #e3e6f0;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.agent-card:hover {
    box-shadow: 0 0.25rem 2rem 0 rgba(58, 59, 69, 0.25);
    transform: translateY(-3px);
}

.agent-card.agent-parent {
    border-left: 0px solid #4e73df;
}

.agent-card.agent-child {
    border-left: 0px solid #36b9cc;
    background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    border-radius: 15px 15px 0 0;
}

.agent-card.agent-child .agent-header {
    background: linear-gradient(135deg, #36b9cc 0%, #4e73df 100%);
}

.agent-title {
    display: flex;
    align-items: flex-start;
    flex: 1;
    gap: 0.75rem;
}

.agent-title i {
    font-size: 1.5rem;
    margin-top: 0.25rem;
    opacity: 0.9;
}

.agent-title-content h4 {
    margin: 0 0 0.5rem 0;
    color: white;
    font-weight: 600;
    font-size: 1.25rem;
}

.agent-status {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.agent-status .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 50px;
    font-weight: 500;
}

.agent-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.agent-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.agent-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-1px);
}

.agent-description {
    padding: 1rem 1.5rem;
    background: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    margin: 0;
    font-style: italic;
    color: #5a5c69;
    position: relative;
}

.agent-details {
    padding: 1.5rem;
}

.agent-details .row > div {
    margin-bottom: 1.5rem;
}

.agent-details strong {
    color: #4e73df;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.agent-details p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #5a5c69;
    background: #f8f9fc;
    padding: 1rem;
    border-radius: 8px;
    border-left: 0px solid #e3e6f0;
}

.agent-details pre {
    background: #2d3748 !important;
    color: #e2e8f0;
    border: none;
    border-radius: 10px;
    padding: 1.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.agent-details small {
    background: #e3e6f0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.8rem;
}

/* Empty State Verbesserung */
.agent-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.agent-empty-state i {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.agent-empty-state h4 {
    color: #5a5c69;
    font-weight: 600;
    margin-bottom: 1rem;
}

.agent-empty-state p {
    color: #858796;
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* Modal Verbesserungen */
#agentModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
    border: none;
}

#agentModal .modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

#agentModal .modal-header .btn-close:hover {
    opacity: 1;
}

#agentModal .modal-content {
    border-radius: 15px;
    border: none;
    box-shadow: 0 0.5rem 3rem rgba(58, 59, 69, 0.3);
}

#agentModal .modal-body {
    padding: 2rem;
}

#agentModal .form-label {
    font-weight: 600;
    color: #4e73df;
    margin-bottom: 0.5rem;
}

#agentModal .form-control,
#agentModal .form-select {
    border: 2px solid #e3e6f0;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

#agentModal .form-control:focus,
#agentModal .form-select:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

#agentModal .form-text {
    color: #858796;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

#agent-prompt {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: #2d3748;
    color: #e2e8f0;
    border: 2px solid #4a5568;
    min-height: 200px;
}

#agent-prompt:focus {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4e73df;
}

.form-check-input:checked {
    background-color: #4e73df;
    border-color: #4e73df;
}

/* Button Styles */
.btn-primary-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(78, 115, 223, 0.3);
}

/* Responsive Verbesserungen */
@media (max-width: 768px) {
    .agent-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .agent-actions {
        justify-content: center;
        width: 100%;
    }

    .agent-card {
        margin-left: 0 !important;
    }

    .agent-card.agent-child {
        position: relative;
    }

    .agent-card.agent-child::after {
        content: "Unteragent";
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(54, 185, 204, 0.9);
        color: white;
        padding: 0.25rem 0.75rem;
        border-radius: 15px;
        font-size: 0.75rem;
        font-weight: 600;
    }

    .agent-description {
        padding: 1rem;
        text-align: center;
    }

    .agent-details {
        padding: 1rem;
    }

    .agent-empty-state {
        padding: 2rem 1rem;
    }

    .agent-empty-state i {
        font-size: 3rem;
    }
}

/* Loading Animation */
.agent-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.agent-loading i {
    color: #4e73df;
    margin-right: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Smooth Animations */
.agent-card {
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hover Effects für bessere UX */
.agent-card .collapse {
    transition: all 0.3s ease;
}

.agent-details strong i {
    color: #4e73df;
    font-size: 1rem;
}

/* Badge Styles */
.badge.bg-success {
    background: linear-gradient(135deg, #1cc88a 0%, #13855c 100%) !important;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #858796 0%, #5a5c69 100%) !important;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%) !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, #36b9cc 0%, #258391 100%) !important;
}

/* API Parameter Styling */
.api-parameter-row {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.api-parameter-row:hover {
    background-color: #e9ecef;
}

.api-parameter-row .form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
}

.api-parameter-row .form-control {
    font-size: 0.875rem;
}

.remove-api-parameter {
    margin-top: 1.5rem;
}

/* Card Header für API-Sektion */
.card-header h6 {
    color: #495057;
    font-weight: 600;
}

/* Modal Erweiterungen */
.modal-xl .modal-dialog {
    max-width: 1200px;
}

/* Form Text Styling */
.form-text {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Button Styling für API Parameter */
#add-api-parameter {
    font-size: 0.875rem;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .api-parameter-row .row > div {
        margin-bottom: 1rem;
    }

    .remove-api-parameter {
        margin-top: 0.5rem;
    }
}


.toggle-children {
    transition: all 0.3s ease;
    border: none !important;
    background: transparent !important;
    padding: 2px 6px !important;
}

.toggle-children:hover {
    background: #f8f9fa !important;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-children.expanded .toggle-icon {
    transform: rotate(90deg);
}

.agent-children {
    transition: all 0.3s ease;
    overflow: hidden;
}

.agent-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 10px;
    background: white;
    transition: all 0.2s ease;
}

.agent-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.agent-title {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.agent-title h4 {
    margin: 0;
    font-size: 1.1rem;
}

.agent-status {
    margin-top: 5px;
}

.agent-status .badge {
    margin-right: 5px;
    font-size: 0.75rem;
}

.agent-description {
    padding: 10px 15px 10px 15px;
    color: #6c757d;
    font-style: italic;
}

.agent-details {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.agent-actions {
    display: flex;
    gap: 5px;
}

.agent-child {
    border-left: 0px solid #007bff;
    margin-left: 20px !important;
}

.agent-parent {
    border-left: 0px solid #28a745;
}

.agent-card:not(:has(.agent-children)) .toggle-children {
    display: none !important;
}

.toggle-children {
    transition: all 0.3s ease;
    border: none !important;
    background: transparent !important;
    padding: 2px 6px !important;
}

.toggle-children:hover {
    background: #f8f9fa !important;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.toggle-children.expanded .toggle-icon {
    transform: rotate(90deg);
}

.agent-children {
    transition: all 0.3s ease;
    overflow: hidden;
    margin-top: 10px;
}

.agent-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 15px;
    background: white;
    transition: all 0.2s ease;
    position: relative;
    /* Entferne die störenden Linien */
}

.agent-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
}

.agent-title {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.agent-title h4 {
    margin: 0;
    font-size: 1.1rem;
}

.agent-status {
    margin-top: 5px;
}

.agent-status .badge {
    margin-right: 5px;
    font-size: 0.75rem;
}

.agent-description {
    padding: 10px 15px 10px 15px;
    color: #6c757d;
    font-style: italic;
}

.agent-details {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.agent-actions {
    display: flex;
    gap: 5px;
}

.agent-child {
    border-left: 0px solid #007bff;
    margin-left: 30px !important;
    margin-top: 10px;
}

.agent-parent {
    border-left: 0px solid #28a745;
}

/* Entferne die störenden Tree-Line Elemente */
.agent-tree-line,
.agent-tree-connector {
    display: none;
}

/* Container für die gesamte Agent-Hierarchie */
.agents-container {
    padding: 20px;
}

/* Verbesserte Animation für das Aufklappen */
.agent-children.expanding {
    display: block !important;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.4s ease-out;
}

.agent-children.expanded {
    max-height: 2000px; /* Großer Wert für beliebige Höhe */
    opacity: 1;
}

.agent-children.collapsing {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in, opacity 0.3s ease-in;
}

.agent-details pre {
    background: #2d3748 !important;
    color: #e2e8f0;
    padding: 15px !important;
    border-radius: 8px !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    border: 1px solid #dee2e6 !important;

    /* Wichtig für Textumbruch */
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;

    /* Responsive Schriftgröße */
    font-family: 'Courier New', Consolas, monospace !important;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .agent-details pre {
        font-size: 0.75rem !important;
        padding: 10px !important;
        max-height: 250px !important;
    }
}

@media (max-width: 576px) {
    .agent-details pre {
        font-size: 0.7rem !important;
        padding: 8px !important;
        max-height: 200px !important;
    }
}

/* Zusätzliche Verbesserungen für die Agent-Details */
.agent-details {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    word-wrap: break-word;
}

.agent-details .row {
    margin: 0;
}

.agent-details .col-md-6 {
    padding: 0 10px;
    margin-bottom: 15px;
}

.agent-details p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Live Call Styles - Ergänzung zu style.css */
.live-call-box {
    border-left: 4px solid var(--primary-color);
}

.live-call-box.active {
    border-left-color: #28a745;
}

.conversation-log::-webkit-scrollbar {
    width: 6px;
}

.conversation-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.conversation-log::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

@media (max-width: 768px) {
    .call-header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .message.assistant {
        margin-right: 0;
    }

    .message.caller {
        margin-left: 0;
    }

    .conversation-log {
        padding: 1rem;
    }
}
