/* =========================================
   ZÁKLADNÍ NASTAVENÍ
   ========================================= */
* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    color: #333;
}

h1, h2, h3 { color: #222; margin-top: 1.5em; margin-bottom: 0.5em; }
a { text-decoration: none; color: #007bff; }
a:hover { text-decoration: underline; color: #0056b3; }

/* Navigace */
nav { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #ccc; }
nav a { margin-right: 15px; font-weight: 500; }

/* Ovládání zobrazení */
.view-controls { margin-bottom: 20px; text-align: right; }
.view-controls button {
    padding: 6px 12px; cursor: pointer; background: #f8f9fa;
    border: 1px solid #ced4da; border-radius: 4px; color: #495057;
}
.view-controls button.active { background: #007bff; color: white; border-color: #007bff; }

/* =========================================
   KOMPONENTY (BADGES & SERIES)
   ========================================= */
.series-group { margin-bottom: 30px; }
.series-title {
    font-size: 1.25em; border-bottom: 2px solid #eee;
    margin-bottom: 15px; padding-bottom: 5px; color: #444;
}
.series-author-header { font-size: 0.75em; color: #777; margin-left: 10px; font-weight: normal; }

/* Badges */
.badge-slot { display: flex; justify-content: center; width: 100%; }
/* Úprava badge, aby nebyla přes celou šířku */
.badge {
    display: inline-block; /* Důležité: už nebude roztahovat div */
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    text-align: center;
    color: white;
}
/* Barvy */
.badge.owned { background-color: #28a745; }
.badge.not-owned { background-color: #dc3545; opacity: 0.7; }
.badge.status-read { background-color: #17a2b8; }
.badge.status-reading { background-color: #ffc107; color: #333; }
.badge.status-unread { background-color: #6c757d; }

/* Barvy */
.owned { background-color: #28a745; }      /* Zelená */
.not-owned { background-color: #dc3545; }  /* Červená */
.status-read { background-color: #17a2b8; } /* Tyrkysová */

/* =========================================
   BOOK ITEM (Společné)
   ========================================= */
.book-title { font-weight: 600; color: #222; }
.book-meta { font-size: 0.9em; color: #666; margin-left: 5px; }
.meta-series { font-weight: bold; color: #555; }

/* =========================================
   REŽIM SEZNAM (LIST VIEW)
   ========================================= */
.view-list .items-wrapper { display: flex; flex-direction: column; }

.view-list .book-item {
    display: flex;
    justify-content: space-between; /* Roztáhne Title vlevo a Badges vpravo */
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.view-list .book-item:hover { background-color: #fafafa; }

.view-list .book-info-main {
    margin-right: 15px;
    flex: 1; /* Aby zabralo místo a odtlačilo badges */
}

/* Pevná mřížka pro badges v seznamu */
.view-list .book-info-secondary {
    display: grid;
    grid-template-columns: 100px 100px;
    gap: 10px;
    flex-shrink: 0;
}

/* =========================================
   REŽIM MŘÍŽKA (GRID VIEW - Textové karty)
   ========================================= */
.view-grid .items-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    padding-top: 10px;
}

.view-grid .book-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    height: 100%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.view-grid .book-title { font-size: 1.1em; margin-bottom: 5px; display: block; }
.view-grid .book-meta { margin-left: 0; display: block; margin-bottom: 15px; }

/* Badges v mřížce - pod sebou */
.view-grid .book-info-secondary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
}

/* =========================================
   RESPONZIVITA
   ========================================= */
@media (max-width: 600px) {
    .view-list .book-item { flex-direction: column; align-items: flex-start; }
    .view-list .book-info-secondary {
        margin-top: 8px; width: 100%;
        grid-template-columns: 1fr 1fr; /* Na mobilu se roztáhnou 50/50 */
    }
}

/* Styl pro detail knihy */
.book-detail-cover {
    float: left; /* Nebo display: block; margin: 0 auto; pro centrování */
    margin-right: 20px;
    margin-bottom: 20px;
    width: 200px; /* Šířka obálky v detailu */
}

.book-detail-cover img {
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}


/* =========================================
   DETAIL KNIHY (SINGLE PAGE)
   ========================================= */

.book-header {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.book-header h1 {
    margin-bottom: 5px;
    margin-top: 0;
    color: #222;
}

.book-subtitle {
    color: #555;
    font-size: 1.1em;
}

.book-subtitle .separator {
    margin: 0 10px;
    color: #ccc;
}

/* Layout: Obálka vlevo, Info vpravo */
.book-content-wrapper {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Levý sloupec (Visual) */
.book-visual {
    flex: 0 0 220px; /* Fixní šířka sloupce s obálkou */
    text-align: center;
}

.book-detail-cover {
    width: 100%;
    margin-bottom: 15px;
}

.book-detail-cover img {
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    width: 100%;
    display: block;
}

/* Pravý sloupec (Info Panel) */
.book-info-panel {
    flex: 1;
}

/* Hodnocení */
.rating-box {
    display: inline-block;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 8px 15px;
    border-radius: 20px;
    margin-bottom: 20px;
    font-weight: bold;
}

.rating-value {
    color: #d63384; /* Výrazná barva pro procenta */
    margin-left: 5px;
    font-size: 1.1em;
}

/* Grid technických dat (Stran, ISBN...) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px 30px;
    margin-bottom: 25px;
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
}

.info-item {
    font-size: 0.95em;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.info-item .label {
    color: #666;
    margin-right: 10px;
}

.info-item .value {
    font-weight: 500;
    color: #333;
    text-align: right;
}

/* Anotace */
.book-description {
    line-height: 1.7;
    color: #444;
    margin-bottom: 25px;
}

.book-description h3 {
    font-size: 1.2em;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

/* Tagy (Pills) */
.book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    background: #eef2f7;
    color: #4a6fa5;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85em;
    transition: background 0.2s;
}

.tag-pill:hover {
    background: #dbe4f0;
    text-decoration: none;
}

/* Responzivita pro detail */
@media (max-width: 700px) {
    .book-content-wrapper {
        flex-direction: column; /* Na mobilu pod sebe */
    }

    .book-visual {
        flex: 0 0 auto;
        width: 160px; /* Menší obálka na mobilu */
        margin: 0 auto 20px auto; /* Vycentrovat */
    }

    .info-grid {
        grid-template-columns: 1fr; /* Jeden sloupec dat */
    }
}
/* Statusy pod obrázkem */
.personal-status-stack {
    display: flex;
    flex-direction: column; /* Pod sebe */
    gap: 8px;
    margin-top: 10px;
}

