/* ============================================
   Perpustakaan Digital sampi.xyz
   Main Stylesheet
   ============================================ */

:root {
    --primary: #2c6e49;
    --primary-dark: #1f5236;
    --primary-light: #4a8f66;
    --accent: #d4a373;
    --dark: #1a1a2e;
    --gray: #6c757d;
    --light-gray: #f8f9fa;
    --border: #e0e0e0;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 5px 20px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light-gray);
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===== NAVBAR ===== */
.navbar {
    background: var(--primary);
    color: white;
    padding: 15px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
}

.logo i {
    font-size: 1.6rem;
    color: var(--accent);
}

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

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links a i {
    margin-right: 5px;
}

.nav-links .btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.nav-links .btn:hover {
    transform: translateY(-1px);
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dropdown-btn i:last-child {
    font-size: 0.7rem;
    margin-left: 3px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 110%;
    background: white;
    min-width: 180px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 100;
}

.dropdown-menu.show {
    display: block;
    animation: fadeDown 0.2s ease;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: #333;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: var(--light-gray);
    color: var(--primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

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

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

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

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

.btn-light:hover {
    background: #f0f0f0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.btn-block {
    width: 100%;
}

.navbar .btn-outline {
    border-color: white;
    color: white;
}

.navbar .btn-outline:hover {
    background: white;
    color: var(--primary);

}

.navbar .btn-primary {
    background: var(--accent);
}

.navbar .btn-primary:hover {
    background: #c9966a;
}

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: white;
    padding: 80px 0;
    margin-bottom: 40px;
}

.hero-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.hero h1 span {
    color: var(--accent);
}

.hero p {
    font-size: 1.15rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== FEATURES ===== */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.feature-card {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.feature-card h3 {
    color: var(--dark);
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ===== SECTIONS ===== */
.section {
    margin-bottom: 50px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    font-size: 1.6rem;
    color: var(--dark);
}

.section-header h2 i {
    color: var(--primary);
}

/* ===== BOOK GRID ===== */
.books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.book-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.book-card a {
    text-decoration: none;
    color: inherit;
}

.book-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.book-cover i {
    font-size: 4rem;
    color: rgba(255,255,255,0.8);
    transition: transform 0.3s;
}

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

.book-card:hover .book-cover i {
    transform: scale(1.1);
}

.book-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-info {
    padding: 15px;
}

.book-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.book-author i {
    color: var(--accent);
    margin-right: 5px;
}

.book-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.book-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
}

.rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #ffc107;
    font-weight: 600;
}

.availability {
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.availability.available {
    color: var(--success);
    background: rgba(40,167,69,0.1);
}

.availability.unavailable {
    color: var(--danger);
    background: rgba(220,53,69,0.1);
}

/* ===== CATEGORIES ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--dark);
    transition: transform 0.3s, box-shadow 0.3s;
    border-bottom: 3px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-bottom-color: var(--primary);
}

.category-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.category-card h4 {
    margin-bottom: 5px;
}

.category-card p {
    font-size: 0.8rem;
    color: var(--gray);
}

/* ===== CTA ===== */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 60px 0;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 50px;
}

.cta-section h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.cta-section p {
    opacity: 0.9;
    margin-bottom: 25px;
}

/* ===== FOOTER ===== */
.main-content {
    flex: 1;
}

.footer {
    background: var(--dark);
    color: white;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3,
.footer-section h4 {
    color: var(--accent);
    margin-bottom: 15px;
}

.footer-section p {
    opacity: 0.8;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.footer-section a {
    display: block;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

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

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

/* ===== PAGE HEADER ===== */
.page-container {
    padding-top: 30px;
}

.page-header {
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-header h1 i {
    color: var(--primary);
}

.page-header p {
    color: var(--gray);
    margin-top: 5px;
}

/* ===== SEARCH & FILTER ===== */
.search-filter {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.search-input i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
}

.search-input input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.search-input input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-form select {
    padding: 11px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.search-form select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--dark);
    font-weight: 600;
    transition: all 0.2s;
}

.page-btn:hover:not(.disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== AUTH ===== */
.auth-container {
    display: flex;
    justify-content: center;
    padding: 50px 20px;
}

.auth-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.auth-icon i {
    font-size: 2.5rem;
    color: white;
}

.auth-card h1 {
    color: var(--dark);
    margin-bottom: 10px;
}

.auth-card > p {
    color: var(--gray);
    margin-bottom: 25px;
}

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

.auth-alt {
    margin-top: 20px;
    color: var(--gray);
    font-size: 0.9rem;
}

.auth-alt a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-alt a:hover {
    text-decoration: underline;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 0.9rem;
}

.form-group label i {
    color: var(--primary);
    margin-right: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-row.three {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ===== ALERTS ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(220,53,69,0.1);
    color: var(--danger);
    border: 1px solid rgba(220,53,69,0.3);
}

.alert-success {
    background: rgba(40,167,69,0.1);
    color: var(--success);
    border: 1px solid rgba(40,167,69,0.3);
}

/* ===== BOOK DETAIL ===== */
.book-detail {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 40px;
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.book-detail-cover {
    display: flex;
    align-items: center;
    justify-content: center;
}

.large-cover {
    height: 350px;
    width: 100%;
    border-radius: var(--radius);
}

.large-cover i {
    font-size: 6rem;
}

.large-cover img {
    height: 350px;
    object-fit: cover;
    border-radius: var(--radius);
}

.book-detail-info h1 {
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 2rem;
}

.book-detail-info .book-author {
    font-size: 1.05rem;
    margin-bottom: 15px;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.stars {
    display: inline-flex;
    gap: 2px;
}

.stars i {
    color: #ddd;
    font-size: 1.1rem;
}

.stars i.rated {
    color: #ffc107;
}

.stars.small i {
    font-size: 0.85rem;
}

.book-detail-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.meta-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
}

.meta-item i {
    font-size: 1.3rem;
    color: var(--primary);
    margin-top: 3px;
}

.meta-item label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-item span {
    font-weight: 600;
    font-size: 0.9rem;
}

.book-description {
    margin-bottom: 25px;
}

.book-description h3 {
    color: var(--dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.book-description h3 i {
    color: var(--primary);
}

.book-description p {
    color: #555;
    line-height: 1.8;
}

.book-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* ===== REVIEWS ===== */
.reviews-section {
    background: white;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.review-form-card {
    background: var(--light-gray);
    padding: 25px;
    border-radius: var(--radius-sm);
    margin-bottom: 25px;
}

.review-form-card h3 {
    margin-bottom: 20px;
    color: var(--dark);
}

.rating-input {
    margin-bottom: 15px;
}

.rating-input label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}

.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 0;
}

.star-rating input {
    display: none;
}

.star-rating .star {
    cursor: pointer;
    font-size: 1.6rem;
    color: #ddd;
    transition: color 0.2s;
    padding: 0 2px;
}

.star-rating .star:hover,
.star-rating .star:hover ~ .star,
.star-rating input:checked ~ .star {
    color: #ffc107;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.review-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.review-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.review-user {
    flex: 1;
}

.review-user strong {
    display: block;
    margin-bottom: 3px;
}

.review-date {
    font-size: 0.8rem;
    color: var(--gray);
}

.review-comment {
    color: #555;
    line-height: 1.7;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.empty-state i {
    font-size: 3.5rem;
    color: var(--primary);
    opacity: 0.5;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: var(--dark);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 20px;
}

.empty-state.small {
    padding: 30px 20px;
}

.empty-state.small i {
    font-size: 2rem;
}

/* ===== DASHBOARD ===== */
.dashboard-header {
    background: white;
    padding: 25px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.welcome-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-avatar.lg {
    font-size: 4rem;
    color: var(--primary);
}

.user-avatar.sm {
    font-size: 1.5rem;
    color: var(--primary);
}

.welcome-section h1 {
    color: var(--dark);
    font-size: 1.5rem;
}

.welcome-section p {
    color: var(--gray);
    font-size: 0.9rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.blue { background: #3498db; }
.stat-icon.green { background: var(--success); }
.stat-icon.red { background: var(--danger); }
.stat-icon.orange { background: #f39c12; }
.stat-icon.purple { background: #9b59b6; }

.stat-card h3 {
    font-size: 1.5rem;
    color: var(--dark);
}

.stat-card p {
    color: var(--gray);
    font-size: 0.85rem;
}

/* ===== TABLE ===== */
.table-responsive {
    overflow-x: auto;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table thead th {
    background: var(--primary);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.table tbody td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--light-gray);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-book {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.mini-cover {
    width: 40px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mini-cover i {
    color: white;
    font-size: 1.2rem;
}

.table-book small {
    display: block;
    color: var(--gray);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-borrowed {
    background: rgba(52,152,219,0.15);
    color: #3498db;
}

.badge-returned {
    background: rgba(40,167,69,0.15);
    color: var(--success);
}

.badge-overdue {
    background: rgba(220,53,69,0.15);
    color: var(--danger);
}

.badge-category {
    background: rgba(44,110,73,0.1);
    color: var(--primary);
}

.badge-admin {
    background: rgba(155,89,182,0.15);
    color: #9b59b6;
}

.badge-member {
    background: rgba(52,152,219,0.15);
    color: #3498db;
}

/* ===== ADMIN LAYOUT ===== */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 25px;
}

.admin-sidebar {
    background: var(--dark);
    color: white;
    border-radius: var(--radius);
    padding: 25px 0;
    align-self: start;
    position: sticky;
    top: 80px;
}

.admin-sidebar h3 {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 15px;
    color: var(--accent);
}

.admin-sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.admin-sidebar nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.admin-sidebar nav a.active {
    background: rgba(255,255,255,0.1);
    color: var(--accent);
    border-left-color: var(--accent);
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 15px;
}

.sidebar-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.sidebar-footer a:hover {
    color: var(--danger);
}

.admin-content {
    min-width: 0;
}

.admin-content .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.admin-stat {
    padding: 15px;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.quick-action-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.quick-action-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.quick-action-card h4 {
    color: var(--dark);
    margin-bottom: 5px;
}

.quick-action-card p {
    color: var(--gray);
    font-size: 0.8rem;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

.modal.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 0;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    color: var(--dark);
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-form {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* ===== CATEGORIES ADMIN ===== */
.categories-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.category-admin-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.category-admin-icon {
    width: 50px;
    height: 50px;
    background: var(--light-gray);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-admin-icon i {
    font-size: 1.4rem;
    color: var(--primary);
}

.category-admin-info {
    flex: 1;
}

.category-admin-info h3 {
    font-size: 1rem;
    color: var(--dark);
    margin-bottom: 3px;
}

.category-admin-info p {
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 5px;
}

/* ===== FILTER TABS ===== */
.filter-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 18px;
    border-radius: 20px;
    background: white;
    border: 2px solid var(--border);
    color: var(--gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.filter-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-outline.btn-sm {
    padding: 6px 10px;
}

/* ===== ERROR PAGE ===== */
.error-page {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 0 auto;
}

.error-icon {
    font-size: 4rem;
    color: var(--warning);
    margin-bottom: 20px;
}

.error-page h1 {
    color: var(--dark);
    margin-bottom: 10px;
}

.error-page p {
    color: var(--gray);
    margin-bottom: 30px;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .books-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .features {
        grid-template-columns: 1fr;
    }
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .book-detail {
        grid-template-columns: 1fr;
        padding: 25px;
    }
    .large-cover {
        height: 250px;
    }
    .admin-layout {
        grid-template-columns: 1fr;
    }
    .admin-sidebar {
        position: static;
    }
    .admin-sidebar nav {
        display: flex;
        flex-wrap: wrap;
    }
    .admin-sidebar nav a {
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .admin-sidebar nav a.active {
        border-left: none;
        border-bottom-color: var(--accent);
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        box-shadow: var(--shadow-lg);
    }
    .nav-links.show {
        display: flex;
    }
    .mobile-menu-btn {
        display: block;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .quick-actions {
        grid-template-columns: 1fr;
    }
    .categories-admin-grid {
        grid-template-columns: 1fr;
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-row.three {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
    .categories-grid {
        grid-template-columns: 1fr;
    }
    .search-form {
        flex-direction: column;
    }
    .search-input {
        width: 100%;
    }
    .search-form select,
    .search-form .btn {
        width: 100%;
    }
    .book-detail-meta {
        grid-template-columns: 1fr;
    }
    .admin-stats {
        grid-template-columns: 1fr;
    }
}

/* ===== Reader Page ===== */
.reader-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 72px);
    margin: -24px auto 0;
    max-width: 100%;
}

.reader-toolbar {
    background: var(--dark);
    color: #fff;
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.reader-toolbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.reader-back {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.reader-back:hover {
    color: var(--primary-light);
}

.reader-title {
    flex: 1;
    min-width: 0;
}

.reader-title strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-title small {
    color: rgba(255,255,255,0.7);
}

.reader-actions {
    white-space: nowrap;
}

.reader-frame {
    flex: 1;
    background: #525659;
    min-height: 0;
}

.reader-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}