/* ================================
   Biblioteka - Glavni stilovi
   ================================ */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --info: #0891b2;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --muted: #64748b;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------- Navbar ---------- */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.navbar nav { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.brand { font-size: 1.25rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.navbar nav a { color: var(--text); text-decoration: none; font-size: .9rem; padding: .35rem .6rem; border-radius: var(--radius); transition: background .2s; }
.navbar nav a:hover { background: var(--bg); }

/* ---------- Container ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
main.container { padding-top: 2rem; padding-bottom: 3rem; flex: 1; }

/* ---------- Buttons ---------- */
.btn-primary, .btn-outline, .btn-danger, .btn-success, .btn-sm {
    display: inline-block;
    padding: .55rem 1.1rem;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 500;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-full { width: 100%; text-align: center; }

/* ---------- Hero ---------- */
.hero { text-align: center; padding: 3rem 1rem; background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 100%); color: #fff; border-radius: 12px; margin-bottom: 2.5rem; }
.hero h1 { font-size: 2.2rem; margin-bottom: .75rem; }
.hero p { font-size: 1.1rem; margin-bottom: 1.5rem; opacity: .9; }
.hero .btn-primary { background: #fff; color: var(--primary); }

/* ---------- Stats Grid ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; text-align: center; box-shadow: var(--shadow); }
.stat-card.stat-warning { border-color: var(--warning); }
.stat-card.stat-danger { border-color: var(--danger); }
.stat-num { display: block; font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: .85rem; color: var(--muted); }

/* ---------- Books Grid ---------- */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; margin-top: 1rem; }
.book-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.book-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.book-card img { width: 100%; height: 180px; object-fit: cover; }
.book-placeholder { height: 180px; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.book-placeholder-lg { height: 280px; background: linear-gradient(135deg, #e2e8f0, #cbd5e1); display: flex; align-items: center; justify-content: center; font-size: 5rem; border-radius: var(--radius); }
.book-info { padding: 1rem; }
.book-info h3 { font-size: .95rem; margin-bottom: .35rem; }
.book-info h3 a { color: var(--text); text-decoration: none; }
.book-info h3 a:hover { color: var(--primary); }
.author, .year { font-size: .82rem; color: var(--muted); margin-bottom: .25rem; }
.admin-actions { margin-top: .75rem; display: flex; gap: .4rem; flex-wrap: wrap; }

/* ---------- Book Detail ---------- */
.book-detail { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; align-items: start; }
.book-detail img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
.book-meta h1 { font-size: 1.8rem; margin-bottom: 1rem; }
.book-meta p { margin-bottom: .6rem; }
.description { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.book-actions { margin-top: 1.5rem; display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: .25rem .65rem; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }
.badge-info    { background: #e0f2fe; color: #0369a1; }
.badge-warning { background: #fef3c7; color: #b45309; }

/* ---------- Page Header ---------- */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.page-header h2 { font-size: 1.6rem; }

/* ---------- Search Form ---------- */
.search-form { display: flex; gap: .75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.search-form input { flex: 1; min-width: 200px; padding: .55rem .9rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; }

/* ---------- Table ---------- */
.table-wrapper { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { background: var(--bg); padding: .75rem 1rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.status-overdue { background: #fff5f5; }
.text-muted { color: var(--muted); font-size: .85rem; }

/* ---------- Forms ---------- */
.form-wrapper { max-width: 480px; margin: 0 auto; background: var(--surface); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-wrapper.form-wide { max-width: 720px; }
.form-wrapper h2 { margin-bottom: 1.5rem; font-size: 1.5rem; }
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .88rem; font-weight: 500; margin-bottom: .4rem; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: .55rem .85rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: .95rem; font-family: inherit;
    transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; }
.form-link { text-align: center; margin-top: 1.25rem; font-size: .9rem; color: var(--muted); }
.form-link a { color: var(--primary); }

/* ---------- Alerts ---------- */
.alert { padding: .85rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; font-size: .9rem; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert ul { margin: 0; padding-left: 1.2rem; }

/* ---------- Quick Actions ---------- */
.quick-actions { margin: 1.5rem 0; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.quick-actions h3 { margin-right: .5rem; font-size: 1rem; }

/* ---------- Author ---------- */
.author-detail { max-width: 700px; }
.author-detail h1 { font-size: 2rem; margin-bottom: 1rem; }
.bio { white-space: pre-line; margin-bottom: 1.5rem; color: var(--muted); }

/* ---------- Error Page ---------- */
.error-page { text-align: center; padding: 5rem 1rem; }
.error-page h1 { font-size: 5rem; color: var(--muted); }
.error-page p { font-size: 1.2rem; margin-bottom: 1.5rem; }

/* ---------- Empty State ---------- */
.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; font-size: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 1.5rem; text-align: center; font-size: .85rem; color: var(--muted); margin-top: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .book-detail { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.6rem; }
    .books-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .navbar .container { flex-wrap: wrap; height: auto; padding: .75rem 0; gap: .5rem; }
}
