/* ============================================
   PERPUSTAKAAN DESA - MAIN STYLESHEET
   ============================================ */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #16a085;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
    background-color: #f8f9fa;
    line-height: 1.6;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-color);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 15px;
}

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.col {
    flex: 1;
    padding: 15px;
    min-width: 250px;
}

.col-12 {
    flex: 0 0 100%;
}

.col-6 {
    flex: 0 0 50%;
}

.col-4 {
    flex: 0 0 33.333%;
}

.col-3 {
    flex: 0 0 25%;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

header {
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* Header Top Bar */
.header-top {
    background-color: #f8f9fa;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.header-top-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.header-info {
    color: #666;
}

.header-divider {
    color: #ddd;
}

.header-contact-link {
    color: var(--secondary-color);
    font-weight: 500;
    transition: var(--transition);
}

.header-contact-link:hover {
    color: var(--primary-color);
}

/* Header Main */
.header-main {
    background-color: white;
    padding: 1rem 0;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.navbar-brand {
    flex-shrink: 0;
}

.navbar-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
}

.navbar-logo {
    font-size: 2.5rem;
    line-height: 1;
}

.navbar-brand-text {
    display: flex;
    flex-direction: column;
}

.navbar-brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.navbar-brand-subtitle {
    font-size: 0.75rem;
    color: #999;
    line-height: 1;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2.5rem;
    flex: 1;
    justify-content: center;
}

.navbar-menu a {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.navbar-menu a:hover {
    color: var(--secondary-color);
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.user-greeting {
    color: #666;
    font-size: 0.9rem;
}

.navbar-user a {
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none;
}

.navbar-user a:hover {
    background-color: rgba(52, 152, 219, 0.9);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #229954;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

.btn-info {
    background-color: var(--info-color);
    color: white;
}

.btn-info:hover {
    background-color: #138d75;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============================================
   FORMS
   ============================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger-color);
}

.invalid-feedback {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

select.form-control {
    cursor: pointer;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: #f8f9fa;
    padding: 1rem 1.5rem;
    border-top: 1px solid #ddd;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.card-text {
    color: #666;
    margin-bottom: 1rem;
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: var(--success-color);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-color: var(--danger-color);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-color: var(--warning-color);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-color: var(--info-color);
}

.alert-close {
    float: right;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

.table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table-striped tbody tr:nth-child(odd) {
    background-color: #f8f9fa;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin-top: 2rem;
    justify-content: center;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    color: var(--secondary-color);
    transition: var(--transition);
}

.pagination a:hover {
    background-color: var(--secondary-color);
    color: white;
}

.pagination .active span {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: var(--secondary-color);
    color: white;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

.dashboard-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.dashboard-sidebar {
    flex: 0 0 250px;
}

.dashboard-content {
    flex: 1;
}

.stat-card {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 1.5rem;
}

.stat-card h3 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-card .stat-card-value {
    color: #000000 !important;
}

.stat-card p {
    margin: 0;
    opacity: 0.9;
}

/* ============================================
   BOOK GRID
   ============================================ */

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.book-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.book-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.book-cover {
    width: 100%;
    height: 250px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #999;
    overflow: hidden;
}

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

.book-info {
    padding: 1rem;
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-author {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.book-category {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 1rem;
}

.book-actions {
    display: flex;
    gap: 0.5rem;
}

.book-actions .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* ============================================
   PDF VIEWER
   ============================================ */

.pdf-viewer {
    background-color: #f5f5f5;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 1rem;
}

.pdf-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pdf-controls input[type="number"] {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
}

.pdf-canvas {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    display: block;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ecf0f1;
}

.footer-section a:hover {
    color: var(--secondary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .navbar-menu {
        gap: 1rem;
        font-size: 0.9rem;
    }

    .col {
        flex: 0 0 100%;
    }

    .col-6 {
        flex: 0 0 100%;
    }

    .col-4 {
        flex: 0 0 50%;
    }

    .col-3 {
        flex: 0 0 50%;
    }

    .dashboard-container {
        flex-direction: column;
    }

    .dashboard-sidebar {
        flex: 0 0 auto;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .pdf-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .pdf-controls input[type="number"] {
        width: 100%;
    }

    .table {
        font-size: 0.875rem;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }

    /* Responsive grid layout for return form */
    div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .navbar-menu {
        display: none;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card h3 {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table {
        font-size: 0.75rem;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-muted {
    color: #999;
}

.text-success {
    color: var(--success-color);
}

.text-danger {
    color: var(--danger-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-info {
    color: var(--info-color);
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.p-1 {
    padding: 0.5rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}

.rounded {
    border-radius: var(--border-radius);
}

.shadow {
    box-shadow: var(--box-shadow);
}

.bg-light {
    background-color: var(--light-color);
}

.bg-dark {
    background-color: var(--dark-color);
    color: white;
}

.bg-primary {
    background-color: var(--secondary-color);
    color: white;
}

.bg-success {
    background-color: var(--success-color);
    color: white;
}

.bg-danger {
    background-color: var(--danger-color);
    color: white;
}

.bg-warning {
    background-color: var(--warning-color);
    color: white;
}

.bg-info {
    background-color: var(--info-color);
    color: white;
}

.border {
    border: 1px solid #ddd;
}

.border-top {
    border-top: 1px solid #ddd;
}

.border-bottom {
    border-bottom: 1px solid #ddd;
}

.border-left {
    border-left: 1px solid #ddd;
}

.border-right {
    border-right: 1px solid #ddd;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

.cursor-pointer {
    cursor: pointer;
}

.no-wrap {
    white-space: nowrap;
}

.overflow-hidden {
    overflow: hidden;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

