:root {
    --primary-green: #42b746;
    --dark: #1a1a1a;
    --gray: #666;
    --light-bg: #f9f9f9;
    --white: #ffffff;
}

/* 1. GLOBAL SETUP */
body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; 
    background: var(--light-bg); 
    margin: 0; 
    color: var(--dark);
}

.workspace-wrapper { 
    max-width: 1000px; /* Slightly wider to accommodate the grid better */
    margin: 0 auto; 
    padding: 20px; 
}

/* 2. PROFILE SECTION */
.profile-header {
    background: var(--white);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.avatar {
    width: 80px; 
    height: 80px; 
    background: #e0e0e0;
    border-radius: 50%; 
    margin: 0 auto 15px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 2rem;
}

.stats-bar {
    display: flex; 
    justify-content: center; 
    gap: 40px; 
    margin: 20px 0;
}

.stat-item { text-align: center; }
.stat-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--dark); }
.stat-label { color: var(--gray); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* 3. TABS */
.workspace-tabs {
    display: flex; 
    border-bottom: 2px solid #eee; 
    margin-top: 10px;
}

.tab-link {
    background: none; 
    border: none; 
    padding: 15px 25px;
    cursor: pointer; 
    font-size: 1rem; 
    color: var(--gray);
    transition: 0.3s;
}

.tab-link.active {
    color: var(--primary-green); 
    border-bottom: 3px solid var(--primary-green);
    font-weight: bold;
}

.tab-content { display: none; padding: 20px 0; }
.tab-content.show { display: block; }

/* 4. THE FIX: BOOK GRID (Matching Home Page) */
.section-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 10px;
}

.create-btn {
    background: var(--primary-green); 
    color: var(--white); 
    padding: 10px 20px;
    text-decoration: none; 
    border-radius: 8px; 
    font-weight: bold;
    font-size: 0.9rem;
    transition: 0.2s;
}

.create-btn:hover {
    background: #36963a;
    transform: translateY(-2px);
}

.book-grid {
    display: grid; 
    /* This minmax ensures the covers stay consistent */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 25px; 
    margin-top: 20px;
}

/* 5. THE FIX: BOOK CARDS (Exact Home Style) */
.book-card {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.book-card img {
    width: 100%;
    /* Forced 2:3 Aspect Ratio */
    aspect-ratio: 2 / 3; 
    object-fit: cover;
    border-radius: 12px; /* Smooth rounded corners from screenshot */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: block;
}

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

.book-card h4 {
    margin: 12px 0 4px 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    /* Prevent title from overlapping if too long */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-stats {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 500;
}