:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #10b981;
    --error: #ef4444;
    --glass: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Animation */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 400px;
    height: 400px;
    background: var(--primary);
    filter: blur(100px);
    opacity: 0.2;
    border-radius: 50%;
    animation: move 20s infinite alternate;
}

.blob-2 {
    background: var(--accent);
    right: -100px;
    top: -100px;
    animation-delay: -5s;
}

@keyframes move {
    from { transform: translate(0, 0); }
    to { transform: translate(100px, 100px); }
}

/* Auth Container */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 40px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    color: var(--text-muted);
    margin-top: 8px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--error);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    display: none;
}

/* Dashboard Styles */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 800;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
}

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

.user-badge {
    background: var(--glass);
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--glass-border);
}

.role-tag {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
}

.role-admin { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.role-user { background: rgba(99, 102, 241, 0.2); color: #818cf8; }

.main-content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

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

.stat-label { color: var(--text-muted); font-size: 0.875rem; }
.stat-value { font-size: 1.5rem; font-weight: 700; margin-top: 8px; }

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.search-container {
    margin-bottom: 30px;
    position: relative;
}

.search-input {
    width: 100%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 12px 16px;
    border-radius: 12px;
    color: white;
    font-size: 0.9rem;
    transition: 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(15, 23, 42, 0.6);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    margin-top: 8px;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    text-decoration: none;
    color: white;
    border-bottom: 1px solid var(--glass-border);
    transition: 0.2s;
}

.search-result-item:hover {
    background: var(--glass);
}

.search-result-img {
    width: 40px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
}

.search-result-info h4 {
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.search-result-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.book-card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.book-card:hover {
    transform: scale(1.03) translateY(-10px);
    box-shadow: 0 30px 60px -12px rgba(0,0,0,0.5);
}

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

.book-info {
    padding: 20px;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
}

.switcher {
    margin-bottom: 30px;
    display: flex;
    background: var(--glass);
    padding: 4px;
    border-radius: 12px;
    width: fit-content;
}

.switch-btn {
    padding: 8px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.switch-btn.active {
    background: var(--primary);
    color: white;
}
.layout-container {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 300px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 30px 20px;
    overflow-y: auto;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
}

.main-panel {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.side-nav-group {
    margin-bottom: 30px;
}

.side-nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 15px;
    padding-left: 10px;
    letter-spacing: 0.05em;
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.side-nav-item:hover, .side-nav-item.active {
    background: var(--glass);
    color: white;
}

.side-nav-item.active {
    background: var(--primary);
    color: white;
}

.panel-header {
    margin-bottom: 40px;
}

.panel-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
