/* PIM System - Main Stylesheet */

/* Global Styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --success-color: #2ecc71;
    --success-color-light: rgba(46, 204, 113, 0.1);
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --bg-hover: rgba(52, 152, 219, 0.05);
    --bg-input: #ffffff;
    --border-color: #bdc3c7;
    --tab-bg-color: #3498db;
    --tab-active-color: #2980b9;
    --form-bg-color: #d6eaf8;
    --sort-arrow-color: #666;
    --sort-arrow-active-color: #3498db;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    height: 60px;
    border-bottom: 1px solid var(--border-medium);
    box-shadow: 0 2px 4px var(--shadow-sm);
}

/* Charge Selector Dropdown */
.charge-selector {
    margin-left: 10px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    color: var(--dark-color);
    min-width: 150px;
    cursor: pointer;
}

.charge-selector:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.package-content h3 {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--dark-color);
}

.logo h1 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}













.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
    color: var(--text-secondary);
}

/* Tab Toolbar Styles */
.tab-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

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

.tab-toolbar .btn:hover {
    background-color: var(--secondary-color);
}

.tab-toolbar .btn i {
    margin-right: 5px;
}

/* Glass Button Base Class */
.btn-glass {
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(1.25rem);
    -webkit-backdrop-filter: blur(1.25rem);
    text-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
}

.btn-glass:hover {
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: translateY(-0.1875rem);
}

/* Glass Button Variants */
.btn-glass.btn-export {
    background: rgba(46, 204, 113, 0.25);
    box-shadow: 0 0.5rem 2rem 0 rgba(46, 204, 113, 0.37);
}

.btn-glass.btn-export:hover {
    background: rgba(46, 204, 113, 0.35);
    box-shadow: 0 0.9375rem 2.1875rem 0 rgba(46, 204, 113, 0.5);
}

.btn-glass.btn-import {
    background: rgba(243, 156, 18, 0.25);
    box-shadow: 0 0.5rem 2rem 0 rgba(243, 156, 18, 0.37);
}

.btn-glass.btn-import:hover {
    background: rgba(243, 156, 18, 0.35);
    box-shadow: 0 0.9375rem 2.1875rem 0 rgba(243, 156, 18, 0.5);
}

/* Enhanced Search Functionality Styles */
.input-with-search.search-active {
    position: relative;
}

.input-with-search.search-active::after {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
    z-index: 2;
}

.input-with-search.search-active input {
    background-color: #f0f8ff !important;
    border-color: var(--primary-color) !important;
    padding-right: 35px !important;
}

/* Search Controls */
.search-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.search-info {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
    font-weight: 600;
}

.page-size-selector {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 12px;
    background: var(--bg-card);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Search Status */
.search-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

/* Search Mode Toolbar */
.toolbar.search-mode {
    background: linear-gradient(135deg, #2e2e2f 0%, #f0f8ff 100%);
    border-bottom: 2px solid var(--primary-color);
}

.toolbar.search-mode .btn {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Enhanced Navigation */
.navigation {
    display: flex;
    align-items: center;
    gap: 10px;
}

#record-counter {
    font-weight: 600;
    color: var(--dark-color);
    min-width: 150px;
    text-align: center;
}

/* Search Result Indicators */
.search-result-highlight {
    background-color: var(--notification-warning-bg);
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 2px 4px;
    margin: 0 2px;
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

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

/* Form Field Enhancement */
.form-group.search-field {
    position: relative;
}

.form-group.search-field::before {
    content: 'Suchfeld';
    position: absolute;
    top: -5px;
    right: 5px;
    background: var(--primary-color);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    z-index: 3;
    display: none;
}

.form-group.search-field.active::before {
    display: block;
}

/* Responsive Search UI */
@media (max-width: 768px) {
    .search-controls {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .navigation {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    #record-counter {
        min-width: auto;
        text-align: left;
    }
}

/* Search Result Tables */
.search-results-table {
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
}

.search-results-table thead {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.search-results-table tbody tr:hover {
    background-color: #03076e;
    cursor: pointer;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

.no-results h3 {
    margin-bottom: 10px;
    color: #444;
}

.no-results p {
    font-size: 14px;
    line-height: 1.5;
}

/* Property Selection Modal Styles */
.property-selection-container {
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.search-properties {
    margin-bottom: 15px;
}

.search-properties .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
}

.properties-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    background-color: var(--bg-card);
}

.property-checkbox-item {
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

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

.property-checkbox-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.property-checkbox-item input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
}

.property-name {
    font-weight: 500;
    margin-right: 10px;
}

.property-type {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.loading, .error {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error {
    color: var(--danger-color);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f5f5;
}

/* Duplicate header styles removed - consolidated in first definition */

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-name {
    font-weight: bold;
}

.user-role {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--light-color);
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.navigation {
    display: flex;
    align-items: center;
}

#record-counter {
    margin: 0 0.5rem;
}

/* Sharp Buttons with Glass Effect */
.btn {
    background: rgba(52, 152, 219, 0.22);
    color: white;
    border: 1px solid rgba(52, 152, 219, 0.28);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 6px 20px 0 rgba(52, 152, 219, 0.3),
        0 0 8px 0 rgba(52, 152, 219, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
    position: relative;
    overflow: hidden;
}

.btn:hover:not(:disabled) {
    background: rgba(52, 152, 219, 0.32);
    border: 1px solid rgba(80, 180, 255, 0.4);
    box-shadow: 
        0 12px 30px 0 rgba(52, 152, 219, 0.4),
        0 0 12px 0 rgba(52, 152, 219, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transform: translateY(-3px);
}

/* No shimmer effect for main buttons */
.btn::before {
    display: none;
}

.btn:hover::before {
    display: none;
}

.btn:disabled,
.btn.disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-primary {
    background: rgba(231, 76, 60, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px 0 rgba(231, 76, 60, 0.37);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: rgba(231, 76, 60, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 35px 0 rgba(231, 76, 60, 0.5);
    transform: translateY(-3px);
}

/* Loading States */
.btn.loading {
    position: relative;
    pointer-events: none;
}

.tab-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.modal-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-loading-spinner {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    min-width: 200px;
}

.modal-loading-spinner i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.modal-loading-spinner span {
    display: block;
    color: var(--dark-color);
    font-size: 14px;
}

/* Duplicate spinner animation removed - kept first definition */

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

/* Additional Glass Button Variants */
.btn-glass.btn-delete {
    background: rgba(231, 76, 60, 0.25);
    box-shadow: 0 0.5rem 2rem 0 rgba(231, 76, 60, 0.37);
}

.btn-glass.btn-delete:hover {
    background: rgba(231, 76, 60, 0.35);
    box-shadow: 0 0.9375rem 2.1875rem 0 rgba(231, 76, 60, 0.5);
}

.btn-glass.btn-success {
    background: rgba(46, 204, 113, 0.25);
    box-shadow: 0 0.5rem 2rem 0 rgba(46, 204, 113, 0.37);
}

.btn-glass.btn-success:hover {
    background: rgba(46, 204, 113, 0.35);
    box-shadow: 0 0.9375rem 2.1875rem 0 rgba(46, 204, 113, 0.5);
}

/* Search Bar */
.search-bar {
    display: flex;
    margin-bottom: 1rem;
}

.search-bar input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    font-size: 0.9rem;
}

.search-bar .btn {
    border-radius: 0 4px 4px 0;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
}

.progress-bar {
    height: 5px;
    background-color: var(--light-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--success-color);
    border-radius: 3px;
    transition: background-color 0.3s ease;
}

.progress-fill.new-record {
    background-color: var(--danger-color);
}

.progress-fill.saved-record {
    background-color: var(--success-color);
}

/* Main Form */
.main-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    background-color: var(--form-bg-color);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: visible;
}

.form-group label {
    flex: 0 0 80px;
    margin-bottom: 0;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: right;
}

.input-with-search {
    display: flex;
    flex: 1;
    max-width: calc(100% - 50px);
}

.input-with-search input,
.input-with-search select {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

.btn-icon {
    background: rgba(52, 152, 219, 0.15);
    color: var(--primary-color);
    border: 1px solid rgba(52, 152, 219, 0.22);
    cursor: pointer;
    font-size: 1rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 
        0 3px 12px 0 rgba(52, 152, 219, 0.2),
        0 0 6px 0 rgba(52, 152, 219, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 0 0 auto;
    margin-left: 0.3rem;
    padding: 0.5rem;
    z-index: 10;
    position: relative;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
}

.btn-icon:hover {
    color: white;
    background: rgba(52, 152, 219, 0.28);
    border: 1px solid rgba(80, 180, 255, 0.4);
    box-shadow: 
        0 6px 20px 0 rgba(52, 152, 219, 0.3),
        0 0 10px 0 rgba(52, 152, 219, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transform: scale(1.1) translateY(-2px);
}

/* No shimmer effect for icon buttons */
.btn-icon::before {
    display: none;
}

.btn-icon:hover::before {
    display: none;
}

.field-warning {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 0.3rem;
    display: none;
}

/* Charge-dependent field styling */
.field-hint.charge-dependent {
    display: block;
    color: #666;
    font-size: 11px;
    margin-top: 3px;
    font-style: italic;
}

.charge-indicator {
    color: #007bff;
    font-weight: normal;
    font-size: 0.9em;
}

.package-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 16px 0 8px 0;
}

.package-controls .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.package-controls .btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Selected charge row styling - moved to charge-row section below */

/* Package input styling */
.package-input {
    width: 100%;
    border: 1px solid #ddd;
    padding: 5px 8px;
    border-radius: 3px;
    font-size: 14px;
}

.package-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}


.btn-icon.btn-add {
    color: #28a745;
}

.btn-icon.btn-add:hover {
    background-color: #28a745;
    color: white;
}

/* Property Management - Feature Styling */
.property-group-header {
    background-color: #f8f9fa !important;
    font-weight: bold;
}

.property-feature-row {
    background-color: #fff9f9 !important;
}

.property-feature-row:hover {
    background-color: #fff5f5 !important;
}

.property-feature-row td:first-child {
    font-weight: bold;
    color: #e74c3c;
}

/* Feature star icon */
.property-feature-row td:first-child::before {
    content: "⭐ ";
    margin-right: 5px;
}

/* Group header styling for features */
.property-group-header.features-header {
    background-color: #fff5f5 !important;
    border-left: 4px solid #e74c3c !important;
}

.property-group-header.features-header td {
    color: #e74c3c !important;
    font-size: 16px !important;
}

/* Regular group headers */
.property-group-header:not(.features-header) {
    background-color: #f8f9fa !important;
    border-left: 4px solid #666 !important;
}

/* Status message styling for management interface */
.status-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Image Upload */
.image-upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.image-preview {
    width: 220px;
    height: 280px;
    border: none;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
    background-color: var(--bg-card);
    flex-shrink: 0;
}

.placeholder-text {
    text-align: center;
    color: #95a5a6;
}

/* Package Content */
.package-table-container {
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-card);
    flex: 1;
    min-height: 200px;
    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-card);
}

/* Package table scrollbar styling */
.package-table-container::-webkit-scrollbar {
    width: 12px;
}

.package-table-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 6px;
}

.package-table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

.package-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Enhanced scrollbar styling for package table */
.package-table-container::-webkit-scrollbar {
    width: 8px;
}

.package-table-container::-webkit-scrollbar-track {
    background: var(--bg-card);
    border-radius: 4px;
}

.package-table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: background-color 0.2s;
}

.package-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Ensure package table fits container */
.package-table-container #package-table {
    margin: 0;
    border-radius: 0;
    border: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5rem;
}

table th,
table td {
    padding: 0.35rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    line-height: 1.3;
}

table th {
    background-color: var(--light-color);
    font-weight: 600;
}

/* Tabs with Visual Separation */
.tabs-container {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.tabs-header {
    display: flex;
    overflow-x: auto;
    background-color: #f8f9fa; /* Heller Hintergrund für die Tab-Leiste */
    border-bottom: 1px solid #dee2e6; /* Dezente Trennlinie unter den Tabs */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtiler Schatten für Tiefe */
}

.tab-btn {
    padding: 0.7rem 1rem;
    background-color: #6c757d; /* Grau für inaktive Tabs */
    color: white;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2); /* Dezente Trennlinie */
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.tab-btn:hover {
    background-color: #5a6268; /* Dunkleres Grau beim Hover */
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background-color: #007bff; /* Blau nur für aktiven Tab */
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 600;
    position: relative;
}

/* Aktiver Tab Indikator */
.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #0056b3; /* Dunkleres Blau für den Indikator */
}

/* Letzter Tab hat keine rechte Trennlinie */
.tab-btn:last-child {
    border-right: none;
}

.tab-content {
    padding: 1rem;
    background-color: var(--bg-card);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 20px;
}

.tab-pane p {
    margin-bottom: 1rem;
    color: #7f8c8d;
}

/* Dynamic Fields */
.dynamic-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-card);
    border-radius: 4px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.close-modal {
    background-color: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-color);
}

/* Footer */
footer {
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .main-form {
        grid-template-columns: 1fr;
    }
    
    .toolbar {
        flex-wrap: wrap;
    }
    
    .dynamic-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .tabs-header {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1 0 auto;
    }
}
/* Zusätzliche Styles für PIM System */

/* Button Sizes */
.btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
}

/* Form Controls */
.form-control {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Drag & Drop Visual Feedback */
.image-preview.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(52, 152, 219, 0.1);
}

/* Field Search Buttons */
.field-search-btn {
    background: rgba(52, 152, 219, 0.2);
    color: white;
    border: 1px solid rgba(52, 152, 219, 0.25);
    padding: 0.5rem 0.7rem;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 6px 20px 0 rgba(52, 152, 219, 0.28),
        0 0 6px 0 rgba(52, 152, 219, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.field-search-btn:hover {
    background: rgba(52, 152, 219, 0.28);
    border: 1px solid rgba(80, 180, 255, 0.35);
    box-shadow: 
        0 10px 25px 0 rgba(52, 152, 219, 0.35),
        0 0 10px 0 rgba(52, 152, 219, 0.22);
    transform: translateY(-2px);
}

/* No shimmer effect for field search buttons */
.field-search-btn::before {
    display: none;
}

.field-search-btn:hover::before {
    display: none;
}

/* Table Toolbar */
.table-toolbar {
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Data Table Container */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
}

/* Address Table Container */
.address-container .table-container,
#address-table-container {
    width: 100%;
    overflow-x: visible;
    overflow-y: visible;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-card);
}


/* Address Table - Fixed width layout */
#address-table {
    border-collapse: collapse !important;
    table-layout: fixed !important;
    width: 1130px !important;
    max-width: 1130px !important;
    min-width: 1130px !important;
    background-color: var(--bg-card);
}

#address-table th,
#address-table td {
    padding: 0.4rem;
    text-align: left;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

#address-table th {
    background-color: var(--light-color);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

#address-table tbody tr:hover {
    background-color: var(--bg-hover);
}

/* Address Table Column Widths - Fixed pixel implementation */

/* NUCLEAR OPTION: Absolute pixel widths that cannot be overridden */
#address-table th:nth-child(2), 
#address-table td:nth-child(2) { 
    width: 100px !important; 
    min-width: 100px !important; 
    max-width: 100px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#address-table th:nth-child(3), 
#address-table td:nth-child(3) { 
    width: 200px !important; 
    min-width: 200px !important; 
    max-width: 200px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#address-table th:nth-child(4), 
#address-table td:nth-child(4),
#address-table th:nth-child(5), 
#address-table td:nth-child(5),
#address-table th:nth-child(6), 
#address-table td:nth-child(6) { 
    width: 120px !important; 
    min-width: 120px !important; 
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#address-table th:nth-child(7), 
#address-table td:nth-child(7) { 
    width: 120px !important; 
    min-width: 120px !important; 
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#address-table th:nth-child(8), 
#address-table td:nth-child(8) { 
    width: 200px !important; 
    min-width: 200px !important; 
    max-width: 200px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#address-table th:nth-child(9), 
#address-table td:nth-child(9) { 
    width: 150px !important; 
    min-width: 150px !important; 
    max-width: 150px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Address Table Container - No horizontal scrolling needed */
#address-table-container {
    border: 1px solid var(--border-color);
    max-width: 100%;
    width: 100%;
    overflow-x: visible;
}

/* Responsive Design für Address Table */
@media (max-width: 768px) {
    #address-table {
        font-size: 0.85rem;
    }
    
    #address-table th,
    #address-table td {
        padding: 0.3rem;
    }
}

/* Enhanced Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg-card);
}

.data-table th,
.data-table td {
    padding: 0.4rem;
    text-align: left;
    border: 1px solid var(--border-color);
    line-height: 1.3;
}

.data-table th {
    background-color: var(--light-color);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.data-table .btn-icon {
    padding: 0.3rem 0.5rem;
    margin: 0 0.2rem;
}

/* Loading Indicator */
#loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Duplicate keyframes removed - using first definition */

/* Message Container */
#message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    min-width: 300px;
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

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

.message.fade-out {
    animation: fadeOut 0.5s ease-out;
}

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

.message.success {
    background-color: var(--success-color);
    color: white;
}

.message.error {
    background-color: var(--danger-color);
    color: white;
}

.message.warning {
    background-color: var(--warning-color);
    color: white;
}

.message.info {
    background-color: var(--primary-color);
    color: white;
}

.message-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-icon {
    font-size: 1.2rem;
}

.message-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.message-close:hover {
    opacity: 1;
}

/* Modal Enhancements */
.modal {
    backdrop-filter: blur(5px);
}

.modal-content {
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Tab Content Loading State */
.tab-pane[data-loaded="false"] {
    min-height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #999;
}

.tab-pane[data-loaded="false"]::after {
    content: "Loading...";
}

/* Field Validation Visual Feedback */
input:invalid {
    border-color: var(--danger-color);
}

input:valid {
    border-color: var(--success-color);
}

/* Responsive Table */
@media (max-width: 768px) {
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.3rem;
    }
    
    .table-toolbar {
        flex-wrap: wrap;
    }
    
    .message {
        min-width: 250px;
        font-size: 0.9rem;
    }
}

/* Print Styles */
@media print {
    .toolbar,
    .tabs-header,
    .btn,
    .field-search-btn,
    #message-container,
    #loading-indicator {
        display: none !important;
    }
    
    .main-form {
        grid-template-columns: 1fr;
    }
    
    .tab-pane {
        display: block !important;
        page-break-before: always;
    }
}

/* Compact Package Contents Styles */
#package-table {
    font-size: 14px;
    width: 100%;
}

#package-table thead th {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 6px 8px;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

#package-table tbody tr {
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

#package-table tbody tr:hover {
    background-color: var(--bg-hover);
}

#package-table tbody tr:last-child {
    border-bottom: none;
}

#package-table td {
    padding: 4px 8px;
    vertical-align: middle;
}

/* Visual indicator removed - was disturbing */

.package-item-cell {
    width: 60%; /* Adjusted for image-first layout */
    padding: 8px;
}

.package-item-compact {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Package Contents Image Column */
.package-image-cell {
    width: 60px;
    padding: 8px;
    text-align: center;
}

.package-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: transform 0.2s ease;
    position: relative;
}

.package-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
}

.package-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.package-thumbnail-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 20px;
    border: 1px solid #e0e0e0;
}

.package-item-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

/* Large Image Preview on Hover */
.package-thumbnail .hover-preview {
    display: none;
    position: absolute;
    top: 50px;
    left: 0;
    width: 200px;
    height: 200px;
    background: white;
    border: 2px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 1000;
    overflow: hidden;
}

.package-thumbnail:hover .hover-preview {
    display: block;
}

.package-thumbnail .hover-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-name {
    font-weight: 500;
    color: #333;
    flex: 1;
    padding-right: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.info-btn:hover {
    background-color: #007bff;
    color: white;
}

.info-btn i {
    font-size: 12px;
}

.quantity-cell {
    width: 10%; /* Reduced from 20% to 10% for compact display */
    padding: 8px;
    text-align: center;
}

.quantity-display {
    display: inline-block;
    min-width: 20px;
    font-weight: 500;
    color: #333;
    text-align: center;
}

.quantity-edit {
    width: 50px;
    text-align: center;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.actions-cell {
    width: 20%; /* Keeps 20% for action buttons */
    padding: 8px;
    text-align: center;
}

.btn-icon {
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger {
    color: #dc3545;
}

.btn-danger:hover {
    background-color: #dc3545;
    color: white;
}

/* Item Details Popup */
.item-details-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 300px;
    max-width: 400px;
}

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

.popup-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.close-popup {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: color 0.2s ease;
}

.close-popup:hover {
    color: #333;
}

.popup-content {
    padding: 20px;
}

.detail-row {
    margin-bottom: 12px;
    font-size: 14px;
}

.detail-row:last-child {
    margin-bottom: 0;
}

.detail-row strong {
    color: #555;
    min-width: 60px;
    display: inline-block;
}

/* Accessories Specific Styles */
.accessories-container {
    width: 100%;
}

.accessories-table-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

#accessories-table {
    font-size: 14px;
    width: 100%;
    border-collapse: collapse;
}

.accessory-item-cell {
    width: 35%;
    padding: 8px;
}

.sku-cell, .ean-cell {
    width: 20%;
    padding: 8px;
    font-size: 13px;
}

.quantity-cell {
    width: 10%;
    padding: 8px;
    text-align: center;
}

.actions-cell {
    width: 10%;
    padding: 8px;
    text-align: center;
}

.actions-cell .btn-icon {
    margin: 0 2px;
    display: inline-flex;
    vertical-align: middle;
}

/* Address Management specific compact layout */
#address-table .actions-cell {
    white-space: nowrap;
    padding: 4px 8px;
}

#address-table .actions-cell .btn-icon {
    padding: 4px 6px;
    margin: 0 1px;
    font-size: 0.8rem;
    min-width: auto;
    display: inline-block;
}

.sku-display, .ean-display {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 13px;
    color: #495057;
    display: inline-block;
    min-width: 120px;
    max-width: none;
    overflow: visible;
    white-space: nowrap;
}

.accessory-item-compact {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Accessory thumbnail styles */
.accessory-thumbnail {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    flex-shrink: 0;
}

.accessory-thumbnail-placeholder {
    width: 40px;
    height: 40px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    flex-shrink: 0;
}

.accessory-text-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    min-width: 0; /* Allow text truncation */
}

/* Fix white text issue in accessories tab */
#accessories-table .item-name {
    color: #333 !important;
    font-weight: 500;
}

#accessories-table .sku-display,
#accessories-table .ean-display {
    color: #555 !important;
    background: #f8f9fa;
}

#accessories-table .quantity-display {
    color: #2c5282 !important;
}

#accessories-table td {
    color: #333 !important;
}

.accessory-qty {
    font-weight: 600;
    color: #2c5282;
    background: #ebf8ff;
    padding: 2px 6px;
    border-radius: 3px;
    min-width: 24px;
    text-align: center;
    display: inline-block;
}

/* Enhanced Modal Styling for Accessories */
.accessory-item .product-inputs {
    background-color: #f0f8ff;
    border-top: 1px solid #e3f2fd;
}

.accessory-quantity {
    width: 50px !important;
    max-width: 50px;
    padding: 0.3rem 0.4rem;
    text-align: center;
    font-weight: 500;
}

/* Input validation styling for 2-digit max */
.accessory-quantity:invalid {
    border-color: #e53e3e;
    background-color: #fed7d7;
}

.accessory-inputs .input-group label {
    font-weight: 600;
    color: #2d3748;
    min-width: 85px;
}

/* Compact quantity display styling */
.quantity-cell .accessory-qty {
    font-size: 13px;
    font-weight: 600;
}

/* Sortable Table Headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding: 8px 12px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.sortable-header:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.sort-arrow {
    display: inline-flex;
    flex-direction: column;
    margin-left: 4px;
    opacity: 0.4;
    transition: opacity 0.2s ease;
    vertical-align: middle;
    align-items: center;
}

.sort-arrow-up,
.sort-arrow-down {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    transition: border-color 0.2s ease;
}

.sort-arrow-up {
    border-bottom: 6px solid var(--sort-arrow-color);
    margin-bottom: 1px;
}

.sort-arrow-down {
    border-top: 6px solid var(--sort-arrow-color);
}

.sortable-header:hover .sort-arrow {
    opacity: 0.7;
}

.sortable-header.sort-asc .sort-arrow {
    opacity: 1;
}

.sortable-header.sort-asc .sort-arrow-up {
    border-bottom-color: var(--sort-arrow-active-color);
}

.sortable-header.sort-desc .sort-arrow {
    opacity: 1;
}

.sortable-header.sort-desc .sort-arrow-down {
    border-top-color: var(--sort-arrow-active-color);
}

/* Override table header padding for sortable headers */
th.sortable-header {
    padding: 0;
}

/* Ensure proper alignment in table headers */
.sortable-header .header-text {
    display: inline-block;
    vertical-align: middle;
}

/* Status Field Color Styling */
#status {
    transition: all 0.3s ease;
    font-weight: normal;
}

#status.status-colored {
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#status option {
    padding: 8px;
    font-weight: bold;
}

/* Status field focus styling */
#status:focus {
    outline: none;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

/* Status badge styling */
.status-badge-container {
    display: inline-flex;
    align-items: center;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Status badge in tables and lists */
.status-badge-inline {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    display: inline-block;
}

/* Charge selection styling */
.charge-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.charge-row:hover {
    background-color: #f8f9fa;
}

.charge-row.selected-charge {
    background-color: #2e2e2f !important;
    border-left: 4px solid #2196f3;
    box-shadow: 0 1px 3px rgba(33, 150, 243, 0.2);
    font-weight: 500;
}

.charge-row.selected-charge:hover {
    background-color: #bbdefb !important;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

/* Tab Copy Button Styling */
.btn-copy {
    background-color: #17a2b8;
    color: white;
    border: 1px solid #17a2b8;
}

.btn-copy:hover {
    background-color: #138496;
    border-color: #117a8b;
    color: white;
}

.btn-copy:disabled {
    background-color: #6c757d;
    border-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-copy i {
    margin-right: 5px;
}

