/* Spanish Learning Library CSS */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.library-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.library-header h1 {
    font-size: 2.5rem;
    color: #4a90e2;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.library-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.library-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.book-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.book-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

.book-cover {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-overlay-content {
    color: white;
}

.book-info {
    padding: 1.5rem;
}

.book-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.book-author {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.book-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.book-chapters {
    font-size: 0.9rem;
    color: #95a5a6;
}

.book-language {
    background: #4a90e2;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #667eea);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.book-actions {
    display: flex;
    gap: 0.5rem;
}

.btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: #4a90e2;
    color: white;
}

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #ecf0f1;
    color: #7f8c8d;
}

.btn-secondary:hover {
    background: #d5dbdb;
}

.empty-library {
    text-align: center;
    padding: 4rem 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.empty-library h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: white;
}

.empty-library p {
    font-size: 1.1rem;
    max-width: 400px;
    margin: 0 auto;
}

.library-footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* New book badge */
.new-book-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #e74c3c;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    z-index: 2;
}

/* Word count stats */
.word-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 0.5rem;
}

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

.word-stat-number {
    font-weight: 600;
    color: #4a90e2;
}

.word-stat-label {
    margin-top: 0.2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .library-header {
        padding: 1.5rem 1rem;
    }
    
    .library-header h1 {
        font-size: 2rem;
    }
    
    .library-main {
        padding: 0 1rem;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }
    
    .book-card {
        border-radius: 12px;
    }
    
    .book-info {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .book-card {
        max-width: 320px;
        margin: 0 auto;
    }
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.8);
}

.loading::before {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}