/**
 * Frontend CSS for Libreria Sync
 */

/* Product Author/Publisher Info */
.libreria-product-info {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.libreria-product-info p {
    margin: 8px 0;
    font-size: 14px;
}

.libreria-product-info strong {
    color: #333;
    margin-right: 5px;
}

.libreria-product-info a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.libreria-product-info a:hover {
    text-decoration: underline;
    color: #135e96;
}

.libreria-author,
.libreria-publisher {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Author/Publisher Archive Pages */
.libreria-archive-header {
    margin-bottom: 30px;
    padding: 4rem 1.5rem;
    border-bottom: 2px solid #eee;
    text-align: center;
}

.libreria-archive-title {
    font-size: 4em;
    margin: 0;
    text-align: left !important;
    color: #fff;

}

.libreria-archive-description {
    font-size: 1.1em;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Author/Publisher Meta Info */
.libreria-entity-meta {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.libreria-entity-meta h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.libreria-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.libreria-meta-item {
    display: flex;
    flex-direction: column;
}

.libreria-meta-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.libreria-meta-value {
    font-size: 15px;
    color: #333;
}

/* Related Products Grid */
.libreria-related-products {
    margin-top: 40px;
}

.libreria-related-products h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.libreria-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.libreria-product-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.libreria-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.libreria-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2271b1, #135e96);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.libreria-product-card:hover::before {
    transform: scaleX(1);
}

.libreria-product-image {
    margin-bottom: 15px;
}

.libreria-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.libreria-product-title {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.libreria-product-title a {
    color: #333;
    text-decoration: none;
}

.libreria-product-title a:hover {
    color: #2271b1;
}

.libreria-product-price {
    font-size: 1.2em;
    font-weight: bold;
    color: #2271b1;
    margin: 10px 0;
}

.libreria-product-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

/* Archive Navigation */
.libreria-alphabet-nav {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.libreria-alphabet-nav h4 {
    margin: 0 0 15px 0;
    color: #333;
}

.libreria-alphabet-letters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.libreria-alphabet-letter {
    display: inline-block;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s ease;
}

.libreria-alphabet-letter:hover,
.libreria-alphabet-letter.active {
    background: #2271b1;
    border-color: #2271b1;
    color: white;
    text-decoration: none;
}

/* Popular Authors/Publishers Widget */
.libreria-popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.libreria-popular-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.libreria-popular-item:last-child {
    border-bottom: none;
}

.libreria-popular-name {
    font-weight: 500;
}

.libreria-popular-name a {
    color: #333;
    text-decoration: none;
}

.libreria-popular-name a:hover {
    color: #2271b1;
}

.libreria-popular-count {
    background: #e9ecef;
    color: #6c757d;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Breadcrumbs */
.libreria-breadcrumbs {
    margin: 20px 0;
    font-size: 14px;
}

.libreria-breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.libreria-breadcrumbs li {
    display: flex;
    align-items: center;
}

.libreria-breadcrumbs li:not(:last-child)::after {
    content: '›';
    margin: 0 8px;
    color: #666;
}

.libreria-breadcrumbs a {
    color: #2271b1;
    text-decoration: none;
}

.libreria-breadcrumbs a:hover {
    text-decoration: underline;
}

.libreria-breadcrumbs .current {
    color: #666;
    font-weight: 500;
}

/* Entity Statistics */
.libreria-entity-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.libreria-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.libreria-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.libreria-stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #2271b1;
    margin-bottom: 5px;
}

.libreria-stat-label {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {

    .libreria-archive-header {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .libreria-archive-title {
        font-size: 1.2rem;
    }
    
    .libreria-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .libreria-meta-grid {
        grid-template-columns: 1fr;
    }
    
    .libreria-alphabet-letters {
        gap: 5px;
    }
    
    .libreria-alphabet-letter {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .libreria-product-info {
        padding: 12px;
    }
    
    .libreria-breadcrumbs li:not(:last-child)::after {
        margin: 0 5px;
    }
    
    .libreria-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .libreria-products-grid {
        grid-template-columns: 1fr;
    }
    
    .libreria-alphabet-nav {
        padding: 15px;
    }
    
    .libreria-alphabet-letters {
        gap: 3px;
    }
    
    .libreria-alphabet-letter {
        padding: 5px 8px;
        font-size: 13px;
    }
    
    .libreria-entity-meta {
        padding: 15px;
    }
    
    .libreria-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .libreria-product-info {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .libreria-product-info strong {
        color: #e2e8f0;
    }
    
    .libreria-entity-meta {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .libreria-product-card {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .libreria-alphabet-nav {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}