/* Layout mit Sidebar */
.layout-container {
    display: flex;
    min-height: 100vh;
    background: #f5f5f5;
}

/* -- Hamburger Button -- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1100;
}

.hamburger-btn span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* -- Schliessen-Button -- */
.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    align-self: flex-end;
    margin-bottom: 12px;
    color: #666;
    line-height: 1;
}

/* -- Overlay -- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 900;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar {
    width: 250px;
    background: white;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    height: 100vh;

    /* Neu für Mobile: */
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar h3 {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.nav-item:hover {
    background: #e9ecef;
    border-color: #4285f4;
    transform: translateX(5px);
}

.nav-item span {
    font-size: 20px;
}

.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* Header */
.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.library-header h1 {
    margin: 0;
    color: #333;
}

.book-count {
    font-size: 18px;
    color: #666;
    font-weight: 500;
    margin-top: 5px;
}

.search-link {
    padding: 12px 24px;
    background: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s;
}

.search-link:hover {
    background: #3367d6;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Buch Karten - MAX HEIGHT 520px */
.library-book-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    max-height: 520px; /* ? MAX HEIGHT GESETZT */
}

.library-book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.book-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Cover - fixe Höhe */
.book-cover-container {
    width: 100%;
    height: 200px; /* Reduziert von 300px auf 200px */
    overflow: hidden;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.book-cover-container img {
    /*width: 100%;*/
    height: auto;
    object-fit: cover;
}

/* Info-Bereich */
.library-book-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.library-book-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
    line-height: 1.3;
    /* Max 2 Zeilen für Titel */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-book-authors {
    color: #666;
    margin-bottom: 8px;
    font-size: 13px;
    /* Max 1 Zeile für Autoren */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Rating */
.book-rating {
    display: flex;
    gap: 3px;
    margin-bottom: 10px;
    font-size: 16px;
}

.star {
    color: #ffd700;
}

.star.empty {
    color: #ddd;
}

/* Meta Info - Zeilenumbruch nach Datum */
.book-meta-info {
    display: flex;
    flex-direction: column; /* ? Spaltenrichtung für Zeilenumbruch */
    gap: 4px;
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.meta-date {
    /* Datum in eigener Zeile */
}

.meta-isbn {
    /* ISBN in eigener Zeile */
}

/* Beschreibung - gekürzt mit max-height */
.library-book-description {
    color: #555;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 10px;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Max 3 Zeilen */
    -webkit-box-orient: vertical;
    min-height: 0;
}

/* Button-Bereich */
.book-actions {
    margin-top: auto;
    /*padding-top: 10px;*/
    border-top: 1px solid #f0f0f0;
}

.btn-edit {
    width: 100%;
    padding: 8px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-edit:hover {
    background: #3367d6;
}

/* Empty State */
.empty-library {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.empty-library h2 {
    color: #666;
    margin-bottom: 20px;
}

.empty-library p {
    color: #888;
    margin-bottom: 30px;
}

/* Messages */
.message {
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: 500;
}

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

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

/* Sortier-Pfeil-Button */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-order-btn {
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-order-btn:hover {
    background: #5a6fd6;
    transform: scale(1.1);
}

