/* Pravin Dalal Institute of Ophthalmology - Library Management System Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #f4f6f9;
    color: #333;
}

.app-bg {
    background-color: #f4f6f9;
    min-height: 100vh;
}

/* ---------- Navigation Bar ---------- */
.navbar {
    background: #1e3a5f;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 999;
}

.nav-brand a {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}

.nav-hamburger {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-links a {
    color: #cfd8dc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-user {
    color: #fff;
    font-size: 13px;
    padding: 5px 12px;
    background: rgba(255,255,255,0.12);
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}

.nav-more {
    position: relative;
    display: inline-block;
}

.nav-more-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.nav-more-btn:hover {
    background: rgba(255,255,255,0.15);
}

.nav-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0,0,0,0.22);
    min-width: 220px;
    overflow: hidden;
    z-index: 1000;
    flex-direction: column;
}

.nav-dropdown.show {
    display: flex;
}

.nav-dropdown a {
    padding: 12px 18px;
    color: #222 !important;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.nav-dropdown a:hover {
    background: #f4f6f9;
}

.nav-dropdown a.logout-link {
    color: #d9534f !important;
    font-weight: bold;
    border-top: 1px solid #eee;
}

@media (max-width: 860px) {
    .nav-hamburger {
        display: block;
    }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: #1e3a5f;
        padding: 16px 24px;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }
    .nav-links.mobile-open {
        display: flex;
    }
}

/* ---------- Auth Pages (Login) ---------- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f, #2c5985);
    padding: 20px;
}

.auth-bg {
    background-image: linear-gradient(rgba(10, 20, 35, 0.88), rgba(10, 20, 35, 0.92)),
                       url('../assets/img/building.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-box {
    background: #fff;
    padding: 36px 40px;
    border-radius: 10px;
    width: 400px;
    max-width: 95vw;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}

.auth-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.auth-logo img {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid #eef2f6;
    padding: 2px;
}

.auth-box h2 {
    text-align: center;
    color: #1e3a5f;
    margin-bottom: 6px;
    font-size: 20px;
    font-weight: 700;
}

.auth-box p.subtitle {
    text-align: center;
    color: #777;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.auth-note {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: #888;
}

/* ---------- Forms & Inputs ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #444;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #1e3a5f;
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.btn {
    width: 100%;
    background: #1e3a5f;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #2c5985;
}

.btn-small {
    width: auto;
    padding: 7px 14px;
    font-size: 13px;
}

.btn-danger {
    background: #d9534f;
}

.btn-danger:hover {
    background: #c9302c;
}

.btn-success {
    background: #28a745;
}

.btn-success:hover {
    background: #218838;
}

/* ---------- Layout Container ---------- */
.container {
    max-width: 1150px;
    margin: 30px auto;
    padding: 0 20px;
}

.page-title {
    font-size: 24px;
    color: #1e3a5f;
    margin-bottom: 20px;
    font-weight: 700;
}

/* ---------- Dashboard Cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    padding: 20px 22px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 5px solid #1e3a5f;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.14);
}

.stat-card h3 {
    font-size: 28px;
    color: #1e3a5f;
    font-weight: 700;
}

.stat-card p {
    color: #666;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 500;
}

/* Quick Actions box - blue themed */
.quick-actions-box {
    background: #eaf2fb;
    border: 2px solid #1e3a5f;
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 2px 10px rgba(30, 58, 95, 0.12);
}

.quick-actions-box h3 {
    color: #1e3a5f;
    font-size: 17px;
    font-weight: 700;
}

.quick-actions-box p {
    margin-bottom: 8px;
    font-size: 14px;
}

.quick-actions-box p:last-child {
    margin-bottom: 0;
}

.quick-actions-box p a {
    color: #1e3a5f;
    font-weight: 600;
    text-decoration: none;
}

.quick-actions-box p a:hover {
    text-decoration: underline;
}

/* ---------- Tables ---------- */
.table-wrap {
    background: #fff;
    border-radius: 10px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

th {
    background: #1e3a5f;
    color: #fff;
    font-weight: 600;
}

tr:hover {
    background: #f9fafc;
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
}

.badge-issued { background: #fff3cd; color: #856404; }
.badge-returned { background: #d4edda; color: #155724; }
.badge-overdue { background: #f8d7da; color: #721c24; }
.badge-fine { background: #f8d7da; color: #a71d2a; font-weight: bold; }
.badge-nofine { background: #e2e3e5; color: #555; }
.badge-role-admin { background: #fee2e2; color: #991b1b; }
.badge-role-staff { background: #d1ecf1; color: #0c5460; }
.badge-role-teacher { background: #e2d9f3; color: #4a2c8a; }
.badge-role-student { background: #d4edda; color: #155724; }
.badge-active { background: #d4edda; color: #155724; }
.badge-suspended { background: #f8d7da; color: #721c24; font-weight: bold; }

/* ---------- Book / Ebook Cards ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.book-card {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.book-cover {
    width: 100%;
    height: 160px;
    background: #1e3a5f;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 44px;
    margin-bottom: 12px;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card h4 {
    color: #1e3a5f;
    font-size: 16px;
    margin-bottom: 5px;
    font-weight: 700;
}

.book-card p {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.book-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    padding-top: 12px;
}

.book-actions a, .book-actions button {
    flex: 1;
    text-align: center;
    padding: 8px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.btn-view { background: #1e3a5f; color: #fff; }
.btn-view:hover { background: #2c5985; }
.btn-edit { background: #6c757d; color: #fff; }
.btn-edit:hover { background: #5a6268; }
.btn-issue { background: #ffb703; color: #222; }
.btn-issue:hover { background: #e0a302; }

/* Search bar */
.search-bar {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
}

.search-bar button {
    padding: 12px 22px;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

.search-bar button:hover {
    background: #2c5985;
}

/* PDF viewer wrap */
.pdf-viewer-wrap {
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pdf-viewer-wrap iframe {
    width: 100%;
    height: 80vh;
    border: none;
    border-radius: 6px;
}

/* Modal */
.modal-veil {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    padding: 20px;
}
.modal-box {
    background: #fff;
    border-radius: 10px;
    width: 500px;
    max-width: 95vw;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}
.modal-header {
    background: #1e3a5f;
    color: #fff;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}
.modal-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}
.modal-body {
    padding: 20px;
}

/* Alerts */
.alert {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error {
    background: #fdecea;
    color: #c9302c;
    border: 1px solid #f5c6cb;
}
.alert-success {
    background: #e6f4ea;
    color: #1e7e34;
    border: 1px solid #c3e6cb;
}
