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

/* Base Styles */
html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    background: #0C0C0C;
    color: #FFFFFF;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
}

body {
    overflow-x: hidden;
    line-height: 1.5;
    background-color: #0C0C0C;
    padding-bottom: 60px; /* Add bottom padding to avoid content being covered by fixed footer ad */
}

/* Header Styles */
.header {
    padding: 15px 20px;
    background: #000000;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    color: #FFD700;
    text-decoration: none;
}

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

.action-icon {
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.action-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Back Button */
.back-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Header Title */
.header-title {
    font-size: 18px;
    font-weight: bold;
    color: #FFFFFF;
    margin: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #000000;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #FFFFFF;
    margin: 0;
}

.view-all {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 12px;
    opacity: 0.8;
}

.view-all:hover {
    opacity: 1;
}

/* Book Common Styles */
.book-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.book-wrapper {
    position: relative;
    display: block;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.book-item {
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.book-item:hover {
    transform: translateY(-3px);
}

.book-info {
    padding: 8px 0;
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 15px;
    color: #FFD700;
    font-weight: 500;
    margin: 0;
    flex: 0 0 auto;
}

/* Loading Animation */
@keyframes loading {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loading {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(255, 215, 0, 0.3);
    border-top: 4px solid #FFD700;
    animation: loading 0.8s linear infinite;
    margin: 40px auto;
}

/* Footer */
.footer {
    padding: 20px 0;
    background: #000000;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    margin-bottom: 8px;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
    margin: 0 5px;
}

.footer a:hover {
    color: #FFD700;
    text-decoration: underline;
}

/* Search Bar */
.search-bar {
    padding: 10px 20px;
    background: #000000;
}

.search-input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 25px;
    color: #FFFFFF;
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* AD Section */
.ad-section {
    margin: 20px 0;
    background: #000000;
    border-radius: 8px;
    overflow: hidden;
}

.ad-label {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
}

.ad-container {
    position: relative;
    width: 100%;
    background: #1a1a1a;
    text-align: center;
}

.ad-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

.ad-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    min-height: 200px;
    max-height: 300px;
}

/* Skeleton Loading */
.skeleton-book {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    aspect-ratio: 2/3;
    position: relative;
    overflow: hidden;
}

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

@keyframes skeleton-loading {
    100% {
        left: 100%;
    }
}