/* Reusable UI components for the reading app */

/* Book card component */
.book-card {
    background-color: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px var(--shadow-color);
    margin-bottom: 16px;
    transition: transform 0.2s ease;
}

.book-card:active {
    transform: scale(0.98);
}

.book-cover {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-color);
}

.book-info {
    padding: 12px;
}

.book-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
}

.book-author {
    font-size: 14px;
    color: var(--light-text);
    margin-bottom: 8px;
}

.book-stats {
    display: flex;
    font-size: 12px;
    color: var(--light-text);
}

.book-rating {
    margin-right: 12px;
}

.book-rating i {
    color: #ffcc00;
}

/* Navigation bar component */
.nav-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 10px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--light-text);
    font-size: 10px;
}

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

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

/* Header component */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.header-actions {
    display: flex;
    align-items: center;
}

.header-btn {
    border: none;
    background: transparent;
    font-size: 18px;
    color: var(--text-color);
    padding: 5px 10px;
    cursor: pointer;
}

/* Search bar component */
.search-bar {
    background-color: var(--secondary-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 8px 15px;
    margin: 10px 15px;
}

.search-icon {
    color: var(--light-text);
    margin-right: 10px;
    font-size: 16px;
}

.search-input {
    border: none;
    background: transparent;
    flex-grow: 1;
    color: var(--text-color);
    font-size: 16px;
}

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

/* Tabs component */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-color);
    overflow-x: auto;
    white-space: nowrap;
}

.tab {
    padding: 12px 20px;
    font-size: 15px;
    color: var(--light-text);
    position: relative;
}

.tab.active {
    color: var(--primary-color);
    font-weight: 600;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    width: 60%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

/* Button component */
.btn {
    padding: 10px 20px;
    border-radius: 20px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

/* Progress bar */
.progress-bar {
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* Tag component */
.tag {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--secondary-color);
    border-radius: 15px;
    font-size: 12px;
    color: var(--light-text);
    margin-right: 8px;
    margin-bottom: 8px;
}

/* Comment component */
.comment {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
}

.comment-user {
    font-weight: 600;
    font-size: 14px;
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.comment-actions {
    display: flex;
    color: var(--light-text);
    font-size: 12px;
}

.comment-action {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.comment-action i {
    margin-right: 4px;
}

/* Reading settings panel */
.reading-settings {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    box-shadow: 0 -5px 15px var(--shadow-color);
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.reading-settings.active {
    transform: translateY(0);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.settings-title {
    font-size: 16px;
    font-weight: 600;
}

.settings-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--light-text);
}

.settings-option {
    margin-bottom: 15px;
}

.settings-label {
    margin-bottom: 8px;
    font-size: 14px;
}

.font-size-controls {
    display: flex;
    justify-content: space-between;
}

.font-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
}

/* Book shelf */
.bookshelf {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 15px;
}

.shelf-book {
    width: calc(33.333% - 10px);
    margin-bottom: 20px;
}

.shelf-book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 3px 8px var(--shadow-color);
}

.shelf-book-title {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    text-align: center;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Loading skeleton */
.skeleton {
    background-color: var(--secondary-color);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}