/* --- OSNOVNI STILOVI --- */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f3f4f6;
}

/* --- GRID SISTEM (FORSIRAN) --- */
/* Koristimo specifičan ID i !important da pregazimo Bootstrap */
#books-grid {
    display: grid !important;
    grid-template-columns: repeat(1, 1fr) !important;
    /* Mobile: 1 kolona */
    gap: 2rem !important;
    width: 100% !important;
    margin-top: 2rem;
}

/* Tablet: 2 kolone */
@media (min-width: 640px) {
    #books-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop: 3 kolone (OVO JE ONO ŠTO ŽELITE) */
@media (min-width: 1024px) {
    #books-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Veliki ekrani: 4 kolone */
@media (min-width: 1280px) {
    #books-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* --- KONTEJNER KARTICE --- */
/* Ovo osigurava da se kartica ne širi preko svoje grid ćelije */
.book-card-container {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* --- KARTICA KNJIGE --- */
.book-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Ista visina za sve u redu */
    border: 1px solid #e5e7eb;
    position: relative;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-color: #93c5fd;
}

/* --- SLIKA --- */
.book-cover-wrapper {
    width: 100%;
    height: 280px;
    /* Fiksna visina prostora za sliku */
    padding: 1.5rem;
    background-color: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

.book-cover {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    /* Slika staje u okvir bez isecanja */
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

/* --- SADRŽAJ --- */
.book-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    /* Popunjava preostali prostor */
}

.book-year-badge {
    display: inline-block;
    background-color: #eff6ff;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
}

.book-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    /* Limit na 2 reda */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 1rem;
    font-style: italic;
    /* Limit na 2 reda */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-summary {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.5;
    flex-grow: 1;
    /* Gura footer na dno */
    /* Limit na 3 reda */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: flex-end;
}

.book-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #2563eb;
    font-weight: 600;
    font-size: 0.875rem;
}

.hidden {
    display: none !important;
}