/* Voxtr Best Reads – Frontend styles
   Matches the original design from voxtr-landing-page.html exactly
*/

/* Best Reads Section */
.best-reads {
    padding: 96px 0;
    background: #FFFFFF;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #6B7280;
    margin: 0;
}

.suggest-link {
    color: #6B7280;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

.suggest-link:hover {
    color: #00D9FF;
}

.book-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.book-card {
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    padding: 24px;
    display: grid;
    grid-template-columns: auto 100px 1fr;
    gap: 24px;
    transition: all 0.2s ease;
    cursor: pointer;
    border-radius: 8px;
    align-items: center;
    position: relative;
}

.book-card:hover {
    border-color: #00D9FF;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.vote-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.vote-button {
    width: 32px;
    height: 32px;
    border: 1px solid #D1D5DB;
    background: #FFFFFF;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vote-button:hover {
    border-color: #00D9FF;
    background: #00D9FF;
    color: #FFFFFF;
}

.vote-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
}

.book-cover {
    width: 100px;
    height: 140px;
    background: linear-gradient(135deg, #D1D5DB 0%, #E7E9EC 100%);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Cover image styling */
.voxtr-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Fallback cover styling */
.voxtr-cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    color: #6B7280;
}

/* Cover test shortcode styling */
.voxtr-cover-test {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.voxtr-cover-test h3 {
    margin-top: 0;
    color: #0A0B0E;
}

.voxtr-cover-test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.voxtr-cover-test-item {
    text-align: center;
}

.voxtr-cover-test-item .book-cover {
    margin: 0 auto 10px;
}

.voxtr-cover-test-item p {
    margin: 5px 0;
    font-size: 12px;
}

.voxtr-cover-test-item code {
    background: #fff;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 10px;
    word-break: break-all;
}

/* Enhanced Accessibility Features */
.book-card:focus {
    outline: 2px solid #00D9FF !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px #00D9FF, 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.book-card:focus-within {
    outline: 2px solid #00D9FF !important;
    outline-offset: 2px !important;
}

/* Skip Link Styling */
.voxtr-skip-link {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 100000;
}

.voxtr-skip-link:focus {
    position: fixed !important;
    left: 10px !important;
    top: 10px !important;
    background: #00D9FF !important;
    color: #000 !important;
    padding: 10px !important;
    text-decoration: none !important;
    border-radius: 4px !important;
    font-weight: bold !important;
    z-index: 100000 !important;
}

/* Motion Controls */
.voxtr-motion-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    transition: opacity 0.5s ease;
}

.voxtr-motion-controls h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #0A0B0E;
}

.voxtr-motion-controls label {
    display: block;
    margin: 5px 0;
    font-size: 12px;
    cursor: pointer;
}

.voxtr-motion-controls input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #00D9FF;
}

.voxtr-motion-controls button {
    margin-top: 10px;
    padding: 5px 10px;
    font-size: 11px;
    background: #00D9FF;
    color: #000;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.voxtr-motion-controls button:hover {
    background: #00B8E6;
}

/* High Contrast Mode */
.voxtr-high-contrast .voxtr-cover-image {
    filter: contrast(1.5) brightness(1.2) !important;
}

.voxtr-high-contrast .book-card {
    border-width: 2px !important;
    box-shadow: 0 0 0 1px #000 !important;
}

.voxtr-high-contrast .book-cover {
    border: 2px solid #000 !important;
}

/* Dark Scheme Support */
.voxtr-dark-scheme .voxtr-motion-controls {
    background: #1a1a1a !important;
    color: #fff !important;
    border-color: #444 !important;
}

.voxtr-dark-scheme .voxtr-motion-controls h4 {
    color: #fff !important;
}

.voxtr-dark-scheme .voxtr-motion-controls input[type="checkbox"] {
    accent-color: #00D9FF !important;
}

/* Performance Warning */
.voxtr-performance-warning {
    position: fixed;
    top: 20px;
    left: 20px;
    background: #ff6b6b;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    animation: voxtr-warning-pulse 2s ease-in-out infinite;
}

@keyframes voxtr-warning-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Focus Indicators */
.voxtr-card-focused {
    box-shadow: 0 0 0 2px #00D9FF, 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .voxtr-cover-image,
    .book-card,
    .book-cover,
    .voxtr-motion-controls,
    .voxtr-performance-warning {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }

    .voxtr-motion-controls {
        display: none !important;
    }
}

/* High Contrast Media Query Support */
@media (prefers-contrast: high) {
    .book-card {
        border-width: 2px !important;
    }

    .book-cover {
        border: 2px solid #000 !important;
    }

    .voxtr-cover-image {
        filter: contrast(1.3) !important;
    }
}

/* Dark Mode Media Query Support */
@media (prefers-color-scheme: dark) {
    .voxtr-motion-controls {
        background: #1a1a1a !important;
        color: #fff !important;
        border-color: #444 !important;
    }
}

/* Performance Optimization Features */
.voxtr-cover-image[data-optimization="enabled"] {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.voxtr-cover-image[data-cdn="enabled"] {
    position: relative;
}

.voxtr-cover-image[data-cdn="enabled"]::after {
    content: 'CDN';
    position: absolute;
    top: 2px;
    right: 2px;
    background: #00D9FF;
    color: #000;
    font-size: 8px;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 2px;
    opacity: 0.8;
    pointer-events: none;
}

/* Performance Indicators */
.voxtr-performance-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: #28a745;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1000;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.voxtr-performance-indicator:hover {
    opacity: 1;
}

.voxtr-performance-indicator.cdn-active {
    background: #00D9FF;
    color: #000;
}

.voxtr-performance-indicator.compression-active {
    background: #ffc107;
    color: #000;
}

.voxtr-performance-indicator.preload-active {
    background: #17a2b8;
    color: #fff;
}

/* Load Balancing Indicators */
.voxtr-load-balance-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #6f42c1;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    z-index: 1000;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.voxtr-load-balance-indicator:hover {
    opacity: 1;
}

/* Connection Quality Indicators */
.voxtr-connection-indicator {
    position: fixed;
    bottom: 60px;
    left: 20px;
    background: #6c757d;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 1000;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.voxtr-connection-indicator.connection-fast {
    background: #28a745;
}

.voxtr-connection-indicator.connection-slow {
    background: #ffc107;
    color: #000;
}

.voxtr-connection-indicator.connection-very-slow {
    background: #dc3545;
}

/* Performance Metrics Display */
.voxtr-metrics-display {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-size: 11px;
    font-family: 'Monaco', 'Menlo', monospace;
    z-index: 1000;
    max-width: 300px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.voxtr-metrics-display:hover {
    opacity: 1;
    pointer-events: auto;
}

.voxtr-metrics-display h4 {
    margin: 0 0 10px 0;
    color: #00D9FF;
    font-size: 12px;
}

.voxtr-metrics-display .metric {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
}

.voxtr-metrics-display .metric-value {
    color: #00D9FF;
    font-weight: bold;
}

/* CDN Status Indicators */
.voxtr-cdn-status {
    position: fixed;
    top: 140px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    font-size: 10px;
    z-index: 1000;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.voxtr-cdn-status.cdn-active {
    background: rgba(0, 217, 255, 0.9);
    color: #000;
}

.voxtr-cdn-status .status-item {
    display: flex;
    justify-content: space-between;
    margin: 2px 0;
}

/* Performance Warnings Enhanced */
.voxtr-performance-warning.connection-slow {
    background: #ffc107;
    color: #000;
}

.voxtr-performance-warning.connection-very-slow {
    background: #dc3545;
    color: #fff;
}

.voxtr-performance-warning.cdn-unavailable {
    background: #6f42c1;
    color: #fff;
}

/* Optimization Status */
.voxtr-optimization-status {
    position: fixed;
    bottom: 100px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 10px;
    z-index: 1000;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.voxtr-optimization-status .status-line {
    margin: 2px 0;
}

.voxtr-optimization-status .status-enabled {
    color: #28a745;
}

.voxtr-optimization-status .status-disabled {
    color: #6c757d;
}

.book-info {
    flex: 1;
}

.book-labels {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
}

.label-original {
    background: #0A0B0E;
    color: #FFFFFF;
}

.book-info h3 {
    font-family: 'Inter', sans-serif;
    font-size: 20px;
    margin-bottom: 4px;
    color: #0A0B0E;
    font-weight: 600;
}

.book-meta {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.book-meta .separator {
    width: 3px;
    height: 3px;
    background: #6B7280;
    border-radius: 50%;
    opacity: 0.5;
}

.book-description {
    color: #6B7280;
    line-height: 1.5;
    font-size: 14px;
    margin-bottom: 12px;
}

.book-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #6B7280;
}

.book-actions a {
    color: #00D9FF;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.book-actions a:hover {
    color: #00B8E6;
}

.discussion-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.load-more {
    text-align: center;
    margin-top: 32px;
}

.load-more button {
    background: transparent;
    border: 1px solid #D1D5DB;
    padding: 12px 32px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6B7280;
}

.load-more button:hover {
    border-color: #00D9FF;
    color: #00D9FF;
}

/* Responsive Design */
@media (max-width: 968px) {
    .book-card {
        grid-template-columns: auto 80px 1fr;
        gap: 16px;
    }
    
    .book-cover {
        width: 80px;
        height: 112px;
    }
}

@media (max-width: 640px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .book-card {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .vote-section {
        flex-direction: row;
        justify-content: center;
        margin-bottom: 16px;
    }
    
    .book-cover {
        margin: 0 auto 16px;
    }
}
