:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --accent: #f72585;
    --success: #4cc9f0;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --card-bg: rgba(255, 255, 255, 0.95);
    --sidebar-width: 280px;
    --header-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --radius-sm: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Animated Background */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: 
        radial-gradient(circle at 20% 80%, rgba(67, 97, 238, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(114, 9, 183, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(247, 37, 133, 0.1) 0%, transparent 50%);
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite linear;
}

@keyframes float {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-1000px) rotate(720deg); }
}

/* Main Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.logo-text h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-text span {
    color: var(--success);
    font-size: 0.9rem;
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.nav-item.active {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.portfolio-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portfolio-section h3 {
    color: white;
    font-size: 1rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

.portfolio-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.portfolio-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: var(--card-bg);
    padding: 20px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header h1 {
    color: var(--dark);
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.user-profile:hover {
    background: rgba(67, 97, 238, 0.2);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

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

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.card h3 {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 5px;
}

.card-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.card-trend {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.9rem;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

/* Efficiency Metric */
.efficiency-metric {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 40px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 15px 35px rgba(67, 97, 238, 0.3);
    position: relative;
    overflow: hidden;
}

.efficiency-metric::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.metric-content h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.metric-value {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.metric-detail {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.metric-detail-item {
    display: flex;
    flex-direction: column;
}

.metric-detail-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.metric-detail-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Search Container */
.search-container {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

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

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.search-input {
    flex: 1;
    padding: 18px 25px;
    border: 2px solid rgba(67, 97, 238, 0.2);
    border-radius: 50px;
    font-size: 1rem;
    background: white;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.search-btn {
    padding: 18px 35px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.3);
}

.filter-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(67, 97, 238, 0.1);
    border: none;
    border-radius: 50px;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary);
    color: white;
}

/* Performance Chart */
.performance-chart {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.chart-container {
    height: 350px;
    margin-top: 30px;
    position: relative;
}

.chart-bar {
    position: absolute;
    bottom: 0;
    width: 60px;
    border-radius: 8px 8px 0 0;
    transition: var(--transition);
}

.chart-bar:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.chart-label {
    position: absolute;
    bottom: -30px;
    text-align: center;
    width: 100%;
    font-weight: 600;
    color: var(--gray);
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.team-member {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.member-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    border: 5px solid white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.member-role {
    display: inline-block;
    padding: 5px 15px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 10px 0;
}

/* Results Container */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

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

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

.book-cover {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 4rem;
    position: relative;
}

.book-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.2));
}

.book-info {
    padding: 20px;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

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

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.book-category {
    padding: 5px 12px;
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.book-status {
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-available {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-checked-out {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 60px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Performance Stats */
.performance-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: var(--primary);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    font-size: 1.5rem;
    cursor: pointer;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }

/* Responsive Design */
@media (max-width: 1200px) {
    .sidebar {
        transform: translateX(-100%);
        background: rgba(15, 23, 42, 0.95);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .efficiency-metric {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .metric-detail {
        justify-content: center;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-btn {
        justify-content: center;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .results-container {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--primary), var(--secondary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(var(--primary-dark), var(--secondary));
}
