* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    transition: all 0.3s ease;
}

body.fullscreen-mode {
    background-color: white;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.container.fullscreen {
    max-width: none;
    margin: 0;
    padding: 10px;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    margin-bottom: 30px;
    padding: 20px 40px;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header-content h1 {
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.header-actions-secondary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.btn-nav {
    padding: 8px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
}

.btn-header {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.btn-header:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-reset {
    background: #e74c3c !important;
    font-weight: 700 !important;
    border: 2px solid #c0392b !important;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3) !important;
}

.btn-reset:hover {
    background: #c0392b !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.5) !important;
}

header.fullscreen {
    margin-bottom: 10px;
}

header.fullscreen h1 {
    font-size: 1.8rem;
    margin: 0;
}

header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    transition: all 0.3s ease;
}

#username-display {
    padding: 8px 14px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    font-size: 13px;
    font-weight: 500;
}

#profile-btn {
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
}

#profile-btn:hover {
    background: rgba(102, 126, 234, 0.2) !important;
    color: #5568d3 !important;
    box-shadow: none !important;
}

.upload-section {
    margin-bottom: 30px;
    padding: 0 40px;
}

.drop-zone {
    border: 3px dashed #cbd5e0;
    border-radius: 8px;
    padding: 60px;
    text-align: center;
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drop-zone:hover {
    border-color: #4a5568;
    background-color: #edf2f7;
}

.drop-zone.dragover {
    border-color: #3182ce;
    background-color: #e6f7ff;
}

.drop-zone p {
    font-size: 1.2rem;
    color: #4a5568;
    margin: 0;
}

.data-info {
    background-color: #e6f7ff;
    border: 1px solid #3182ce;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.data-info p {
    margin: 5px 0;
    font-size: 0.95rem;
}

.data-info span {
    font-weight: bold;
    color: #2c5282;
}

.rows-status {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.9rem;
    color: #003a8c;
    font-weight: 500;
}

.rows-status.limited {
    background-color: #fff7e6;
    border-color: #ffd591;
    color: #d46b08;
}

.loading {
    text-align: center;
    padding: 40px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    margin-bottom: 20px;
}

.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3182ce;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 10px;
}

.loading-progress {
    font-size: 1.2rem;
    font-weight: bold;
    color: #3182ce;
}

.table-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    overflow: auto;
    max-height: 600px;
    margin-bottom: 200px;
    transition: all 0.3s ease;
}

.table-container.fullscreen {
    flex: 1;
    max-height: none;
    height: calc(100vh - 200px);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table thead {
    position: sticky;
    top: 0;
    background-color: #2c3e50;
    color: white;
    z-index: 10;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #34495e;
    white-space: nowrap;
    position: relative;
    max-width: 300px;
}

.data-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
}

.data-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.data-table tbody tr:hover {
    background-color: #e6f7ff;
}

.data-table td {
    padding: 10px 12px;
    font-size: 0.9rem;
    max-width: 300px;
    word-wrap: break-word;
    white-space: pre-wrap;
    transition: all 0.2s ease;
}

.data-table.single-line td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.5em;
    line-height: 1.4;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.controls {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    padding: 15px 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 25px 20px;
    align-items: center;
}

.controls-row {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.search-toggle-btn {
    background: none;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #4a5568;
    transition: all 0.2s ease;
}

.search-toggle-btn:hover {
    background-color: #f8fafc;
    border-color: #a0aec0;
}

.search-toggle-btn.active {
    background-color: #3182ce;
    color: white;
    border-color: #3182ce;
}

.search-box {
    width: 300px;
    transition: all 0.3s ease;
}

.search-box.hidden {
    width: 0;
    overflow: hidden;
    opacity: 0;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-secondary {
    background-color: #718096;
    color: white;
}

.btn-secondary:hover {
    background-color: #4a5568;
}

.btn-primary {
    background-color: #3182ce;
    color: white;
}

.btn-primary:hover {
    background-color: #2c5282;
}

.btn-success {
    background-color: #38a169;
    color: white;
}

.btn-success:hover {
    background-color: #2f855a;
}

.btn-info {
    background-color: #3182ce;
    color: white;
}

.btn-info:hover {
    background-color: #2c5282;
}

.btn-warning {
    background-color: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background-color: #d97706;
}

.btn-purple {
    background-color: #9b59b6;
    color: white;
}

.btn-purple:hover {
    background-color: #8e44ad;
}
.btn-api {
    background-color: #6b46c1;
    color: white;
}
.btn-api:hover {
    background-color: #553c9a;
}

/* New Data Source Section */
.new-datasource-section {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
}

.btn-large {
    font-size: 1.2rem;
    padding: 16px 40px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

/* API Section (inline with upload) */
.api-section {
    background: #fff;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.api-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.api-controls-info {
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
}

.btn-api-inline {
    font-size: 1.05rem;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6b46c1, #553c9a);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-api-inline:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 70, 193, 0.35);
}

/* Data Source Modal */
.datasource-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9998;
    backdrop-filter: blur(4px);
}

.datasource-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.datasource-modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.datasource-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.datasource-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.datasource-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.datasource-modal-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.datasource-option {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.datasource-option:hover {
    border-color: #cbd5e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.datasource-option:last-child {
    margin-bottom: 0;
}

.datasource-option-header h4 {
    margin: 0 0 16px 0;
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-drop-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-drop-zone:hover {
    border-color: #4a5568;
    background-color: #edf2f7;
}

.modal-drop-zone.dragover {
    border-color: #3182ce;
    background-color: #e6f7ff;
}

.modal-drop-zone p {
    margin: 0;
    color: #4a5568;
    font-size: 1.1rem;
}

.column-filters th {
    padding: 5px;
    vertical-align: middle;
}

.filter-select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.85rem;
    background-color: white;
    cursor: pointer;
    min-width: 80px;
    max-width: 100%;
}

.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-display {
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.85rem;
    background-color: white;
    cursor: pointer;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.multi-select-display:hover {
    border-color: #a0aec0;
}

.multi-select-display.active {
    border-color: #3182ce;
}

.multi-select-dropdown {
    position: fixed;
    background-color: white;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 300px;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
}

.multi-select-search {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background-color: white;
}

.multi-select-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.85rem;
}

.multi-select-search input:focus {
    outline: none;
    border-color: #3182ce;
}

.multi-select-sections {
    max-height: 350px;
    overflow-y: auto;
}

.multi-select-section {
    border-bottom: 1px solid #e2e8f0;
}

.multi-select-section:last-child {
    border-bottom: none;
}

.multi-select-section-header {
    padding: 6px 10px;
    background-color: #f8fafc;
    font-size: 0.75rem;
    color: #718096;
    font-weight: 600;
    text-transform: uppercase;
}

.multi-select-option {
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    color: #2c3e50;
}

.multi-select-option:hover {
    background-color: #f0f4f8;
}

.multi-select-option.focus-option {
    background-color: #fef3c7;
    font-weight: 600;
}

.multi-select-option.focus-option:hover {
    background-color: #fde68a;
}

.multi-select-option label {
    margin-left: 8px;
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.multi-select-option input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: #718096;
    transition: transform 0.2s;
}

.multi-select-display.active .dropdown-arrow {
    transform: rotate(180deg);
}

.multi-select-actions {
    padding: 8px 10px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 10px;
    background-color: #f8fafc;
}

.multi-select-actions button {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.select-all-btn {
    background-color: #3182ce;
    color: white;
}

.select-all-btn:hover {
    background-color: #2c5282;
}

.clear-all-btn {
    background-color: #e53e3e;
    color: white;
}

.clear-all-btn:hover {
    background-color: #c53030;
}

.deselect-all-btn {
    background-color: #718096;
    color: white;
}

.deselect-all-btn:hover {
    background-color: #4a5568;
}

.only-this-link {
    color: #38a169;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 4px 8px;
    margin-left: auto;
    cursor: pointer;
    border: none;
    background: none;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.only-this-link:hover {
    color: #2f855a;
    text-decoration: underline;
}

.filter-select:focus {
    outline: none;
    border-color: #3182ce;
}

.sort-icon {
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.8rem;
    color: #a0aec0;
    transition: color 0.3s ease;
}

.sort-icon:hover {
    color: #4a5568;
}

.sort-icon.active {
    color: #3182ce;
}

.highlight {
    background-color: #fef3c7 !important;
}

.filtered-count {
    color: #718096;
    font-size: 0.9rem;
    margin-left: auto;
}

.display-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
}

.display-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.display-label {
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.performance-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 0.95rem;
}

.performance-warning-content {
    margin-bottom: 15px;
}

.performance-warning-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 15px;
}

.performance-warning .btn {
    min-width: 200px;
    white-space: nowrap;
}

.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #a0aec0;
}

.close-modal:hover {
    color: #2c3e50;
}

.modal-body {
    padding: 20px;
}

.modal-body h3 {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.column-list {
    margin-bottom: 30px;
}

.column-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.column-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.column-item:hover {
    background-color: #f8fafc;
}

.column-checkbox {
    margin-right: 10px;
    cursor: pointer;
}

.saved-views-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.view-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.95rem;
}

.saved-views-list {
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 10px;
    min-height: 100px;
}

.saved-view-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    background-color: #f8fafc;
}

.saved-view-item:hover {
    background-color: #e6f7ff;
}

.view-actions {
    display: flex;
    gap: 10px;
}

.view-actions button {
    padding: 4px 12px;
    font-size: 0.85rem;
}

/* Statistik-Panel Styles */
.statistics-panel {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.statistics-header {
    background-color: #f8fafc;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.statistics-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-toggle {
    background: none;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #4a5568;
    transition: all 0.2s ease;
}

.btn-toggle:hover {
    background-color: #e6f7ff;
    border-color: #3182ce;
    color: #3182ce;
}

.statistics-content {
    padding: 20px;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.stat-card {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
}

.stat-card h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.stat-values {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.stat-label {
    font-size: 0.9rem;
    color: #4a5568;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.stats-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    background-color: white;
}

.stats-select:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.column-stats-details {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 12px;
    font-size: 0.9rem;
    color: #4a5568;
    min-height: 100px;
}

.grouping-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.grouping-results {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 12px;
    margin-top: 12px;
    min-height: 80px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.9rem;
}

.grouping-result-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.grouping-key {
    font-weight: 500;
    color: #2c3e50;
}

.grouping-value {
    color: #3182ce;
    font-weight: 600;
}

.statistics-panel.minimized .statistics-content {
    display: none;
}

/* Berechnete Spalten Styles */
.calculated-columns-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.calc-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
}

.calc-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.calc-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    min-height: 80px;
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.calc-textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.formula-help {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    border-radius: 4px;
    padding: 10px;
    font-size: 0.8rem;
    color: #003a8c;
    line-height: 1.4;
}

.calc-buttons {
    display: flex;
    gap: 10px;
}

.formula-preview {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 10px;
    min-height: 60px;
    font-size: 0.9rem;
    color: #4a5568;
    max-height: 200px;
    overflow-y: auto;
}

.formula-preview.error {
    background-color: #fed7d7;
    border-color: #fc8181;
    color: #c53030;
}

.formula-preview.success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.calculated-columns-list h5 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
}

.calculated-columns-items {
    max-height: 200px;
    overflow-y: auto;
}

.calculated-column-item {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.calculated-column-info {
    flex: 1;
}

.calculated-column-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.calculated-column-formula {
    font-size: 0.8rem;
    color: #4a5568;
    font-family: 'Courier New', monospace;
    background-color: #f8fafc;
    padding: 4px 6px;
    border-radius: 3px;
    word-break: break-all;
}

.calculated-column-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
    margin-left: 10px;
}

.btn-mini {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 3px;
}

.calculated-column-error {
    background-color: #fed7d7;
    border-color: #fc8181;
}

.calculated-column-error .calculated-column-name {
    color: #c53030;
}

/* Visualisierungs-Panel Styles */
.visualization-panel {
    position: relative;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    margin-bottom: 0px;
    border: none;
    display: none;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

.visualization-header {
    background-color: #f8fafc;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.visualization-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.viz-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.visualization-content {
    padding: 20px;
}

.visualization-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    min-height: 400px;
}

/* ============================================
   NEW: Chart Type Gallery with Thumbnails
   ============================================ */
.chart-type-gallery {
    margin-bottom: 20px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.gallery-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.chart-type-scroll-container {
    overflow-x: auto;
    overflow-y: hidden;
    margin: 0 -5px;
    padding: 5px;
}

.chart-type-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.chart-type-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.chart-type-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.chart-type-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.chart-type-thumbnails {
    display: flex;
    gap: 12px;
    min-width: min-content;
}

.chart-thumbnail {
    flex-shrink: 0;
    width: 100px;
    padding: 15px 10px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-thumbnail:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chart-thumbnail.active {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.chart-thumbnail.active .thumbnail-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.thumbnail-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
    line-height: 1;
}

.thumbnail-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4a5568;
}

.chart-thumbnail.active .thumbnail-label {
    color: white;
}

/* ============================================
   NEW: Horizontal Chart Configuration
   ============================================ */
.chart-config-horizontal {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
    flex: 1;
}

.config-label-compact {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
}

.config-label-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 4px;
    font-style: italic;
}

#date-grouping-field {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.viz-select-compact,
.viz-input-compact {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    transition: all 0.2s ease;
}

.viz-select-compact:focus,
.viz-input-compact:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.config-actions-horizontal {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.btn-compact {
    padding: 8px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ============================================
   NEW: Full Width Chart Display
   ============================================ */
.viz-display-panel-fullwidth {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: none !important;
    flex-direction: column;
}

#data-sources-btn,
#executive-summaries-btn {
    display: none !important;
}

#datasource-modal,
.drop-zone,
.visualization-content {
    display: none !important;
}

.viz-config-panel {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
}

.viz-config-panel h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.chart-config {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.config-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
}

.viz-select, .viz-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
}

.viz-select:focus, .viz-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.config-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.viz-display-panel {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.viz-display-panel h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.chart-container {
    flex: 1;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 20px;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chart-placeholder {
    color: #718096;
    font-size: 0.9rem;
    text-align: center;
    font-style: italic;
}

#data-chart {
    max-width: 100%;
    max-height: 400px;
}

.chart-info {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 12px;
    margin-top: 10px;
}

.chart-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.chart-stat {
    color: #4a5568;
}

.chart-stat strong {
    color: #2c3e50;
}

.visualization-panel.minimized .visualization-content {
    display: none;
}

/* Responsive Design für Visualization Panel */
@media (max-width: 1024px) {
    .visualization-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .viz-config-panel {
        order: 2;
    }
    
    .viz-display-panel {
        order: 1;
    }
    
    .chart-config-horizontal {
        flex-direction: column;
        align-items: stretch;
    }
    
    .config-field {
        min-width: 100%;
    }
    
    .config-actions-horizontal {
        width: 100%;
        justify-content: stretch;
    }
    
    .config-actions-horizontal button {
        flex: 1;
    }
    
    .chart-thumbnail {
        width: 85px;
    }
    
    .thumbnail-icon {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .drop-zone {
        padding: 40px 20px;
    }
    
    .table-container {
        max-height: 400px;
    }
}

/* TimeRangeSlider Styles */
.time-range-slider {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.time-range-slider.hidden {
    display: none;
}

.time-range-slider .slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.time-range-slider .slider-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.time-range-slider .slider-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.time-range-slider .date-column-select {
    padding: 6px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    min-width: 180px;
}

.time-range-slider .reset-btn {
    padding: 6px 12px;
    border: 1px solid #e53e3e;
    background: #e53e3e;
    color: white;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.time-range-slider .reset-btn:hover {
    background: #c53030;
}

.time-range-slider .slider-container {
    margin: 50px 0 30px 0; /* Mehr Abstand oben (50px) und unten (30px) */
    padding: 25px 15px; /* Innenabstand für bessere visuelle Abgrenzung */
    background: rgba(248, 250, 252, 0.6); /* Leichter Hintergrund für Abgrenzung */
    border-radius: 8px; /* Abgerundete Ecken */
    border: 1px solid rgba(226, 232, 240, 0.7); /* Subtiler Rahmen */
}

.time-range-slider .slider-track {
    position: relative;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
    cursor: pointer;
}

.time-range-slider .slider-range {
    position: absolute;
    height: 100%;
    background: #3182ce;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}

.time-range-slider .auto-play-range {
    position: absolute;
    height: 100%;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2) 0%, rgba(16, 185, 129, 0.25) 100%);
    border-radius: 4px;
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.time-range-slider .auto-play-range::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: rgba(16, 185, 129, 0.5);
    border-radius: 0 4px 4px 0;
}

.time-range-slider .slider-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #3182ce;
    border: 3px solid white;
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

.time-range-slider .slider-handle:hover,
.time-range-slider .slider-handle.active {
    transform: translate(-50%, -50%) scale(1.2);
}

.time-range-slider .slider-handle:active {
    cursor: grabbing;
}

.time-range-slider .auto-play-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(16, 185, 129, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: default;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.2);
    z-index: 4;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.time-range-slider .auto-play-handle::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.time-range-slider .handle-tooltip {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.time-range-slider.dragging .handle-tooltip,
.time-range-slider .slider-handle:hover .handle-tooltip {
    opacity: 1;
}

.time-range-slider .handle-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2d3748;
}

.time-range-slider .slider-labels {
    position: relative;
    height: 20px;
    margin-top: 10px;
}

.time-range-slider .year-label {
    position: absolute;
    font-size: 0.8rem;
    color: #4a5568;
    transform: translateX(-50%);
    user-select: none;
    background-color: #ffffff; /* Weißer Hintergrund */
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(160, 174, 192, 0.2);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    z-index: 3; /* UNTER den Linien, damit sie durchlaufen können */
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap; /* Verhindert Textumbruch */
}

/* Alle Jahr-Labels verwenden die Standard-Zentrierung */

/* Zweier-Schritte: Auffällige Jahreszahlen (gerade Jahre) */
.time-range-slider .year-label-prominent {
    font-weight: 600;
    color: #2d3748;
    background-color: #ffffff;
    border: 1px solid rgba(113, 128, 150, 0.4);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 4px 10px;
}

/* Zweier-Schritte: Subtile Jahreszahlen (ungerade Jahre) */
.time-range-slider .year-label-subtle {
    font-weight: 400;
    color: #718096;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(160, 174, 192, 0.15);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    font-size: 0.75rem;
    padding: 2px 6px;
}

.time-range-slider .slider-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 35px; /* Mehr Abstand nach oben (von 15px auf 35px) */
    padding-top: 20px; /* Zusätzlicher Innenabstand oben */
    border-top: 1px solid rgba(226, 232, 240, 0.5); /* Subtile Trennlinie */
    font-size: 0.9rem;
    color: #4a5568;
}

.time-range-slider .current-range strong {
    color: #2c3e50;
    font-weight: 600;
}

.time-range-slider .data-count {
    color: #718096;
}

.time-range-slider .data-count span {
    font-weight: 600;
    color: #3182ce;
}

/* Touch support for mobile devices */
@media (max-width: 768px) {
    .time-range-slider .slider-handle {
        width: 24px;
        height: 24px;
    }
    
    .time-range-slider .handle-tooltip {
        display: none;
    }
    
    .time-range-slider .slider-controls {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .time-range-slider .slider-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Chart Configuration Options */
.config-options {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
}

.config-checkbox {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.config-checkbox-label {
    flex: 1;
    font-size: 0.9rem;
    color: #4a5568;
    cursor: pointer;
    line-height: 1.4;
}

.config-checkbox-label small {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    margin-top: 2px;
    font-weight: normal;
}

.config-checkbox:checked + .config-checkbox-label {
    color: #2c3e50;
    font-weight: 500;
}

.config-checkbox:checked + .config-checkbox-label small {
    color: #4a5568;
}

/* TimeRangeSlider Options */
.time-range-slider .slider-options {
    margin: 15px 0 30px 0; /* Mehr Abstand unten (30px) für Trennung zum Slider */
    padding: 12px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.time-range-slider .option-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.time-range-slider .auto-play-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    margin-top: 10px;
}

.time-range-slider .auto-play-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.time-range-slider .auto-play-btn,
.time-range-slider .auto-play-stop {
    padding: 6px 12px;
    border: 1px solid #3182ce;
    border-radius: 4px;
    background: #3182ce;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.time-range-slider .auto-play-btn:hover,
.time-range-slider .auto-play-stop:hover {
    background: #2c5282;
    border-color: #2c5282;
    transform: translateY(-1px);
}

.time-range-slider .auto-play-stop {
    background: #e53e3e;
    border-color: #e53e3e;
}

.time-range-slider .auto-play-stop:hover {
    background: #c53030;
    border-color: #c53030;
}

.time-range-slider .speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-range-slider .speed-label {
    font-size: 0.85rem;
    color: #4a5568;
    margin: 0;
}

.time-range-slider .speed-select {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
}

/* Export Actions */
.export-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.export-actions .btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.export-actions .btn-success {
    background: #10b981;
    border: 1px solid #10b981;
    color: white;
}

.export-actions .btn-success:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-1px);
}

.export-actions .btn-warning {
    background: #f59e0b;
    border: 1px solid #f59e0b;
    color: white;
}

.export-actions .btn-warning:hover {
    background: #d97706;
    border-color: #d97706;
    transform: translateY(-1px);
}

.time-range-slider .option-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #4a5568;
    transition: color 0.2s ease;
}

.time-range-slider .option-checkbox-wrapper:hover {
    color: #2c3e50;
}

.time-range-slider .option-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #3182ce;
}

.time-range-slider .option-label {
    font-weight: 500;
    user-select: none;
}

/* Time Markers - Über dem Slider im Container */
.time-range-slider .time-markers {
    position: absolute;
    top: -25px !important; /* Über dem Slider-Track positioniert */
    left: 0;
    right: 0;
    height: 20px !important; /* Höhe für die Markierungen */
    overflow: visible; /* Markierungen dürfen über den Container hinausragen */
    pointer-events: none;
    z-index: 1; /* VOR dem Slider-Track aber hinter den Handles */
}

/* WICHTIG: Zeit-Marker nur im TimeRangeSlider-Container anzeigen */
div[id="time-markers"]:not(.time-range-slider #time-markers) {
    display: none !important; /* Verstecke Zeit-Marker außerhalb des TimeRangeSlider */
}

.time-range-slider {
    position: relative !important; /* Relativer Container für absolute Positionierung */
    min-height: 120px !important; /* Genug Platz für Zeit-Marker */
}

.time-range-slider #time-markers {
    display: block !important;
    position: absolute !important;
    top: -25px !important; /* Über dem Slider-Track positioniert */
    left: 0 !important;
    right: 0 !important;
    height: 20px !important; /* Höhe für die Markierungen */
    z-index: 1 !important;
    pointer-events: none !important;
    overflow: visible !important; /* Markierungen dürfen über den Container hinausragen */
}

.time-range-slider .time-marker {
    position: absolute;
    transform: translateX(-50%);
    pointer-events: none;
}

/* Year Markers - Durchgehende Linien unterhalb Slider und durch Jahr-Labels */
.time-range-slider .year-marker {
    width: 1px;
    height: 60px; /* Durchgehend bis unter Jahr-Labels */
    background-color: rgba(160, 174, 192, 0.6); /* Einheitliche graue Farbe */
    opacity: 1;
    transition: opacity 0.3s ease;
    top: 0; /* Beginnt unterhalb Slider */
    z-index: 5; /* ÜBER Jahr-Labels um durch sie durchzulaufen */
}

/* Month Markers - Deutlich verstärkte Monatsstriche */
.time-range-slider .month-marker {
    width: 1px;
    height: 35px; /* Länger und auffälliger */
    background-color: rgba(113, 128, 150, 0.8); /* Dunkler für bessere Sichtbarkeit */
    opacity: 1;
    transition: opacity 0.3s ease;
    top: 0; /* Beginnt unterhalb Slider */
    z-index: 4; /* Unter Jahr-Markern aber sichtbar */
}

/* Hover-Effekte für bessere Sichtbarkeit */
.time-range-slider:hover .year-marker {
    opacity: 0.9;
    background-color: rgba(160, 174, 192, 0.8); /* Konsistent mit Basis-Style */
}

.time-range-slider:hover .month-marker {
    opacity: 0.7;
}


/* Bei sehr vielen Markierungen reduziere Opacity */
.time-range-slider.dense-markers .month-marker {
    opacity: 0.3;
    height: 10px;
}

.time-range-slider.dense-markers .year-marker {
    opacity: 0.6;
    height: 48px; /* Immer noch durchgehend */
}

/* Marker-Interaktion mit Handles */
.time-range-slider.dragging .time-marker {
    opacity: 0.9;
    z-index: 10;
}

.time-range-slider.dragging .year-marker {
    opacity: 1.0;
    background-color: rgba(160, 174, 192, 0.8); /* Konsistent mit Basis-Style */
}

.time-range-slider.dragging .month-marker {
    opacity: 0.8;
}

/* Responsive Anpassungen für mobile Geräte */
@media (max-width: 768px) {
    .time-range-slider .option-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .time-range-slider .option-checkbox-wrapper {
        font-size: 0.9rem;
    }
    
    .time-range-slider .year-marker {
        height: 40px; /* Kürzer auf mobilen Geräten */
    }
    
    .time-range-slider .month-marker {
        height: 8px;
        opacity: 0.4;
    }
    
    .time-range-slider .time-markers {
        height: 12px; /* Kompaktere Höhe für mobile Ansicht */
    }
}

/* TimeRangeSlider Option Sections */
.time-range-slider .option-section {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.time-range-slider .slider-display-options {
    background-color: #f8fafc;
}

.time-range-slider .chart-display-options {
    background-color: #fff7ed;
    border-color: #fed7aa;
}

.time-range-slider .auto-play-options {
    background-color: #f0f9ff;
    border-color: #bae6fd;
}

.time-range-slider .option-section-title {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    cursor: help;
}

.time-range-slider .chart-display-options .option-section-title {
    color: #c2410c;
}

.time-range-slider .auto-play-options .option-section-title {
    color: #0369a1;
}

.time-range-slider .option-section .option-row {
    margin-bottom: 0;
}

/* Tooltip styling */
.slider-tooltip {
    font-family: system-ui, -apple-system, sans-serif !important;
}

/* Chart header actions */
.chart-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.chart-header-actions .btn {
    margin: 0;
    font-size: 0.85rem;
    padding: 4px 8px;
}

/* Google Sheets Import Section */
.import-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.import-divider span {
    background: #f7fafc;
    padding: 0 15px;
    color: #718096;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.import-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 0;
}

.google-sheets-section {
    background: #fff;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.google-sheets-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2d3748;
    font-size: 1.1rem;
}

.sheets-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.sheets-url-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.95rem;
}

.sheets-url-input:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.sheets-url-input.invalid {
    border-color: #e53e3e;
}

.sheets-url-input.invalid:focus {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.sheets-help-text {
    margin-top: 10px;
    color: #718096;
}

.sheets-help-text small {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4a5568;
}

.source-list {
    list-style: none;
    padding-left: 0;
    margin: 8px 0 0 0;
}

.source-list li {
    padding: 4px 0;
    font-size: 0.8rem;
    color: #718096;
    border-left: 3px solid #e2e8f0;
    padding-left: 12px;
    margin-bottom: 6px;
}

.source-list li strong {
    color: #2d3748;
    font-weight: 600;
}

/* Chart configuration enhancements */
.viz-checkbox {
    margin-right: 8px;
    transform: scale(1.1);
}

.config-help {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-style: italic;
    font-size: 0.85em;
}

.config-row label.config-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #374151;
}

.config-row label.config-label input[type="checkbox"] {
    margin-right: 8px;
}

/* Chart Fullscreen Mode */
.chart-container {
  transition: all 0.3s ease;
}

.chart-container.fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 10000 !important;
  background: white !important;
  padding: 40px !important;
  box-sizing: border-box !important;
}

.chart-container.fullscreen canvas {
  width: 100% !important;
  height: calc(100% - 80px) !important;
  max-width: none !important;
  max-height: none !important;
  background: transparent !important;
}

/* Ensure Chart.js canvas has correct background in fullscreen */
.chart-container.fullscreen canvas[style] {
  background-color: white !important;
}

/* Additional fix for canvas background issues */
#chart-container.fullscreen canvas {
  background-color: white !important;
  background-image: none !important;
}

/* Force white background for any canvas element in fullscreen */
.fullscreen canvas {
  background: white !important;
}

.fullscreen-exit-btn {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 10001;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.fullscreen-exit-btn:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}
.fullscreen-slide-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  transition: transform 0.4s ease-in-out;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.fullscreen-slide-panel.visible {
  opacity: 1;
  pointer-events: auto;
}
/* Date Range Filter Styles */
.date-range-filter {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  min-width: 600px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.date-range-filter.hidden {
  display: none !important;
}

.date-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
  border-radius: 12px 12px 0 0;
}

.date-filter-header h4 {
  margin: 0;
  color: #1f2937;
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: #e5e7eb;
  color: #374151;
}

.date-filter-content {
  padding: 20px;
  flex: 1;
}

.date-filter-item {
  margin-bottom: 24px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.date-filter-item h5 {
  margin: 0 0 12px 0;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
}

.date-range-inputs {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.date-input-group {
  flex: 1;
  min-width: 200px;
}

.date-input-group label {
  display: block;
  margin-bottom: 4px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-input-group input[type="date"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  transition: border-color 0.2s ease;
}

.date-input-group input[type="date"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.quick-ranges {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.quick-range-btn {
  padding: 6px 12px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
}

.quick-range-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.quick-range-btn:active {
  background: #e5e7eb;
}

.date-range-info {
  color: #6b7280;
  font-size: 11px;
}

.date-filter-actions {
  padding: 16px 20px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-radius: 0 0 12px 12px;
}

.no-date-columns {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 40px 20px;
}

.date-filter-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.date-filter-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.date-filter-btn:active {
  transform: translateY(0);
}

/* Fullscreen tab button group */
.fullscreen-tab-button-group {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0;
  z-index: 10000;
}

.fullscreen-tab-button, .fullscreen-export-button {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #e5e7eb;
  border-top: none;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  position: relative;
}

/* Middle button (Zeitfilter) */
.fullscreen-tab-button {
  border-radius: 0 0 12px 12px;
  padding: 8px 20px;
  border-left: 2px solid #e5e7eb;
  border-right: 2px solid #e5e7eb;
}

/* Export buttons (left and right) */
.fullscreen-export-button {
  padding: 8px 14px;
  border-left: none;
  border-right: none;
}

.fullscreen-png-export {
  border-radius: 0 0 0 12px;
  border-left: 2px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
}

.fullscreen-video-export {
  border-radius: 0 0 12px 0;
  border-left: 1px solid #e5e7eb;
  border-right: 2px solid #e5e7eb;
}

.fullscreen-tab-button:hover, .fullscreen-export-button:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(2px);
}

.fullscreen-export-button:hover {
  background: rgba(239, 246, 255, 1);
  border-color: #3b82f6;
}

.fullscreen-tab-button span, .fullscreen-export-button span {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

.fullscreen-export-button span {
  color: #3b82f6;
  font-weight: 600;
}
.fullscreen-panel-content {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 2px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 25px 40px;
}
.fullscreen-time-filter {
  /* Keep original TimeRangeSlider styling but add proper spacing */
  background: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  width: 100% !important;
}

.fullscreen-controls button {
  padding: 8px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}

.fullscreen-controls button:hover {
  background: var(--primary-hover);
}

.fullscreen-controls .btn-play {
  background: var(--success-color);
}

.fullscreen-controls .btn-play:hover {
  background: var(--success-hover);
}
.fullscreen-controls .exit-fullscreen-btn {
  align-self: flex-end;
  padding: 8px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s;
}
.fullscreen-controls .exit-fullscreen-btn:hover {
  background: var(--primary-hover);
}
.fullscreen-time-filter {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

/* Time Display */
.time-display {
  position: absolute !important;
  top: 20px !important;
  left: 20px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  padding: 20px 25px !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
  z-index: 100 !important;
  pointer-events: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  min-width: 180px !important;
}

.time-display .year-label {
  font-size: 36px !important;
  font-weight: 700 !important;
  color: var(--text-color) !important;
  line-height: 1 !important;
  margin-bottom: 12px !important;
  width: 100% !important;
  text-align: left !important;
  display: block !important;
}

.time-display .month-progress {
  width: 150px !important;
  height: 12px !important;
  background: #e5e7eb !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  position: relative !important;
  display: block !important;
  margin-top: 0 !important;
}

.time-display .month-segments {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  gap: 1px;
  z-index: 2;
  pointer-events: none;
}

.time-display .month-segment {
  flex: 1;
  background: transparent;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.time-display .month-segment:last-child {
  border-right: none;
}

.time-display .month-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--primary-color);
  border-radius: 6px;
  transition: width 0.3s ease;
  z-index: 1;
}

.time-display.fullscreen-mode .year-label {
  font-size: 48px;
}

.time-display.fullscreen-mode .month-progress {
  width: 200px;
  height: 16px;
}

/* Video Export Mode - Extra large time display */
.time-display.video-export-mode {
  top: 30px !important;
  left: 30px !important;
  padding: 30px 40px !important;
  min-width: 300px !important;
  border-radius: 20px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
}

.time-display.video-export-mode .year-label {
  font-size: 64px !important;
  margin-bottom: 20px !important;
  font-weight: 800 !important;
}

.time-display.video-export-mode .month-progress {
  width: 280px !important;
  height: 24px !important;
  border-radius: 12px !important;
}

/* Scompler API Panel Styles */
.scompler-api-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow: hidden;
}

.api-panel-header {
  background: linear-gradient(135deg, #6b46c1, #553c9a);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.api-panel-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.btn-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.api-panel-content {
  max-height: calc(90vh - 80px);
  overflow-y: auto;
  padding: 0;
}

.api-section {
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
}

.api-section:last-child {
  border-bottom: none;
}

.api-section h4 {
  margin: 0 0 16px 0;
  color: #2d3748;
  font-size: 1.1rem;
  font-weight: 600;
}

/* Connection Form Styles */
.connection-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  position: relative;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  color: #4a5568;
  font-weight: 500;
}

.api-input {
  width: 100%;
  padding: 12px 40px 12px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.api-input:focus {
  outline: none;
  border-color: #6b46c1;
  box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.btn-toggle-visibility {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.btn-toggle-visibility:hover {
  background-color: #f7fafc;
}

.connection-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.connection-status {
  padding: 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}

.connection-status.success {
  background-color: #f0fff4;
  color: #22543d;
  border: 1px solid #9ae6b4;
}

.connection-status.error {
  background-color: #fed7d7;
  color: #742a2a;
  border: 1px solid #fc8181;
}

.connection-status.info {
  background-color: #ebf8ff;
  color: #2a4365;
  border: 1px solid #90cdf4;
}

/* Import Options Styles */
.import-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-group label {
  font-weight: 500;
  color: #4a5568;
}

.api-select {
  padding: 10px 12px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s;
}

.api-select:focus {
  outline: none;
  border-color: #6b46c1;
}

.import-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

/* Preview Section Styles */
.data-preview {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
}

.preview-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.preview-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.preview-data-table th {
  background: #6b46c1;
  color: white;
  padding: 12px 8px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
}

.preview-data-table td {
  padding: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.preview-data-table tr:hover td {
  background-color: #f7fafc;
}

/* API Info Styles */
.api-info details {
  margin-top: 16px;
}

.api-info summary {
  cursor: pointer;
  padding: 8px 0;
  color: #6b46c1;
  font-weight: 500;
  user-select: none;
}

.api-info summary:hover {
  color: #553c9a;
}

.info-content {
  padding: 12px 0;
  color: #4a5568;
  line-height: 1.6;
}

.info-content ol {
  margin: 8px 0 8px 20px;
}

.info-content li {
  margin-bottom: 4px;
}

/* Rate Limit Info */
.rate-limit-info {
  color: #4a5568;
  line-height: 1.6;
}

.rate-limit-info ul {
  margin: 8px 0 0 20px;
}

.rate-limit-info li {
  margin-bottom: 4px;
}

/* Button Loading State */
.btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
  .scompler-api-panel {
    width: 95%;
    max-height: 95vh;
  }
  
  .connection-actions,
  .import-actions {
    flex-direction: column;
  }
  
  .preview-stats {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

/* Scompler API Panel - New Workflow Styling */
.import-workflow-info {
  background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
  border: 1px solid #b39ddb;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.workflow-step {
  color: #4a148c;
}

.workflow-step strong {
  color: #6a1b9a;
}

.workflow-step ol {
  margin-top: 8px;
  margin-left: 20px;
}

.workflow-step li {
  margin: 6px 0;
  line-height: 1.4;
}

.input-help {
  display: block;
  color: #666;
  font-size: 0.85rem;
  margin-top: 4px;
  font-style: italic;
}

.import-benefits {
  margin-top: 20px;
}

.import-benefits summary {
  cursor: pointer;
  font-weight: 600;
  color: #6b46c1;
  padding: 8px 0;
}

.import-benefits summary:hover {
  color: #553c9a;
}

.benefits-content {
  padding: 12px 0;
  border-top: 1px solid #e9ecef;
  margin-top: 8px;
}

.benefits-content ul {
  margin-left: 20px;
}

.benefits-content li {
  margin: 8px 0;
  line-height: 1.5;
}

.preview-note {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}

.preview-note p {
  margin-bottom: 10px;
  color: #495057;
  font-weight: 600;
}

.preview-note ul {
  margin-left: 20px;
}

.preview-note li {
  margin: 6px 0;
  color: #6c757d;
  line-height: 1.4;
}

.preview-note strong {
  color: #495057;
}

/* ===============================================
   UNIFIED MODAL SYSTEM
   =============================================== */

/* Base Modal Styles - Referenz: Scompler API Modal */
.unified-modal-base {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.unified-modal-base.hidden {
  display: none !important;
}

/* Modal Overlay */
.unified-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  display: none !important;
}

.unified-modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
  display: block !important;
}

/* Modal Header */
.unified-modal-header {
  background: linear-gradient(135deg, #6b46c1, #553c9a);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.unified-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

.unified-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background-color 0.2s ease;
}

.unified-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Modal Content */
.unified-modal-content {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
  max-height: calc(90vh - 140px); /* Header (80px) + Footer (60px) */
}

/* Modal Footer */
.unified-modal-footer {
  padding: 15px 25px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
  background: #f8fafc;
}

/* Modal Button Styles */
.unified-modal-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.unified-modal-btn-primary {
  background: linear-gradient(135deg, #6b46c1, #553c9a);
  color: white;
}

.unified-modal-btn-primary:hover {
  background: linear-gradient(135deg, #553c9a, #4c1d95);
  transform: translateY(-1px);
}

.unified-modal-btn-secondary {
  background: #e2e8f0;
  color: #4a5568;
}

.unified-modal-btn-secondary:hover {
  background: #cbd5e0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .unified-modal-base {
    width: 95%;
    max-height: 95vh;
    margin: 10px;
  }
  
  .unified-modal-header {
    padding: 15px;
  }
  
  .unified-modal-header h3 {
    font-size: 1.3rem;
  }
  
  .unified-modal-content {
    padding: 20px;
    max-height: calc(95vh - 120px);
  }
  
  .unified-modal-footer {
    padding: 12px 20px;
    flex-direction: column;
  }
  
  .unified-modal-btn {
    width: 100%;
  }
}

/* ===============================================
   SPECIFIC MODAL CONTENT STYLES
   =============================================== */

/* ColumnTypePanel Specific Styles */
#column-type-panel .column-type-list {
  display: grid;
  gap: 15px;
}

#column-type-panel .column-type-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.2s ease;
}

#column-type-panel .column-type-item:hover {
  background: #f1f5f9;
  border-color: #cbd5e0;
}

#column-type-panel .column-header {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#column-type-panel .column-type-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
}

#column-type-panel .column-type-select:focus {
  border-color: #6b46c1;
  outline: none;
  box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

#column-type-panel .column-preview {
  margin-top: 10px;
  padding: 8px;
  background: white;
  border-radius: 4px;
  font-size: 0.85rem;
  color: #4a5568;
  border-left: 3px solid #6b46c1;
}

/* DateRangeFilter Specific Styles */
#date-range-filter .date-filter-section {
  margin-bottom: 20px;
}

#date-range-filter .date-filter-section h5 {
  margin: 0 0 12px 0;
  color: #2d3748;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

#date-range-filter .date-input-group {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

#date-range-filter .date-input-group label {
  min-width: 60px;
  font-size: 0.9rem;
  color: #4a5568;
  font-weight: 500;
}

#date-range-filter .date-input-group input[type="date"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
}

#date-range-filter .date-input-group input[type="date"]:focus {
  border-color: #6b46c1;
  outline: none;
  box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

#date-range-filter .filter-info {
  background: #e6fffa;
  border: 1px solid #81e6d9;
  border-radius: 6px;
  padding: 12px;
  margin-top: 15px;
  font-size: 0.9rem;
  color: #234e52;
}

/* Better spacing for modal controls */
.column-type-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e2e8f0;
}

/* Enhanced scroll styling for modal content */
.unified-modal-content::-webkit-scrollbar {
  width: 8px;
}

.unified-modal-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.unified-modal-content::-webkit-scrollbar-thumb {
  background: #cbd5e0;
  border-radius: 4px;
}

.unified-modal-content::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* ===============================================
   COLUMN REORDER MODAL SPECIFIC STYLES
   =============================================== */

/* Column blocks for drag & drop */
.column-block {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  cursor: grab;
}

.column-block:hover {
  border-color: #6b46c1;
  box-shadow: 0 2px 5px rgba(107, 70, 193, 0.2);
}

.column-block:active {
  cursor: grabbing;
}

.column-block.hidden {
  opacity: 0.7;
  border-style: dashed;
}

.column-block-content {
  display: flex;
  align-items: center;
  padding: 12px;
  gap: 10px;
}

.column-block .drag-handle {
  color: #9ca3af;
  font-size: 16px;
  cursor: grab;
  user-select: none;
}

.column-block .column-name {
  flex: 1;
  font-weight: 500;
  color: #2d3748;
}

.column-block .column-type {
  font-size: 12px;
  color: #4a5568;
  background: #f7fafc;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.column-block .toggle-visibility {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.column-block .toggle-visibility:hover {
  background: rgba(107, 70, 193, 0.1);
}

/* Drop zones styling */
.column-list:empty::after {
  content: 'Spalten hierher ziehen...';
  color: #9ca3af;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  text-align: center;
}

/* Drag indicators */
.drag-indicator {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.4; }
}

/* Mobile responsive for column sections */
@media (max-width: 768px) {
  #column-reorder-modal .column-sections {
    grid-template-columns: 1fr !important;
  }
}

/* Chart Styling Controls */
.config-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.config-section-title {
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
}

.color-input-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.color-picker {
    width: 40px;
    height: 32px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-picker:hover {
    border-color: #3182ce;
}

.hex-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    text-transform: uppercase;
}

.hex-input:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.number-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
    margin: 0 8px;
}

.number-input:focus {
    outline: none;
    border-color: #3182ce;
}

.config-select {
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    min-width: 150px;
}

.config-select:focus {
    outline: none;
    border-color: #3182ce;
}

/* Chart highlighting effects */
.chart-glow {
    filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.6));
}

.chart-glow-container {
    filter: drop-shadow(0 0 12px rgba(231, 76, 60, 0.4));
    animation: chartPulse 2s ease-in-out infinite alternate;
}

@keyframes chartPulse {
    0% {
        filter: drop-shadow(0 0 8px rgba(231, 76, 60, 0.3));
    }
    100% {
        filter: drop-shadow(0 0 16px rgba(231, 76, 60, 0.6));
    }
}

.chart-pattern {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.3) 2px,
        rgba(255, 255, 255, 0.3) 4px
    );
}

/* Chart Toggle Buttons - Unified Design */
.chart-toggle-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 400; /* Reduced from 500 to match vorlage */
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 4px;
    min-height: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-family: system-ui, -apple-system, sans-serif;
}

.chart-toggle-button:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    border-color: #a0aec0;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.chart-toggle-button.active {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    border-color: #2c5aa0;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.3);
}

.chart-toggle-button.active:hover {
    background: linear-gradient(135deg, #2c5aa0 0%, #2a4d8d 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(49, 130, 206, 0.4);
}

.chart-toggle-button .button-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
}

.chart-toggle-button .button-text {
    font-weight: 400; /* Reduced from 500 to match vorlage */
    white-space: nowrap;
}

.chart-toggle-button.active .button-text {
    color: inherit !important;
}

.chart-toggle-button.active .button-icon {
    color: inherit !important;
}

/* Fullscreen specific button adjustments */
.fullscreen-chart-button {
    font-weight: 400 !important;
    font-family: system-ui, -apple-system, sans-serif !important;
}

.fullscreen-chart-button .button-text {
    font-weight: 400 !important;
}

/* Chart header button layout adjustments */
.chart-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.chart-header-option {
    display: none !important; /* Hide original checkbox labels */
}

/* Chart options panel button layout */
.chart-options-content .option-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
}

.chart-options-content .option-item .chart-toggle-button {
    margin: 0;
    width: 100%;
    justify-content: flex-start;
}

/* Fullscreen header buttons - match the style */
.fullscreen-data-labels,
.fullscreen-time-display {
    margin: 4px !important;
    font-weight: 400 !important;
    font-family: system-ui, -apple-system, sans-serif !important;
}

.fullscreen-data-labels .button-text,
.fullscreen-time-display .button-text {
    font-weight: 400 !important;
}

/* Remove old fullscreen export button styles that conflict */
.fullscreen-export-button {
    /* Reset any conflicting styles */
    font-weight: 400 !important;
}

/* ==============================================
   LAZY LOADING SPINNER
   ============================================== */

.lazy-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn 0.2s ease-in;
}

.spinner-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
}

.spinner-box {
    position: relative;
    background: white;
    padding: 40px 60px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 1;
}

.spinner-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-message {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* ============================================================================
   Time Granularity Manager in Visualization Panel
   ============================================================================ */

.time-granularity-wrapper {
  margin-bottom: 20px;
  padding: 0;
}

/* Ensure the panel is visible when in visualization panel */
#visualization-panel .time-granularity-panel {
  margin-top: 0;
  margin-bottom: 20px;
}

/* Make sure it's above the TimeRangeSlider */
#visualization-panel > #time-granularity-container {
  order: -1;
  z-index: 10;
}

