/* ========== GOOGLE FONTS (boleh, ini hanya font, bukan framework) ========== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ========== VARIABLES CSS ========== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #64748b;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 35px rgba(0,0,0,0.15);
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: 1px solid rgba(255, 255, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========== CONTAINER ========== */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeInUp 0.6s ease-out;
}

/* ========== GLASS CARD EFFECT ========== */
.glass-card, .book-card, .anggota-card, .container > h1, table, form {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    border: var(--glass-border);
    transition: all 0.3s ease;
}

/* ========== HEADER / TITLE ========== */
h1 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
    padding: 20px;
    display: inline-block;
    width: auto;
    letter-spacing: -0.5px;
}

h1, .container > h1 {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 60px;
    padding: 15px 35px;
    display: inline-block;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
    color: var(--primary-dark);
    font-size: 2rem;
}

h2 {
    color: var(--primary-dark);
    margin: 25px 0 15px 0;
    font-weight: 600;
    border-left: 5px solid var(--primary);
    padding-left: 15px;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* ========== NAVIGATION LINKS ========== */
.nav-links, .admin-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 60px;
    padding: 12px 25px;
    margin-bottom: 35px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: var(--glass-border);
}

.nav-links a, .admin-nav a {
    margin: 0 15px;
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.nav-links a::after, .admin-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::after, .admin-nav a:hover::after {
    width: 80%;
}

.nav-links a:hover, .admin-nav a:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

/* ========== BOOK GRID ========== */
.book-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.book-card {
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.book-card:hover::before {
    transform: scaleX(1);
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.book-card h3 {
    color: var(--primary-dark);
    margin-bottom: 12px;
    font-size: 1.4rem;
}

.book-card p {
    color: var(--gray);
    margin: 8px 0;
}

.book-card p:first-of-type {
    color: var(--dark);
    font-weight: 500;
}

.book-card p:last-of-type {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ========== ANGGOTA CARDS ========== */
.anggota-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.anggota-card {
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.anggota-card::after {
    content: '👤';
    position: absolute;
    bottom: 10px;
    right: 20px;
    font-size: 60px;
    opacity: 0.1;
    pointer-events: none;
}

.anggota-card:hover {
    transform: translateY(-5px) scale(1.02);
    background: rgba(255, 255, 255, 0.98);
}

.anggota-card h3 {
    color: var(--primary-dark);
    font-size: 1.5rem;
}

.anggota-card p {
    margin: 10px 0;
    color: var(--gray);
}

.anggota-card p:first-of-type {
    font-weight: 600;
    color: var(--primary);
}

/* ========== FORM STYLING ========== */
form {
    max-width: 550px;
    margin: 0 auto;
    padding: 35px;
    border-radius: 25px;
}

form label {
    display: block;
    margin: 20px 0 8px 0;
    font-weight: 600;
    color: var(--dark);
}

form input, form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

form input:focus, form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    transform: scale(1.01);
}

form textarea {
    resize: vertical;
    min-height: 120px;
}

button, .btn, input[type="submit"], button[type="submit"] {
    background: var(--gradient-1);
    color: white;
    padding: 14px 32px;
    border: none;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 25px;
    width: 100%;
    letter-spacing: 0.5px;
}

button:hover, .btn:hover, input[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.05);
}

button:active, .btn:active {
    transform: translateY(0);
}

/* ========== TABLE STYLING (Admin Dashboard) ========== */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 20px;
    margin: 20px 0;
}

th {
    background: var(--gradient-1);
    color: white;
    padding: 16px;
    font-weight: 600;
    text-align: left;
}

th:first-child { border-top-left-radius: 20px; }
th:last-child { border-top-right-radius: 20px; }

td {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.95);
}

tr:last-child td:first-child { border-bottom-left-radius: 20px; }
tr:last-child td:last-child { border-bottom-right-radius: 20px; }

tr:hover td {
    background: rgba(255, 255, 255, 1);
}

table a {
    color: var(--primary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
    display: inline-block;
}

table a:first-child:hover {
    background: var(--success);
    color: white;
}

table a:last-child:hover {
    background: var(--danger);
    color: white;
}

/* ========== ERROR & ALERT MESSAGES ========== */
.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: var(--danger);
    padding: 14px 20px;
    border-radius: 15px;
    margin: 20px auto;
    text-align: center;
    border-left: 5px solid var(--danger);
    max-width: 500px;
}

.success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: var(--success);
    padding: 14px 20px;
    border-radius: 15px;
    margin: 20px auto;
    text-align: center;
    border-left: 5px solid var(--success);
}

/* ========== LOGIN FORM SPECIFIC ========== */
.form-login {
    max-width: 450px;
    margin: 30px auto;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8rem;
        padding: 12px 24px;
    }
    
    .book-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .anggota-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .nav-links a, .admin-nav a {
        margin: 0 8px;
        font-size: 14px;
    }
    
    table {
        font-size: 12px;
    }
    
    td, th {
        padding: 10px 8px;
    }
    
    table a {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    form {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .nav-links, .admin-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .nav-links a, .admin-nav a {
        margin: 0 5px;
    }
    
    .book-card {
        padding: 18px;
    }
}

/* ========== SCROLLBAR CUSTOM ========== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========== BUTTON GROUP (Admin Dashboard) ========== */
.admin-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.admin-actions a {
    background: var(--gradient-3);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-actions a:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

/* ========== FLOATING BACK TO TOP BUTTON (Optional) ========== */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--gradient-1);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
    font-size: 24px;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-3px);
}



/* ========== TAMBAHAN UNTUK INDEX.PHP ========== */

/* Hero Section */
.hero-section {
    transition: all 0.3s ease;
}

.hero-section:hover {
    transform: translateY(-3px);
}

/* Book Card dengan efek lebih hidup */
.book-card {
    display: flex;
    flex-direction: column;
    position: relative;
}

.book-card .book-icon {
    transition: all 0.3s ease;
}

.book-card:hover .book-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Empty state */
.empty-state {
    transition: all 0.3s ease;
}

.empty-state:hover {
    transform: scale(1.02);
}

/* Footer */
footer {
    transition: all 0.3s ease;
}

footer:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Tombol smooth */
.btn-primary, .btn-secondary {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Responsive footer */
@media (max-width: 768px) {
    footer {
        font-size: 12px;
        padding: 20px 15px;
    }
    
    .hero-section h2 {
        font-size: 22px !important;
    }
    
    .hero-section {
        padding: 30px 20px !important;
    }
}

/* Badge total buku */
#buku-list span {
    transition: all 0.3s ease;
}

#buku-list span:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.3) !important;
}

/* Animasi fade in untuk buku */
.book-card {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.book-card:nth-child(1) { animation-delay: 0.05s; }
.book-card:nth-child(2) { animation-delay: 0.1s; }
.book-card:nth-child(3) { animation-delay: 0.15s; }
.book-card:nth-child(4) { animation-delay: 0.2s; }
.book-card:nth-child(5) { animation-delay: 0.25s; }
.book-card:nth-child(6) { animation-delay: 0.3s; }