:root {
    --bg-color: #0b0f19;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --card-bg: rgba(30, 41, 59, 0.4);
    --border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(15, 23, 42, 0.6);
    --font-family: 'Outfit', sans-serif;
    --success: #10b981;
    --error: #ef4444;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%);
    background-attachment: fixed;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
}

/* Glassmorphism Classes */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
}

.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-family);
    transition: color 0.3s, transform 0.2s;
}

.nav-links button:hover,
.nav-links button.active {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.logout-btn {
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: var(--accent);
    color: var(--bg-color);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
}

.hidden {
    display: none !important;
}

/* Search Section */
.search-header {
    text-align: center;
    margin-bottom: 3rem;
}

.search-header h2,
.search-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(to right, #e2e8f0, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.search-subtitle {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.empty-msg {
    color: var(--text-secondary);
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 0;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    border-radius: 30px;
    padding: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-box button {
    background: var(--accent);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--accent-hover);
}

/* Grid Layout */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Cards */
.book-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.book-cover {
    width: 100%;
    height: 200px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    object-fit: contain;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.book-cover-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.book-title {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
    flex-grow: 1;
}

.book-source {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    align-self: flex-start;
    margin-bottom: 1rem;
}

.source-gutenberg {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

.source-annas {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
}

.source-libgen {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

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

.btn {
    flex: 1;
    padding: 0.6rem;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.4);
}

/* Loader */
.loader {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent);
    animation: spin 1s ease-in-out infinite;
    margin: 2rem auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Notification */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.success { border-left: 4px solid var(--success); }
.notification.error { border-left: 4px solid var(--error); }

/* Login Page overrides */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
    background: linear-gradient(to right, #e2e8f0, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s;
}

.input-group input:focus {
    border-color: var(--accent);
}

.error-msg {
    color: var(--error);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
