/* Основные стили */
.journals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.journal-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: #fff;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

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

/* Миниатюра журнала */
.journal-thumbnail {
    position: relative;
    height: 200px;
    background: #f5f5f5;
}

.journal-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #ddd;
    font-size: 50px;
}

/* Действия */
.journal-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    padding: 10px;
    background: rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: all 0.3s ease;
}

.journal-item:hover .journal-actions {
    transform: translateY(0);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #e74c3c;
    color: #fff;
    transform: scale(1.1);
}

/* Информация */
.journal-info {
    padding: 15px;
}

.journal-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.journal-date {
    font-size: 14px;
    color: #777;
}

/* Новый значок */
.new-badge {
    position: absolute;
    top: 10px;
    right: -30px;
    background: #e74c3c;
    color: white;
    padding: 5px 30px;
    transform: rotate(45deg);
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

/* Просмотр журнала */
#journal-viewer {
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
}

#journal-flipbook {
    width: 100%;
    height: 600px;
    margin: 0 auto;
    background: #f9f9f9;
}

.loading-state,
.error-state {
    text-align: center;
    padding: 50px;
}

.error-state {
    display: none;
}

/* Адаптивность */
@media (max-width: 768px) {
    .journals-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    #journal-flipbook {
        height: 400px;
    }
}