/* Goodreads Page Specific Styles */

:root {
  --goodreads-primary: #8B7355; /* Goodreads brown */
  --goodreads-secondary: #F4F1EA; /* Cream/beige background */
  --goodreads-accent: #D6B99F; /* Tan accent */
  --goodreads-dark: #382110; /* Dark brown */
  --goodreads-white: #FFFFFF;
  --goodreads-5star: #F4C430; /* Gold for 5 stars */
  --goodreads-4star: #8B7355; /* Brown for 4 stars */
  --goodreads-3star: #C19A6B; /* Tan for 3 stars */
  --goodreads-2star: #BC8F8F; /* Rosy brown for 2 stars */
  --goodreads-1star: #A0826D; /* Lighter brown for 1 star */
}

.goodreads-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 5%;
}

/* Goodreads Profile Button */
.goodreads-profile-link {
    text-align: center;
    margin: 2rem 0;
}

.goodreads-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--goodreads-primary) 0%, #A68968 100%);
    color: white;
    padding: 0.9rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(139, 115, 85, 0.3);
}

.goodreads-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 115, 85, 0.4);
}

.goodreads-button svg {
    flex-shrink: 0;
}

/* Loading and Error States */
.loading, .error {
    text-align: center;
    padding: 3rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
}

.error {
    color: #d32f2f;
    background-color: #ffebee;
    border-radius: 8px;
    margin: 2rem auto;
    max-width: 600px;
}

/* Summary Stats Grid */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 3rem 0;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--goodreads-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Additional Stats */
.additional-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0 3rem 0;
}

.additional-stats .stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.stat-detail {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* Section Title */
.section-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    text-align: center;
    margin: 3rem 0 2rem 0;
    color: #333;
}

/* Rating Distribution */
.rating-distribution {
    max-width: 800px;
    margin: 0 auto 3rem auto;
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.rating-bar-container {
    margin-bottom: 1.5rem;
}

.rating-bar-container:last-child {
    margin-bottom: 0;
}

.rating-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.rating-bar-label {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.star-icon {
    color: var(--goodreads-5star);
    font-size: 1.2rem;
}

.rating-bar-count {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #666;
}

.rating-bar-track {
    width: 100%;
    height: 24px;
    background-color: #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.rating-bar-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.6s ease-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
}

.rating-bar-fill.rating-5 {
    background: linear-gradient(90deg, var(--goodreads-5star) 0%, #FFD700 100%);
}

.rating-bar-fill.rating-4 {
    background: linear-gradient(90deg, var(--goodreads-4star) 0%, #9D8B70 100%);
}

.rating-bar-fill.rating-3 {
    background: linear-gradient(90deg, var(--goodreads-3star) 0%, #D4AF84 100%);
}

.rating-bar-fill.rating-2 {
    background: linear-gradient(90deg, var(--goodreads-2star) 0%, #CCA9A9 100%);
}

.rating-bar-fill.rating-1 {
    background: linear-gradient(90deg, var(--goodreads-1star) 0%, #B89878 100%);
}

.rating-bar-percentage {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.book-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    position: relative;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.book-cover-container {
    width: 100%;
    aspect-ratio: 2/3;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    background: linear-gradient(135deg, var(--goodreads-secondary) 0%, var(--goodreads-accent) 100%);
}

.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.book-stars {
    color: var(--goodreads-5star);
    font-size: 1rem;
    letter-spacing: 2px;
}

.book-rating-value {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.book-read-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #999;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.view-book-link {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--goodreads-primary);
    font-weight: 600;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .additional-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .rating-distribution {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .summary-stats {
        grid-template-columns: 1fr;
    }

    .additional-stats {
        grid-template-columns: 1fr;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .goodreads-container {
        padding: 1rem 3%;
    }

    .rating-distribution {
        padding: 1rem;
    }
}
