/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.4;
    color: #333;
    background-color: #fff;
}

.container {
    max-width: 95%;
    margin: 0 auto;
    padding: 15px;
    padding-bottom: 350px; /* Platz für Cover-Tooltip bei letzter Zeile */
}

/* Header */
header {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #495057;
}

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    background: #fff;
    color: #333;
    text-align: center;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
}

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

.btn-success {
    background-color: #28a745;
    color: white;
    border: 1px solid #28a745;
}

.btn-success:hover {
    background-color: #1e7e34;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

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

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

/* Formulare */
.form-section {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

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

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

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-field input,
.form-field textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
    font-family: inherit;
}

.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: #007bff;
}

.form-field input.readonly {
    background-color: #f8f9fa;
    color: #6c757d;
}

.form-field small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

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

/* Nachrichten */
.message {
    padding: 10px 15px;
    margin-bottom: 15px;
    border: 1px solid;
}

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

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

/* DataTables Anpassungen */
.dataTables_wrapper {
    margin-top: 20px;
}

.dataTables_wrapper_custom {
    margin-bottom: 15px;
}

.dataTables_filter {
    float: none !important;
    text-align: left !important;
    margin-bottom: 10px;
    width: 100%;
}

.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.dataTables_filter input {
    padding: 8px;
    border: 1px solid #ccc;
    margin-left: 0 !important;
    flex: 1;
    width: 100%;
    font-size: 14px;
}

/* Tabelle */
table.dataTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.dataTable th,
table.dataTable td {
    padding: 2px 6px;
    text-align: left;
    border: 1px solid #dee2e6;
    line-height: 1.1;
}

table.dataTable th {
    background-color: #f8f9fa;
    font-weight: bold;
    font-size: 12px;
}

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

table.dataTable tbody td:first-child {
    font-weight: bold;
}

table.dataTable td {
    word-wrap: break-word;
    white-space: normal;
}

table.dataTable {
    table-layout: fixed;
}

table.dataTable th,
table.dataTable td {
    width: 9%; /* Standardbreite für alle Spalten */
}

/* Nr.-Spalte (1)  */
table.dataTable th:nth-child(1),
table.dataTable td:nth-child(1) {
    width: 3%;
}

/* Cat-No Spalte (2)  */
table.dataTable th:nth-child(2),
table.dataTable td:nth-child(2) {
    width: 8%;
}

/* Titel-Spalte (3)  */
table.dataTable th:nth-child(3),
table.dataTable td:nth-child(3) {
    width: 15%;
}

/* Format-Spalte (4)  */
table.dataTable th:nth-child(4),
table.dataTable td:nth-child(4) {
    width: 5%;
}

/* Label-Spalte (5)  */
table.dataTable th:nth-child(5),
table.dataTable td:nth-child(5) {
    width: 10%;
}

/* Genre-Spalte (6)  */
table.dataTable th:nth-child(6),
table.dataTable td:nth-child(6) {
    width: 9%;
}

/* Jahr-Spalte (7)  */
table.dataTable th:nth-child(7),
table.dataTable td:nth-child(7) {
    width: 4%;
}

/* Land-Spalte (8)  */
table.dataTable th:nth-child(8),
table.dataTable td:nth-child(8) {
    width: 7%;
}

/* Media Condition-Spalte (9)  */
table.dataTable th:nth-child(9),
table.dataTable td:nth-child(9) {
    width: 4%;
    text-align: center;
}

/* Sleeve Condition-Spalte (10)  */
table.dataTable th:nth-child(10),
table.dataTable td:nth-child(10) {
    width: 4%;
    text-align: center;
}

/* Preis-Spalte (11)  */
table.dataTable th:nth-child(11),
table.dataTable td:nth-child(11) {
    width: 5%;
}

/* Notiz-Spalte (12)  */
table.dataTable th:nth-child(12),
table.dataTable td:nth-child(12) {
    width: 17%;
}

/* Ebay-Spalte (13) - nur in Admin-Ansicht */
table.dataTable th:nth-child(13),
table.dataTable td:nth-child(13) {
    width: 3%;
    text-align: center;
}

/* Aktionen-Spalte (14) - nur in Admin-Ansicht */
table.dataTable th:nth-child(14),
table.dataTable td:nth-child(14) {
    width: 8%;
}

.cover-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.no-image {
    width: 50px;
    height: 50px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #6c757d;
}

/* Verkaufte Artikel - hellgrüner Hintergrund */
.sold-row {
    background-color: #d4edda !important;
}

.sold-row:nth-child(even) {
    background-color: #c3e6cb !important;
}

/* Image Tooltip */
.image-tooltip {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 2px solid #333;
    padding: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    pointer-events: none;
}

.image-tooltip img {
    max-width: 300px;
    max-height: 300px;
    display: block;
}

/* Textbausteine */
.textbaustein-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.textbaustein-btn {
    font-size: 11px;
    padding: 4px 8px;
}

/* Condition Buttons */
.condition-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.condition-option {
    padding: 10px 15px;
    border: 2px solid #ccc;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    text-align: center;
    flex: 1 1 auto;
    min-width: 150px;
}

.condition-option:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.condition-option.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
    font-weight: bold;
}

.condition-option input[type="radio"] {
    display: none;
}

/* Grading Guide */
.grading-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
    margin-top: 15px;
    padding: 30px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
}

.grading-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 25px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.grading-item img {
    width: 100%;
    max-width: 900px;
    height: auto;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.grading-text {
    width: 100%;
}

.grading-text strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 16px;
}

.grading-text p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .textbaustein-buttons {
        flex-direction: column;
    }
    
    .textbaustein-btn {
        width: 100%;
        margin-bottom: 3px;
    }
    
    .image-tooltip {
        max-width: 200px;
    }
    
    .image-tooltip img {
        max-width: 200px;
        max-height: 200px;
    }
}