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

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #ecf0f1;
    --dark-text: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

section {
    padding: 30px;
}

h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8em;
}

/* Import Section */
.import-section {
    background: var(--light-bg);
    border-bottom: 2px solid var(--border-color);
}

.file-upload {
    display: flex;
    gap: 15px;
    align-items: center;
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: white;
    border: 2px dashed var(--secondary-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.file-label:hover {
    background: var(--secondary-color);
    color: white;
    border-style: solid;
}

.file-label .icon {
    font-size: 1.5em;
}

#excelFile {
    display: none;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

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

.btn-success:hover {
    background: #229954;
}

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

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-edit {
    background: var(--warning-color);
    color: white;
    padding: 8px 16px;
    font-size: 0.9em;
}

.btn-edit:hover {
    background: #d68910;
}

.btn-pdf {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    font-size: 1.1em;
}

.btn-pdf:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

/* Data Overview */
.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.stat-badge {
    background: var(--secondary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

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

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

.controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
}

.search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background: var(--primary-color);
    color: white;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: var(--light-bg);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--primary-color);
    color: white;
}

.modal-header h2 {
    color: white;
    margin: 0;
}

.close {
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.close:hover {
    transform: scale(1.2);
}

/* Form */
#editForm {
    padding: 30px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 8px;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 600;
    margin: 0;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding-top: 20px;
    border-top: 2px solid var(--light-bg);
}

/* Export Section */
.export-section {
    background: var(--light-bg);
}

.export-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }

    header h1 {
        font-size: 1.8em;
    }

    .file-upload {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .export-buttons {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.9em;
    }

    th, td {
        padding: 8px;
    }
}

/* Größeres Modal für PDF-Vorschau */
.modal-large .modal-content {
    width: 95%;
    max-width: 1200px;
}

#previewContent {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Upload Status */
#uploadStatus {
    margin-left: 15px;
    font-weight: bold;
}

/* File Input Wrapper */
.file-input-wrapper {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 10px;
}

.file-input-wrapper label {
    cursor: pointer;
}

#fileName {
    font-size: 0.9em;
    font-style: italic;
    color: #666;
}

/* Export Buttons verbessert */
.export-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 800px;
}

.btn-info {
    background: #3498db;
    color: white;
    border: none;
}

.btn-info:hover {
    background: #2980b9;
}
