/**
 * Kwekanyaw Main Styles
 * Additional styles to complement style.css
 * 
 * @package Kwekanyaw
 * @version 2.0.0
 */

/* ==========================================================================
   Page Templates
   ========================================================================== */

/* Archive Page */
.archive-header {
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--kw-border, #e5e5e5);
}

.archive-title {
    font-size: 2rem;
    color: var(--kw-heading, #333);
    margin: 0 0 0.5rem;
    font-family: var(--kw-custom-font, 'YanoneKaffeesatz', sans-serif);
}

.archive-description {
    color: var(--kw-text-muted, #666);
    font-size: 1rem;
    max-width: 60ch;
}

/* Search Results */
.search-results-header {
    padding: 2rem 0;
    margin-bottom: 2rem;
    text-align: center;
    background: var(--kw-bg-light, #f9f6f2);
    border-radius: 8px;
}

.search-results-title {
    font-size: 1.5rem;
    color: var(--kw-heading, #333);
}

.search-results-title .search-term {
    color: var(--kw-primary, #8B4513);
    font-style: italic;
}

.search-results-count {
    color: var(--kw-text-muted, #666);
    margin-top: 0.5rem;
}

/* ==========================================================================
   Book Display Enhancements
   ========================================================================== */

/* Book Card */
.book-card {
    position: relative;
    transition: all 0.3s ease;
}

.book-card:hover {
    z-index: 10;
}

/* Book Cover Effects */
.book-cover-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.08);
}

.book-cover-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%
    );
    pointer-events: none;
}

/* Book Badge */
.book-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    z-index: 5;
}

.book-badge.new {
    background: var(--kw-accent, #D2691E);
    color: #fff;
}

.book-badge.featured {
    background: var(--kw-primary, #8B4513);
    color: #fff;
}

.book-badge.popular {
    background: #FFD700;
    color: #333;
}

/* Book Info Overlay */
.book-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.book-card:hover .book-info-overlay {
    transform: translateY(0);
}

.book-info-overlay .book-title {
    font-size: 1rem;
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.book-info-overlay .book-author {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ==========================================================================
   Rating Stars
   ========================================================================== */

.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.star-rating .star {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.star-rating .star.filled {
    color: #FFD700;
}

.star-rating .star.empty {
    color: #ddd;
}

.star-rating .star.half {
    position: relative;
}

.star-rating .rating-value {
    margin-left: 0.5rem;
    font-size: 0.85rem;
    color: var(--kw-text-muted, #666);
}

/* ==========================================================================
   Genre Tags
   ========================================================================== */

.genre-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.genre-tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--kw-bg-light, #f5f5f5);
    color: var(--kw-text, #333);
    font-size: 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--kw-border, #e5e5e5);
}

.genre-tag:hover {
    background: var(--kw-primary, #8B4513);
    color: #fff;
    border-color: var(--kw-primary, #8B4513);
}

/* ==========================================================================
   Download Button
   ========================================================================== */

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--kw-primary, #8B4513);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.download-btn:hover {
    background: var(--kw-primary-dark, #654321);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.3);
}

.download-btn svg,
.download-btn .icon {
    width: 20px;
    height: 20px;
}

.download-btn.secondary {
    background: transparent;
    color: var(--kw-primary, #8B4513);
    border: 2px solid var(--kw-primary, #8B4513);
}

.download-btn.secondary:hover {
    background: var(--kw-primary, #8B4513);
    color: #fff;
}

/* ==========================================================================
   Comments Section
   ========================================================================== */

.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--kw-border, #e5e5e5);
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--kw-heading, #333);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment {
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: var(--kw-bg-light, #f9f6f2);
    border-radius: 8px;
}

.comment .children {
    margin-top: 1rem;
    margin-left: 2rem;
    padding-left: 1rem;
    border-left: 2px solid var(--kw-border, #e5e5e5);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.comment-author .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
    color: var(--kw-heading, #333);
}

.comment-metadata {
    font-size: 0.85rem;
    color: var(--kw-text-muted, #666);
}

.comment-content {
    line-height: 1.6;
}

.comment-reply-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--kw-primary, #8B4513);
    text-decoration: none;
}

.comment-reply-link:hover {
    text-decoration: underline;
}

/* Comment Form */
.comment-respond {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--kw-bg-light, #f9f6f2);
    border-radius: 8px;
}

.comment-reply-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--kw-border, #ddd);
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--kw-primary, #8B4513);
}

.comment-form .submit {
    background: var(--kw-primary, #8B4513);
    color: #fff;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .submit:hover {
    background: var(--kw-primary-dark, #654321);
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */

.sidebar .widget {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.sidebar .widget-title {
    font-size: 1.1rem;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--kw-primary, #8B4513);
    color: var(--kw-heading, #333);
}

.sidebar .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar .widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--kw-border-light, #f0f0f0);
}

.sidebar .widget li:last-child {
    border-bottom: none;
}

.sidebar .widget a {
    color: var(--kw-text, #333);
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar .widget a:hover {
    color: var(--kw-primary, #8B4513);
}

/* Recent Books Widget */
.widget-recent-books .book-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
}

.widget-recent-books .book-thumb {
    width: 50px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 3px;
    overflow: hidden;
}

.widget-recent-books .book-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.widget-recent-books .book-info {
    flex: 1;
}

.widget-recent-books .book-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.widget-recent-books .book-author {
    font-size: 0.8rem;
    color: var(--kw-text-muted, #666);
}

/* ==========================================================================
   Footer Widgets
   ========================================================================== */

.footer-widgets {
    padding: 3rem 0;
    background: var(--kw-footer-bg, #333);
    color: #fff;
}

.footer-widgets .widget {
    margin-bottom: 2rem;
}

.footer-widgets .widget-title {
    font-size: 1.1rem;
    margin: 0 0 1.25rem;
    color: #fff;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-widgets .widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--kw-accent, #D2691E);
}

.footer-widgets a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-widgets a:hover {
    color: #fff;
}

.footer-widgets ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widgets li {
    padding: 0.4rem 0;
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

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

.animate-slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

/* Staggered Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }
.visible { display: block !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 768px) {
    .archive-header,
    .search-results-header {
        padding: 1.5rem;
    }
    
    .archive-title,
    .search-results-title {
        font-size: 1.5rem;
    }
    
    .footer-widgets {
        padding: 2rem 0;
    }
    
    .footer-widgets .widget {
        margin-bottom: 1.5rem;
    }
    
    .comment .children {
        margin-left: 1rem;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .book-card {
        margin-bottom: 1rem;
    }
    
    .comment-author .avatar {
        width: 36px;
        height: 36px;
    }
    
    .sidebar .widget {
        padding: 1rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .no-print,
    .download-btn,
    .comment-respond,
    .social-share,
    .sidebar {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .book-cover-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
}
